1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
12 | class Kohana_Jam_Validator_Rule_Purchase_Promocode extends Jam_Validator_Rule { |
||
13 | |||
14 | 1 | public function validate(Jam_Validated $model, $attribute, $value) |
|
31 | |||
32 | 1 | public function valid_promo_code($code, Model_Purchase $purchase) |
|
39 | } |
||
40 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.