Skip to content

Commit 8d1c210

Browse files
committed
add Command interface supertype, for Middleware typehinting;
1 parent 61d1b7d commit 8d1c210

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This file is part of phpDocumentor.
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*
10+
* @copyright 2010-2018 Mike van Riel<mike@phpdoc.org>
11+
* @license http://www.opensource.org/licenses/mit-license.php MIT
12+
* @link http://phpdoc.org
13+
*/
14+
15+
namespace phpDocumentor\Reflection\Middleware;
16+
17+
/**
18+
* Commands are used by Middleware
19+
*/
20+
interface Command
21+
{
22+
}

src/phpDocumentor/Reflection/Middleware/Middleware.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ interface Middleware
2222
/**
2323
* Executes this middle ware class.
2424
*
25-
* @param object $command
26-
*
2725
* @return object
2826
*/
29-
public function execute($command, callable $next);
27+
public function execute(Command $command, callable $next);
3028
}

src/phpDocumentor/Reflection/Php/Factory/File/CreateCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
namespace phpDocumentor\Reflection\Php\Factory\File;
1616

1717
use phpDocumentor\Reflection\File;
18+
use phpDocumentor\Reflection\Middleware\Command;
1819
use phpDocumentor\Reflection\Php\StrategyContainer;
1920

2021
/**
2122
* File Create command is used by the File Factory Strategy.
2223
* The command is passed to the registered middle ware classes.
2324
*/
24-
final class CreateCommand
25+
final class CreateCommand implements Command
2526
{
2627
/**
2728
* @var File

0 commit comments

Comments
 (0)