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 | |
$container = new SomePSR11Container(); | |
// $container->regiseter(); | |
$notifications = new N1215\Notification\Registrar($container); | |
$notifications | |
->source(N1215\Events\UserRegistered::class) | |
->to(N1215\Notification\UserTargetSelector::class) | |
->inSingleFormOf( |
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 FlowFactory as Flow; | |
use SourceFactory as Source; | |
use SinkFactory as Sink; | |
$builder = new GraphBuilder(); | |
/** @var GraphInterface $seedGraph */ | |
$seedGraph = $builder |
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 | |
declare(strict_types=1); | |
namespace App\View; | |
use Illuminate\View\Compilers\BladeCompiler; | |
use Illuminate\View\Factory; | |
use Symfony\Component\Debug\Exception\FatalThrowableError; | |
/** |
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
#!/usr/bin/env php | |
<?php | |
declare(strict_types=1); | |
namespace MyPlayGround; | |
use App\User; | |
use Illuminate\Support\Facades\Hash; | |
/** |
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 | |
declare(strict_types=1); | |
function float2bin(float $float) { | |
return join('', array_map(function($char) { | |
return str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT); | |
}, str_split(strrev(pack('d', $float))))); | |
} | |
var_dump(float2bin((float)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 | |
$query = RelationShipQuery::new( | |
'select * from `posts` where id = :id', | |
function (array $record) { | |
return new Post($record['id'], $record['title'], $record['body'], $record['author'], $record['comments']); | |
}, | |
[ | |
'author' => PostBelongsToAuthor::hydratedBy( | |
function (array $record) { |
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 ContainerBuilder implements ContainerBuilderInterface { | |
private $providers; | |
public function __construct(array $providers) { | |
$this->prividers = $providers; | |
} |
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 | |
interface RouterInterface { | |
public function match(): RoutingResultInterface; | |
} | |
interface RoutingResultInterface { | |
public function getHandler(): ?RouteInterface; | |
public function getParams(): array; | |
public function isSuccess(): bool; |
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 | |
interface RequestMatcherInterface | |
{ | |
match(RequestInterface $request) : RequestMatchResultInterface | |
} | |
interface RequestMatchResultInterface | |
{ | |
public function getRequest(): ServerRequestInterface; | |
public function getMatcher(): RequestMatcherInterface; |
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 Concrete5ValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |