1 | <?php |
||
22 | class Storage |
||
23 | { |
||
24 | const PRIORITY_MINIMAL = 1; // Lower priority |
||
25 | const PRIORITY_DEFAULT = 2; |
||
26 | const PRIORITY_MAXIMAL = 3; // Maximal priority (?) |
||
|
|||
27 | |||
28 | |||
29 | // Middleware response for stopping iterations |
||
30 | const SIGNAL_STOP = null; |
||
31 | |||
32 | |||
33 | /** |
||
34 | * @var MiddlewareInterface[]|PriorityList |
||
35 | */ |
||
36 | protected $storage; |
||
37 | |||
38 | |||
39 | /** |
||
40 | * @var Container |
||
41 | */ |
||
42 | protected $container; |
||
43 | |||
44 | |||
45 | /** |
||
46 | * @param Container $container |
||
47 | */ |
||
48 | public function __construct(Container $container) |
||
53 | |||
54 | /** |
||
55 | * @param string $class |
||
56 | * @param int $priority |
||
57 | * |
||
58 | * @return Storage |
||
59 | * @throws \Exception |
||
60 | */ |
||
61 | public function add($class, $priority = self::PRIORITY_DEFAULT): Storage |
||
78 | |||
79 | |||
80 | /** |
||
81 | * @param Model|mixed $data |
||
82 | * @return Storage |
||
83 | */ |
||
84 | public function handle($data): Storage |
||
99 | |||
100 | /** |
||
101 | * @param MiddlewareGroupableInterface $middleware |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | protected function checkMiddlewareGroup(MiddlewareGroupableInterface $middleware) |
||
128 | } |
||
129 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.