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 number | |
{ | |
private $value = 0; | |
public function addNumber(number $number) | |
{ | |
return $number->add($this->value); | |
} |
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 grummfy; | |
interface worker | |
{ | |
function execute(); | |
} | |
interface job |
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 jobs\script\configuration\cli; | |
use | |
jobs\world | |
; | |
class parser | |
{ |
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 | |
require __DIR__ . '/vendor/autoload.php'; | |
use estvoyage\statsd; | |
$connection = new statsd\connection\internet(new statsd\address); | |
(new statsd\packet) | |
->adds([ new statsd\metric\timing('speed1', 1), new statsd\metric\gauge('gauge1', 5), new statsd\metric\timing('speed2', 3) ]) |
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
function add(statsd\metric $metric, callable $callback) | |
{ | |
$packet = clone $this; | |
$callback($packet->addMetric($metric)); | |
return $this; | |
} | |
function adds(array $metrics, callable $callback) |
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
private static function isVariadic(\reflectionParameter $parameter) | |
{ | |
return (method_exists($parameter, 'isVariadic') && $parameter->isVariadic()); | |
} |
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
protected function getParametersSignature(\reflectionMethod $method, $forceMockController = false) | |
{ | |
$parameters = array(); | |
$mustBeNull = $this->isOrphanized($method->getName()); | |
foreach ($method->getParameters() as $parameter) | |
{ | |
$parameterCode = self::getParameterType($parameter) . ($parameter->isPassedByReference() == false ? (self::isVariadic($parameter) === false ? '' : '...' ) : '& ') . '$' . $parameter->getName(); |
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 east; | |
class amount | |
{ | |
private | |
$value | |
; |
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 | |
final class celsius | |
{ | |
private | |
$value | |
; | |
function __construct($value) | |
{ |
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 implements arrayAccess | |
{ | |
public $values; | |
function offsetSet($key, $value) | |
{ | |
var_dump($key); |