| 1 | <?php |
||
| 17 | class OrientationStorage extends Component |
||
| 18 | { |
||
| 19 | const ORIENTATION_HORIZONTAL = 'horizontal'; |
||
| 20 | const ORIENTATION_VERTICAL = 'vertical'; |
||
| 21 | |||
| 22 | public $sessionKey = 'orientationStorage'; |
||
| 23 | |||
| 24 | public $defaultOrientation = self::ORIENTATION_HORIZONTAL; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | protected $storage = []; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string session component name |
||
| 33 | */ |
||
| 34 | public $session = 'session'; |
||
| 35 | |||
| 36 | protected function getSession() |
||
| 40 | |||
| 41 | protected function getStorage() |
||
| 49 | |||
| 50 | protected function saveStorage() |
||
| 55 | |||
| 56 | public function set($route, $orientation) |
||
| 61 | |||
| 62 | public function get($route) |
||
| 67 | } |
||
| 68 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: