tbreuss /
pvc
| 1 | <?php |
||
| 2 | |||
| 3 | namespace example\components; |
||
| 4 | |||
| 5 | use Tebe\Pvc\Application; |
||
| 6 | use Tebe\Pvc\Event\Event; |
||
| 7 | use Tebe\Pvc\Event\EventHandler; |
||
| 8 | |||
| 9 | class IpCheckEventHandler implements EventHandler |
||
| 10 | { |
||
| 11 | |||
| 12 | protected $blockedIps; |
||
| 13 | |||
| 14 | public function __construct($blockedIps) |
||
| 15 | { |
||
| 16 | $this->blockedIps = $blockedIps; |
||
| 17 | } |
||
| 18 | |||
| 19 | public function handle(Event $event) : void |
||
| 20 | { |
||
| 21 | $request = Application::instance()->getRequest(); |
||
| 22 | $ipAdress = $request->getRemoteAddress(); |
||
|
0 ignored issues
–
show
|
|||
| 23 | |||
| 24 | if (in_array($ipAdress, $this->blockedIps)) { |
||
| 25 | $event->cancel(); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | } |
||
| 29 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.