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 | |
public function pdf_creation($content) | |
{ | |
if (false !== file_put_contents($this->full_file_name, $content)) { | |
return true; | |
} | |
while (substr($this->filename, 0, 1) === '.') { | |
$this->filename .= substr($this->filename, 1, (strlen($this->filename) - 1)); |
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 | |
// 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 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 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 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 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 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 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 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)]), |
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 | |
$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)]), |
NewerOlder