Skip to content

Instantly share code, notes, and snippets.

View ger86's full-sized avatar
๐Ÿ 
Working from home

Gerardo Fernรกndez Moreno ger86

๐Ÿ 
Working from home
View GitHub Profile
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\StripePlanRepository")
*/
class StripePlan
<?php
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\ORM\EntityManagerInterface;
<?php
namespace App\Service\Donation;
use Stripe\Plan;
use App\Enum\StripeConsts;
use App\Model\DTO\StripeCreatePlanDTO;
use App\Service\StripeCreateProduct;
use App\Service\StripeCreatePlan;
<?php
namespace App\Service\Stripe;
use Stripe\Stripe;
use Stripe\Plan;
use App\Model\DTO\StripeCreatePlanDTO;
use App\Service\StripeUtils;
final class StripeCreatePlan {
<?php
namespace App\Service;
use Stripe\Stripe;
use Stripe\Product;
final class StripeCreateProduct {
/**
<?php
namespace App;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
class ShortcodesPass extends BaseKernel implements CompilerPassInterface {
<?php
namespace App\Shortcode;
interface ShortcodeInterface {
const SHORTCODE_TAG = 'lac.shortcode';
function getName(): string;
function getArgs(): array;
public function apply(array $attrs, string $content): string;
}
<?php
namespace App\Shortcode;
final class ButtonShortcode implements ShortcodeInterface {
public function getName(): string {
return 'well';
}
public function getArgs(): array {
return [];
<?php
namespace App\Shortcode;
interface ShortcodeInterface {
function getName(): string;
function getArgs(): array;
public function apply(array $attrs, string $content): string;
}
<?php
namespace App\Service;
final class ShortcodeService {
private $shortcodes = [];
public function isShortcode($name) {
return isset($this->shortcodes[$name]);
}