add data from work folder

This commit is contained in:
lubiana 2022-03-29 20:35:06 +02:00
parent 528ba365b4
commit 7052803761
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
218 changed files with 16123 additions and 1233 deletions

View file

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
$builder = new \DI\ContainerBuilder();
$builder->addDefinitions([
\Psr\Http\Message\ResponseInterface::class => fn () => new \Laminas\Diactoros\Response(),
\Psr\Http\Message\ServerRequestInterface::class => fn () => \Laminas\Diactoros\ServerRequestFactory::fromGlobals(),
\Lubian\NoFramework\Service\Time\Now::class => fn () => new \Lubian\NoFramework\Service\Time\SystemClockNow(),
]);
return $builder->build();

View file

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
use FastRoute\RouteCollector;
use Laminas\Diactoros\Response;
use Lubian\NoFramework\Action\Hello;
use Lubian\NoFramework\Action\Other;
return function (RouteCollector $r): void {
$r->addRoute('GET', '/hello[/{name}]', Hello::class);
$r->addRoute('GET', '/other-route', [Other::class, 'someFunctionName']);
$r->addRoute(
'GET',
'/',
fn (Response $r) => $r->withStatus(302)->withHeader('Location', '/hello')
);
};