Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I am still here.

Jonathan H. Wage jwage

💭
I am still here.
View GitHub Profile
View Banks.php
<?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
<?php
// original
foreach ($this->migrationTable->getColumnNames() as $columnName) {
if (! $table->hasColumn($columnName)) {
$this->upToDate = false;
break;
}
}
View AuthenticatedRecentlyVoter.php
<?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
#!/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
@jwage
jwage / .php_cs
Last active Aug 21, 2020
php-cs-fixer git pre commit hook
View .php_cs
<?php
return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'short_array_syntax',
'ordered_use',
])
;
View SmartSquareFilter.php
<?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
<?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
<?php
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Persistence\ObjectManager;
class ObjectSerializer
{
private $om;
public function __construct(ObjectManager $om)
View SporkCacheWarmerAggregate.php
<?php
namespace App\Component\HttpKernel\CacheWarmer;
use Spork\Batch\Strategy\ChunkStrategy;
use Spork\ProcessManager;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate;
class SporkCacheWarmerAggregate extends CacheWarmerAggregate
{
@jwage
jwage / Cartesian.php
Created Apr 22, 2014
PHP Cartesian Function
View Cartesian.php
<?php
$attributeValues = array(
'color' => array('Red', 'White', 'Blue'),
'size' => array(1, 2, 3, 4),
'fabric' => array('Cloth', 'Silk')
);
class Cartesian
{
You can’t perform that action at this time.