1 | <?php |
||
10 | class Media |
||
11 | { |
||
12 | protected $gallery; |
||
13 | protected $image; |
||
14 | protected $video; |
||
15 | |||
16 | public function __construct( Gallery $gallery, Image $image, Video $video ) |
||
22 | |||
23 | /** |
||
24 | * @param string $name |
||
25 | * |
||
26 | * @return string|void |
||
27 | * @throws BadMethodCallException |
||
28 | */ |
||
29 | public function __call( $name, array $args ) |
||
42 | |||
43 | /** |
||
44 | * @param string $name |
||
45 | * @param mixed $args |
||
46 | * |
||
47 | * @return mixed |
||
48 | */ |
||
49 | public function get( $name, $args = [] ) |
||
55 | |||
56 | /** |
||
57 | * @param string $name |
||
58 | * |
||
59 | * @return string|false |
||
60 | */ |
||
61 | protected function validateMethod( $name ) |
||
72 | } |
||
73 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: