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 Entity extends DataContain\Container { | |
/** | |
* @var DataContain\DefinitionContainer | |
*/ | |
protected $attributes; | |
public function __construct(array $data = array(), DataContain\DefinitionContainer $attributes = null) |
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 | |
include __DIR__.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php'; | |
class Entity extends DataContain\Container { | |
/** | |
* @var DataContain\DefinitionContainer | |
*/ | |
protected $attributes; |
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 | |
// See: http://nikic.github.io/2012/03/06/Scalar-type-hinting-is-harder-than-you-think.html | |
// And RFC: https://wiki.php.net/rfc/scalar_type_hinting_with_cast | |
// | |
// Basically the same implementation as outlined in the RFC but with a concept for scalar | |
// magic to be added to objects at some point in the future. | |
class MyObjectWithScalarMagic { |
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 Validator; | |
use RuleSet; | |
use Filters; | |
use Rule; | |
use Constraints; | |
class ValidationBuilder { | |
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
$players = array(); |
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 | |
$velocities = array("turtle", "donkey", "rabbit"); | |
$mode = isset($argv[1]) ? $argv[1] : 'console'; | |
$file = isset($argv[2]) ? $argv[2] : ''; | |
$fp = null; | |
$raceWriters = array( | |
'file' => function($output)use($file, $fp){ | |
if(!$fp) $fp = fopen($file, 'a+'); |
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 | |
$velocities = array("turtle", "donkey", "rabbit"); | |
$players = array( | |
'1' => array( | |
'name' => 'Foo', | |
'velocity' => $velocities[rand(0,2)], | |
'actions' => array(), | |
), | |
'2' => array( |
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 | |
$velocities = array("turtle", "donkey", "rabbit"); | |
$players = array( | |
'1' => array( | |
'name' => 'Foo', | |
'velocity' => $velocities[rand(0,2)], | |
'actions' => array(), | |
), | |
'2' => array( |
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 | |
$velocities = array("turtle", "donkey", "rabbit"); | |
$players = array( | |
'1' => array( | |
'name' => 'Foo', | |
'velocity' => $velocities[rand(0,2)]), | |
'actions' => array(), | |
'2' => array( | |
'name' => 'Bar', |
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 | |
$velocities = array("turtle", "donkey", "rabbit"); | |
$players = array( | |
'1' => array( | |
'name' => 'Foo', | |
'velocity' => $velocities[rand(0,2)]), | |
'2' => array( | |
'name' => 'Bar', | |
'velocity' => $velocities[rand(0,2)]), |