Version 5.1 - All the GraphQL #32
22
src/Ion/Attribute/Controller.php
Normal file
22
src/Ion/Attribute/Controller.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* Hummingbird Anime List Client
|
||||
*
|
||||
* An API client for Kitsu to manage anime and manga watch lists
|
||||
*
|
||||
* PHP version 8
|
||||
*
|
||||
* @copyright 2015 - 2022 Timothy J. Warren <tim@timshome.page>
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
* @version 5.2
|
||||
* @link https://git.timshome.page/timw4mail/HummingBirdAnimeClient
|
||||
*/
|
||||
|
||||
namespace Aviat\Ion\Attribute;
|
||||
|
||||
use Attribute;
|
||||
|
||||
#[Attribute(Attribute::TARGET_CLASS)]
|
||||
class Controller {
|
||||
public function __construct(public string $prefix = '') {}
|
||||
}
|
20
src/Ion/Attribute/DefaultController.php
Normal file
20
src/Ion/Attribute/DefaultController.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* Hummingbird Anime List Client
|
||||
*
|
||||
* An API client for Kitsu to manage anime and manga watch lists
|
||||
*
|
||||
* PHP version 8
|
||||
*
|
||||
* @copyright 2015 - 2022 Timothy J. Warren <tim@timshome.page>
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
* @version 5.2
|
||||
* @link https://git.timshome.page/timw4mail/HummingBirdAnimeClient
|
||||
*/
|
||||
|
||||
namespace Aviat\Ion\Attribute;
|
||||
|
||||
use Attribute;
|
||||
|
||||
#[Attribute(Attribute::TARGET_CLASS)]
|
||||
class DefaultController {}
|
32
src/Ion/Attribute/Route.php
Normal file
32
src/Ion/Attribute/Route.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* Hummingbird Anime List Client
|
||||
*
|
||||
* An API client for Kitsu to manage anime and manga watch lists
|
||||
*
|
||||
* PHP version 8
|
||||
*
|
||||
* @copyright 2015 - 2022 Timothy J. Warren <tim@timshome.page>
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
* @version 5.2
|
||||
* @link https://git.timshome.page/timw4mail/HummingBirdAnimeClient
|
||||
*/
|
||||
|
||||
namespace Aviat\Ion\Attribute;
|
||||
|
||||
use Attribute;
|
||||
|
||||
#[Attribute(Attribute::TARGET_FUNCTION | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
|
||||
class Route {
|
||||
public const GET = 'get';
|
||||
public const POST = 'post';
|
||||
|
||||
public function __construct(
|
||||
public string $name,
|
||||
public string $path,
|
||||
public string $verb = self::GET,
|
||||
)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -37,10 +37,11 @@ class Container implements ContainerInterface
|
||||
*
|
||||
* @param (callable)[] $container (optional)
|
||||
*/
|
||||
public function __construct(/**
|
||||
* Array of container Generator functions
|
||||
*/
|
||||
protected array $container = []
|
||||
public function __construct(
|
||||
/**
|
||||
* Array of container Generator functions
|
||||
*/
|
||||
protected array $container = []
|
||||
) {
|
||||
$this->loggers = [];
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace Aviat\Ion;
|
||||
*/
|
||||
class Event
|
||||
{
|
||||
private static array $eventMap = [];
|
||||
protected static array $eventMap = [];
|
||||
|
||||
/**
|
||||
* Subscribe to an event
|
||||
|
@ -15,12 +15,11 @@
|
||||
namespace Aviat\Ion\Type;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Stringy\Stringy;
|
||||
|
||||
/**
|
||||
* Wrapper around Stringy
|
||||
* Slightly extended Stringy library
|
||||
*/
|
||||
class StringType extends Stringy
|
||||
final class StringType extends Stringy
|
||||
{
|
||||
/**
|
||||
* Alias for `create` static constructor
|
||||
|
2083
src/Ion/Type/Stringy.php
Normal file
2083
src/Ion/Type/Stringy.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -81,6 +81,14 @@ class HttpView implements HttpViewInterface, Stringable
|
||||
return $this->getOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Alternate static constructor
|
||||
*/
|
||||
public static function new(): static
|
||||
{
|
||||
return new static();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an http header
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user