Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/Routing.php → src/Attributes/AfterMiddleware.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -9,10 +11,11 @@
* @license https://mozilla.org/MPL/2.0/ MPL-2.0
*/

namespace Rudra\Router;

#[\Attribute]
class Routing
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class AfterMiddleware
{

public function __construct(
public string $name,
public string|null $params = null
) {}
}
23 changes: 23 additions & 0 deletions src/Attributes/Middleware.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* @author Korotkov Danila (Jagepard) <jagepard@yandex.ru>
* @license https://mozilla.org/MPL/2.0/ MPL-2.0
*/

namespace Rudra\Router\Attributes;

#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Middleware
{
public function __construct(
public string $name,
public string|null $params = null
) {}
}
21 changes: 21 additions & 0 deletions src/Attributes/Routing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* @author Korotkov Danila (Jagepard) <jagepard@yandex.ru>
* @license https://mozilla.org/MPL/2.0/ MPL-2.0
*/

namespace Rudra\Router\Attributes;

#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Routing
{
public function __construct(
public string $url = '',
public string|array $method = 'GET'
) {}
}
Loading