Skip to content

Commit

Permalink
Task/improve middleware tostring (#32)
Browse files Browse the repository at this point in the history
* Improve middleware controller tostring

* Rename to labrador-kennel/http, upgrade AC

* Upgrade async-event, annotated-container
  • Loading branch information
cspray authored Sep 4, 2022
1 parent fb20c85 commit b08ef20
Show file tree
Hide file tree
Showing 112 changed files with 642 additions and 743 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ architecture.** It should be assumed that most items below will represent a brea

- Initial launch
- Add Engine implementation for handling an HTTP request.
- Interface to handle request matching `Cspray\Labrador\Http\Router\Router` with a
- Interface to handle request matching `Labrador\Http\Router\Router` with a
default implementation proxying all functionality to FastRoute.
- Interface to convert a handler into a callable, `Cspray\Labrador\Http\HandlerResolver\HandlerResolver`.
- Interface to convert a handler into a callable, `Labrador\Http\HandlerResolver\HandlerResolver`.
Includes the following implementations:
- CallableResolver that will match a handler that is a callable.
- ControllerActionResolver will attempt to match a handler that has a `#` delimiter by creating an
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ It's best to show a Controller implementing this functionality.
```php
<?php declare(strict_types=1);

namespace Cspray\Labrador\HttpDemo;
namespace Labrador\HttpDemo;

use Amp\Http\Server\Response;
use Cspray\Labrador\Http\Controller\Dto\Dto;
use Cspray\Labrador\Http\Controller\Dto\DtoController;
use Cspray\Labrador\Http\Controller\Dto\Get;
use Cspray\Labrador\Http\Controller\Dto\Post;
use Cspray\Labrador\Http\Controller\Dto\RouteParam;
use Labrador\Http\Controller\Dto\Dto;
use Labrador\Http\Controller\Dto\ControllerActions;
use Labrador\Http\Controller\Dto\Get;
use Labrador\Http\Controller\Dto\Post;
use Labrador\Http\Controller\Dto\RouteParam;
use League\Uri\Components\Query;
use Psr\Log\LoggerInterface;
use Ramsey\Uuid\UuidInterface;

#[DtoController]
#[ControllerActions]
final class WidgetController {

// The $logger will be a Monolog logger that sends output to stdout using amphp/log
Expand Down Expand Up @@ -87,23 +87,23 @@ Labrador HTTP also provides the ability to get specific parts of the Request usi
```php
<?php declare(strict_types=1);

namespace Cspray\Labrador\HttpDemo;
namespace Labrador\HttpDemo;

use Amp\Http\Server\RequestBody;use Amp\Http\Server\Response;
use Cspray\Labrador\Http\Controller\Dto\Body;use Cspray\Labrador\Http\Controller\Dto\DtoController;
use Cspray\Labrador\Http\Controller\Dto\Get;
use Cspray\Labrador\Http\Controller\Dto\Header;
use Cspray\Labrador\Http\Controller\Dto\Headers;
use Cspray\Labrador\Http\Controller\Dto\Method;
use Cspray\Labrador\Http\Controller\Dto\Post;
use Cspray\Labrador\Http\Controller\Dto\QueryParams;
use Cspray\Labrador\Http\Controller\Dto\RouteParam;
use Cspray\Labrador\Http\Controller\Dto\Url;
use Labrador\Http\Controller\Dto\Body;use Labrador\Http\Controller\Dto\ControllerActions;
use Labrador\Http\Controller\Dto\Get;
use Labrador\Http\Controller\Dto\Header;
use Labrador\Http\Controller\Dto\Headers;
use Labrador\Http\Controller\Dto\Method;
use Labrador\Http\Controller\Dto\Post;
use Labrador\Http\Controller\Dto\QueryParams;
use Labrador\Http\Controller\Dto\RouteParam;
use Labrador\Http\Controller\Dto\Url;
use League\Uri\Components\Query;
use League\Uri\Contracts\QueryInterface;
use Psr\Http\Message\UriInterface;

#[DtoController]
#[ControllerActions]
class RequestInjectionController {

#[Get('/headers')]
Expand Down
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cspray/labrador-http",
"description": "A HTTP microframework written on top of Amp and Labrador",
"name": "labrador-kennel/http",
"description": "A web framework for building applications with Amp and Annotated Container.",
"scripts": {
"code-lint": "vendor/bin/labrador-cs src/ test/",
"test": "vendor/bin/phpunit",
Expand All @@ -11,34 +11,34 @@
"php": "^8.1",
"ext-json": "*",
"amphp/http-server": "v3.0.0-beta.3",
"cspray/annotated-container": "v2.x-dev",
"cspray/labrador-async-event": "dev-main",
"nikic/fast-route": "~1.3",
"rdlowrey/auryn": "^1.4",
"league/uri": "^6.7",
"ramsey/uuid": "^4.4",
"amphp/log": "v2.0.0-beta.1",
"monolog/monolog": "^2",
"cspray/annotated-container": "v2.0.0-beta2",
"labrador-kennel/async-event": "3.0.0-beta3",
"cuyz/valinor": "^0.13.0",
"league/uri": "^6.7",
"league/uri-components": "^2.4",
"cuyz/valinor": "^0.13.0"
"monolog/monolog": "^2",
"nikic/fast-route": "~1.3",
"rdlowrey/auryn": "^1.4",
"ramsey/uuid": "^4.4"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"amphp/http-client": "^v5.0.0-beta.3",
"cspray/labrador-coding-standard": "0.1.0",
"amphp/phpunit-util": "^v3.0.0-beta.3",
"cspray/labrador-coding-standard": "0.1.0",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^9.5",
"psalm/phar": "^5.0@beta"
},
"autoload": {
"psr-4": {
"Cspray\\Labrador\\Http\\": "src"
"Labrador\\Http\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Cspray\\Labrador\\Http\\Test\\": "test",
"Cspray\\Labrador\\HttpDummyApp\\": "dummy_app"
"Labrador\\Http\\Test\\": "test",
"Labrador\\HttpDummyApp\\": "dummy_app"
}
}
}
Loading

0 comments on commit b08ef20

Please sign in to comment.