This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Infrastructure\Email; | |
use Symfony\Component\Mailer\Transport\Dsn; | |
use Symfony\Component\Mailer\Transport\Smtp\Auth\AuthenticatorInterface; | |
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; | |
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// src/DependencyInjection/CacheWarmerCompilerPass.php | |
namespace App\DependencyInjection; | |
use App\Cache\MyCacheWarmer; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Exception\EnvNotFoundException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class CommandHelper | |
{ | |
public static function getStringOption(InputInterface $input, string $name): ?string | |
{ | |
$optionData = $input->getOption($name); | |
if (null !== $optionData && !\is_string($optionData)) { | |
throw new \InvalidArgumentException(sprintf('Invalid data provided for --%s', $name)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\EventListener; | |
use App\Doctrine\Encryption\EncryptingEntityInterface; | |
use App\Doctrine\Encryption\EncryptorInterface; | |
use Doctrine\Common\EventSubscriber; | |
use Doctrine\ORM\Event\LifecycleEventArgs; | |
use Doctrine\ORM\Event\PreFlushEventArgs; | |
use Doctrine\ORM\Events; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$repos = array(); | |
exec('find -type d -name .git | sed -e "s/\.git//"', $repos); | |
foreach ($repos as $repo) { | |
$status = shell_exec("cd $repo && git status"); | |
if (false == strpos($status, 'nothing to commit (working directory clean)')) { | |
echo "$repo\n" . str_repeat('-', strlen($repo)) . "\n$status\n\n"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Liip\AcmeBundle\Filter; | |
use Sonata\AdminBundle\Form\Type\Filter\ChoiceType; | |
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; | |
use Sonata\DoctrineORMAdminBundle\Filter\StringFilter; | |
class CaseInsensitiveStringFilter extends StringFilter | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the file is markdown, but gist renders markdown. remove ".raw" and this line | |
--- | |
title: Pictures example post | |
images: | |
- | |
file: TestImage.jpg | |
caption: This is a test | |
note: Additional stuff to print next to the image | |
- | |
file: TestImage2.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An implementation of the MutableAclProviderInterface using Doctrine DBAL. | |
* | |
* @author Stefan Paschke <stefan.paschke@liip.ch> | |
*/ | |
class MutableAclProvider extends BaseMutableAclProvider | |
{ | |
/** | |
* Get the entities Ids for the className that match the given role & mask | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Dbu\UtilBundle\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Finder\Finder; | |
use Symfony\Component\Translation\MessageCatalogue; | |
use Symfony\Component\Translation\Loader\LoaderInterface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace Infrastructure\Symfony\DependencyInjection\Compiler; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Definition; |
NewerOlder