1 | <?php namespace Packback\Prices; |
||
6 | abstract class PriceClient |
||
7 | { |
||
8 | const CONDITION_NEW = 'new'; |
||
9 | const CONDITION_GOOD = 'good'; |
||
10 | const CONDITION_ACCEPTABLE = 'acceptable'; |
||
11 | const CONDITION_POOR = 'poor'; |
||
12 | |||
13 | const TERM_PERPETUAL = 'perpetual'; |
||
14 | const TERM_SEMESTER = 'semester'; |
||
15 | const TERM_QUARTER = 'quarter'; |
||
16 | const TERM_HALFQUARTER = 'half-quarter'; |
||
17 | const TERM_TWOMONTH = 'two-month'; |
||
18 | const TERM_ONEMONTH = 'one-month'; |
||
19 | const TERM_DAILY = 'daily'; |
||
20 | |||
21 | public $client; |
||
22 | public $query = []; |
||
23 | public $collection = []; |
||
24 | public $baseUrl = ''; |
||
25 | |||
26 | 40 | public function __construct() |
|
30 | |||
31 | abstract public function getPricesForIsbns($isbns = []); |
||
32 | |||
33 | abstract public function addPricesToCollection($response); |
||
34 | |||
35 | 12 | public function addParam($key, $value) |
|
40 | |||
41 | 6 | public function send() |
|
54 | |||
55 | 6 | public function decodeXml($string) |
|
66 | |||
67 | 48 | public function createNewPrice() |
|
71 | |||
72 | 8 | public function addPriceToCollection($price) |
|
77 | |||
78 | 18 | public function getConditionFromString($string) |
|
106 | |||
107 | 12 | public function getTermFromString($string = null) |
|
129 | } |
||
130 |
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: