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 Foo; | |
class Module | |
{ | |
/* This config willk be cached */ | |
public function getConfig() { return []; } | |
/** | |
* This config will NOT be cached |
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 DrWolff\EventManagement\Entity\Seminar; | |
use DrWolff\EventManagement\Entity\MetaData; | |
use DrWolff\EventManagement\Entity\MetaDataProvider; | |
use DrWolff\EventManagement\Entity\WithProviderForImmutables; | |
final class CoreData | |
{ |
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 | |
/** | |
* @author Manuel Stosic <[email protected]> | |
*/ | |
namespace DrWolff\EventManagement\Hydrator\Seminar; | |
use DrWolff\EventManagement\Entity\Seminar\CoreData; | |
use Zend\Stdlib\Hydrator\HydratorInterface; |
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 Foo | |
{ | |
public function doStuff($i) { | |
if ($i < 10) { | |
return "{$i}"; | |
} else { | |
return $this->protectedStuff($i); | |
} | |
} |
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 Foo; | |
use PHPUnit_Framework_TestCase; | |
use Zend\InputFilter\InputFilter; | |
class FooTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testWtf() | |
{ |
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 | |
$filter = new CollectionInputFilter(); | |
$filter->setInputFilter(new RegistrationFilter()); | |
$filter->setData($data); | |
$filter->isValid(); | |
$filter->getMessages(); |
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 RowValidator | |
{ | |
private $data; | |
private $filter; | |
private $errors; | |
public function __construct($inputFilterInterface, $data) | |
{ | |
$this->filter = $inputFilterInterface; |
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 | |
$complexArray = [ | |
//... lots of stuff | |
'condition' => 'unknown' | |
]; | |
switch ($someThingElse) { | |
case 'foo': | |
default: | |
$complexArray['condition'] = 'foo'; |
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
### Install OpenJDK | |
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Download and Install ElasticSearch | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.deb | |
sudo dpkg -i elasticsearch-1.4.4.deb |
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 FooController { | |
public function __construct(FooService $foo) { | |
$this->foo = $foo; | |
} | |
public function indexAction() { | |
return new ViewModel([ | |
'data' => $foo->listStuff(); | |
]); |
NewerOlder