1 | <?php |
||
18 | class ScheduledContentVoter extends AdminAwareVoterAbstract |
||
19 | { |
||
20 | /** |
||
21 | * Decide based on the current date and time what the vote should be. Static so it's strategy can easily be accessed |
||
22 | * by other components as well, without the actual need for the voter instance. |
||
23 | * |
||
24 | * @param ScheduledContentInterface $object |
||
25 | * @param array $attributes |
||
26 | * @return int |
||
27 | */ |
||
28 | 6 | public static function decide(ScheduledContentInterface $object, array $attributes = []) |
|
70 | |||
71 | /** |
||
72 | * Check if one or more of the given items is not empty |
||
73 | 7 | * |
|
74 | * @param ...$value |
||
75 | 7 | * @return bool |
|
76 | */ |
||
77 | protected static function notEmpty(...$value) |
||
81 | 7 | ||
82 | /** |
||
83 | * Check if the given attributes contain cms roles/attributes |
||
84 | 7 | * |
|
85 | * @param array $attributes |
||
86 | * @return bool |
||
87 | 7 | */ |
|
88 | 6 | protected static function hasCmsAttribute(array $attributes = []) |
|
92 | |||
93 | 6 | /** |
|
94 | 6 | * @{inheritDoc} |
|
95 | 6 | */ |
|
96 | public function supportsAttribute($attribute) |
||
100 | |||
101 | /** |
||
102 | * Checks if the voter supports the given class. |
||
103 | * |
||
104 | * @param string $class A class name |
||
105 | * |
||
106 | * @return Boolean true if this Voter can process the class |
||
107 | */ |
||
108 | public function supportsClass($class) |
||
112 | |||
113 | /** |
||
114 | * @{inheritDoc} |
||
115 | */ |
||
116 | public function vote(TokenInterface $token, $object, array $attributes) |
||
134 | } |
||
135 |
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.