1 | <?php |
||
18 | trait TypeHelperTrait |
||
19 | { |
||
20 | /** |
||
21 | * Check if the given value is the expected object type |
||
22 | * |
||
23 | * @param string $expectedType the expected object type (class name) |
||
24 | * @param mixed $value The value that has to be checked |
||
25 | * @param boolean $nullAllowed Is <code>null</code> allowed as value? |
||
26 | * @return boolean returns <code>true</code> if the given value is instance of expected type |
||
27 | * @throws CmisInvalidArgumentException Exception is thrown if the given value does not match to the expected type |
||
28 | */ |
||
29 | 825 | protected function checkType($expectedType, $value, $nullAllowed = false) |
|
56 | |||
57 | /** |
||
58 | * Ensure that a value is an instance of the expected type. If not the value |
||
59 | * is casted to the expected type and a log message is triggered. |
||
60 | * |
||
61 | * @param string $expectedType the expected object type (class name) |
||
62 | * @param mixed $value The value that has to be checked |
||
63 | * @param boolean $nullIsValidValue defines if <code>null</code> is also a valid value |
||
64 | * @return mixed |
||
65 | */ |
||
66 | 613 | protected function castValueToSimpleType($expectedType, $value, $nullIsValidValue = false) |
|
90 | } |
||
91 |