View fixmocks.php
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 | |
$file = $argv[1]; | |
$code = file_get_contents($file); | |
preg_match_all('/\$this->(.*)\s+=\s+\$this->createMock\((.*)::class\);/', $code, $matches); | |
foreach ($matches[2] as $key => $className) { | |
$propertyName = trim($matches[1][$key]); |
View Banks.php
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 Banks\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; |
View gist:4d6dd4e1b7c0011ad233f8de090500ae
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 | |
// original | |
foreach ($this->migrationTable->getColumnNames() as $columnName) { | |
if (! $table->hasColumn($columnName)) { | |
$this->upToDate = false; | |
break; | |
} | |
} |
View AuthenticatedRecentlyVoter.php
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 MyProject\Bundle\MainBundle\Security\Authorization\Voter; | |
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface; | |
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; | |
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; | |
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; | |
/** |
View pre-commit
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/env bash | |
ROOT="/data/devo/current" | |
echo "OpenSky pre commit hook start" | |
PHP_CS_FIXER="vendor/bin/php-cs-fixer" | |
HAS_PHP_CS_FIXER=false | |
HAS_JSHINT=false |
View .php_cs
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 | |
return Symfony\CS\Config\Config::create() | |
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) | |
->fixers([ | |
'short_array_syntax', | |
'ordered_use', | |
]) | |
; |
View SmartSquareFilter.php
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 | |
class SmartSquareFilter extends AbstractImagickFilter | |
{ | |
protected function doApply(\Imagick $im) | |
{ | |
$target = $im->getImageGeometry(); | |
if ($target['width'] === $target['height']) { | |
// return early if already square |
View SimpleHttpTest.php
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 | |
use PHPUnit_Framework_TestCase; | |
use Symfony\Component\DomCrawler\Crawler; | |
class SimpleHttpTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testHttp() | |
{ | |
$crawler = new Crawler(file_get_contents('http://myapp.lcl/hello/Jon')); |
View ObjectSerializer.php
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 | |
use Doctrine\Common\Collections\Collection; | |
use Doctrine\Common\Persistence\ObjectManager; | |
class ObjectSerializer | |
{ | |
private $om; | |
public function __construct(ObjectManager $om) |
View SporkCacheWarmerAggregate.php
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\Component\HttpKernel\CacheWarmer; | |
use Spork\Batch\Strategy\ChunkStrategy; | |
use Spork\ProcessManager; | |
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate; | |
class SporkCacheWarmerAggregate extends CacheWarmerAggregate | |
{ |
NewerOlder