This file contains hidden or 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 My\Bundle\BlockBundle\Block; | |
use Symfony\Component\HttpFoundation\Response; | |
use Sonata\BlockBundle\Model\BlockInterface; | |
use Sonata\BlockBundle\Block\BaseBlockService; | |
use Sonata\AdminBundle\Form\FormMapper; | |
use Sonata\AdminBundle\Validator\ErrorElement; |
This file contains hidden or 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
public function setProfileImage($profile_image) | |
{ | |
$this->profile_image = $profile_image; | |
if ($profile_image instanceof UploadedFile) { | |
$this->setUpdatedAt(new \DateTime()); | |
} | |
} |
This file contains hidden or 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 Silex\WebTestCase; | |
use Silex\Application; | |
use Silex\Provider\SessionServiceProvider; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage; | |
class unitTest extends WebTestCase | |
{ |
This file contains hidden or 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 Silex\WebTestCase; | |
use Silex\Application; | |
use Silex\Provider\SessionServiceProvider; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; | |
class unitTest extends WebTestCase | |
{ | |
public function testUn() |
This file contains hidden or 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 | |
interface MyAPI | |
{ | |
public function getThing(); | |
} | |
class MyApiImplentation implements MyAPI | |
{ | |
public function getThing() |
This file contains hidden or 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
#!/bin/bash | |
source /etc/profile | |
git init | |
mv base.iml $1.iml | |
cd .idea/ | |
cat modules.xml | sed "s/base/$1/g" > modules.xml.new | |
mv modules.xml.new modules.xml |
This file contains hidden or 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
PATH=$PATH:$HOME/bin |
This file contains hidden or 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 BadCharacterMungerFilter extends sfFilter | |
{ | |
public function execute($filterChain) | |
{ | |
$filterChain->execute(); | |
// Execute this filter only once | |
if ($this->isFirstCall()) { | |
$response = $this->getContext()->getResponse(); |
This file contains hidden or 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 Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\HttpKernel\HttpKernel; | |
class SSLManagementListener | |
{ | |
private $domain; |
This file contains hidden or 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
public function isEmailUnique($email_address) | |
{ | |
$qb = $this->createQueryBuilder('e') | |
->select('COUNT(e.id)') | |
->where('e.email_address = :email') | |
->setParameter('email', $email_address); | |
$result = $qb->getQuery()->getSingleScalarResult(); | |
if ($result > 0) |