Skip to content

Commit

Permalink
v3
Browse files Browse the repository at this point in the history
  • Loading branch information
fenric committed Oct 24, 2024
1 parent 268138f commit 758f534
Show file tree
Hide file tree
Showing 36 changed files with 515 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/Annotation/Consumes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @since 3.0.0
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class Consumes
class Consumes
{
public function __construct(
public readonly string|MediaTypeInterface $value,
Expand Down
28 changes: 28 additions & 0 deletions src/Annotation/Consumes/Image.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Consumes;

use Sunrise\Http\Router\Annotation\Consumes;
use Sunrise\Http\Router\Entity\MediaType\ServerMediaType;

/**
* @since 3.0.0
*/
final class Image extends Consumes
{
public function __construct()
{
parent::__construct(ServerMediaType::image());
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Consumes/Json.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Consumes;

use Sunrise\Http\Router\Annotation\Consumes;
use Sunrise\Http\Router\Entity\MediaType\ServerMediaType;

/**
* @since 3.0.0
*/
final class Json extends Consumes
{
public function __construct()
{
parent::__construct(ServerMediaType::json());
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Consumes/Xml.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Consumes;

use Sunrise\Http\Router\Annotation\Consumes;
use Sunrise\Http\Router\Entity\MediaType\ServerMediaType;

/**
* @since 3.0.0
*/
final class Xml extends Consumes
{
public function __construct()
{
parent::__construct(ServerMediaType::xml());
}
}
2 changes: 1 addition & 1 deletion src/Annotation/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @since 3.0.0
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class Method
class Method
{
public function __construct(
public readonly string $value,
Expand Down
28 changes: 28 additions & 0 deletions src/Annotation/Method/Delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Method;

use Fig\Http\Message\RequestMethodInterface;
use Sunrise\Http\Router\Annotation\Method;

/**
* @since 3.0.0
*/
final class Delete extends Method
{
public function __construct()
{
parent::__construct(RequestMethodInterface::METHOD_DELETE);
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Method/Get.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Method;

use Fig\Http\Message\RequestMethodInterface;
use Sunrise\Http\Router\Annotation\Method;

/**
* @since 3.0.0
*/
final class Get extends Method
{
public function __construct()
{
parent::__construct(RequestMethodInterface::METHOD_GET);
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Method/Head.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Method;

use Fig\Http\Message\RequestMethodInterface;
use Sunrise\Http\Router\Annotation\Method;

/**
* @since 3.0.0
*/
final class Head extends Method
{
public function __construct()
{
parent::__construct(RequestMethodInterface::METHOD_HEAD);
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Method/Options.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Method;

use Fig\Http\Message\RequestMethodInterface;
use Sunrise\Http\Router\Annotation\Method;

/**
* @since 3.0.0
*/
final class Options extends Method
{
public function __construct()
{
parent::__construct(RequestMethodInterface::METHOD_OPTIONS);
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Method/Patch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Method;

use Fig\Http\Message\RequestMethodInterface;
use Sunrise\Http\Router\Annotation\Method;

/**
* @since 3.0.0
*/
final class Patch extends Method
{
public function __construct()
{
parent::__construct(RequestMethodInterface::METHOD_PATCH);
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Method/Post.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Method;

use Fig\Http\Message\RequestMethodInterface;
use Sunrise\Http\Router\Annotation\Method;

/**
* @since 3.0.0
*/
final class Post extends Method
{
public function __construct()
{
parent::__construct(RequestMethodInterface::METHOD_POST);
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Method/Purge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Method;

use Fig\Http\Message\RequestMethodInterface;
use Sunrise\Http\Router\Annotation\Method;

/**
* @since 3.0.0
*/
final class Purge extends Method
{
public function __construct()
{
parent::__construct(RequestMethodInterface::METHOD_PURGE);
}
}
28 changes: 28 additions & 0 deletions src/Annotation/Method/Put.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Method;

use Fig\Http\Message\RequestMethodInterface;
use Sunrise\Http\Router\Annotation\Method;

/**
* @since 3.0.0
*/
final class Put extends Method
{
public function __construct()
{
parent::__construct(RequestMethodInterface::METHOD_PUT);
}
}
2 changes: 1 addition & 1 deletion src/Annotation/Pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @since 3.0.0
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class Pattern
class Pattern
{
public function __construct(
public readonly string $variableName,
Expand Down
28 changes: 28 additions & 0 deletions src/Annotation/Pattern/Uuid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <afenric@gmail.com>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-router
*/

declare(strict_types=1);

namespace Sunrise\Http\Router\Annotation\Pattern;

use Sunrise\Http\Router\Annotation\Pattern;
use Sunrise\Http\Router\Dictionary\VariablePattern;

/**
* @since 3.0.0
*/
final class Uuid extends Pattern
{
public function __construct(string $variableName)
{
parent::__construct($variableName, VariablePattern::UUID);
}
}
2 changes: 1 addition & 1 deletion src/Annotation/Produces.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @since 3.0.0
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class Produces
class Produces
{
public function __construct(
public readonly string|MediaTypeInterface $value,
Expand Down
Loading

0 comments on commit 758f534

Please sign in to comment.