| 1 | <?php |
||
| 9 | abstract class ResourceValue extends AbstractValue |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * ResourceValue constructor. |
||
| 13 | * |
||
| 14 | * @param mixed $value |
||
| 15 | */ |
||
| 16 | 2 | public function __construct($value) |
|
| 17 | { |
||
| 18 | 2 | if (false == \is_resource($value)) { |
|
|
|
|||
| 19 | throw new \TypeError( |
||
| 20 | 'Argument 1 passed to drupol\valuewrapper\Resource\ResourceValue::__construct()' . |
||
| 21 | 'must be of the type Resource, ' . gettype($value) . ' given.' |
||
| 22 | ); |
||
| 23 | } |
||
| 24 | |||
| 25 | 2 | parent::__construct($value); |
|
| 26 | 2 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | public function hash(): string |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | protected function doHash(string $string) : string |
||
| 43 | } |
||
| 44 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.