1 | <?php |
||
12 | class Button extends Component implements IAction |
||
13 | { |
||
14 | const TAG_A = 'a'; |
||
15 | const TAG_BUTTON = 'button'; |
||
16 | |||
17 | const CLASS_PRIMARY = 'btn btn-primary'; |
||
18 | const CLASS_DANGER = 'btn btn-danger'; |
||
19 | const CLASS_SUCCESS = 'btn btn-success'; |
||
20 | const CLASS_INFO = 'btn btn-info'; |
||
21 | const CLASS_WARNING = 'btn btn-warning'; |
||
22 | const CLASS_LINK = 'btn btn-link'; |
||
23 | |||
24 | /** @var IEntity */ |
||
25 | protected $entity; |
||
26 | |||
27 | /** @var array */ |
||
28 | protected $attributeCallbacks = []; |
||
29 | |||
30 | /** |
||
31 | * @param IComponent|string $content |
||
32 | * @param string $tag |
||
33 | * @param array $attributes |
||
34 | * @param array $attributeCallbacks |
||
35 | * @param ITranslator|null $translator |
||
36 | */ |
||
37 | 11 | public function __construct( |
|
48 | |||
49 | /** |
||
50 | * @return \Closure |
||
51 | */ |
||
52 | public static function getDefaultCallback(): \Closure |
||
58 | |||
59 | /** |
||
60 | * @param IEntity $entity |
||
61 | */ |
||
62 | public function setEntity(IEntity $entity) |
||
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | */ |
||
70 | 6 | public function __toString(): string |
|
78 | |||
79 | /** |
||
80 | * @return IAction |
||
81 | */ |
||
82 | 1 | public function duplicate(): IAction |
|
86 | } |
||
87 | |||
88 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.