1 | <?php |
||
51 | class IsObjectOfType implements Check |
||
52 | { |
||
53 | /** |
||
54 | * what type of object are we looking for? |
||
55 | * @var string |
||
56 | */ |
||
57 | private $expectedType; |
||
58 | |||
59 | /** |
||
60 | * create a new check |
||
61 | * |
||
62 | * @param string $expectedType |
||
63 | * the class or interface that we want to check against |
||
64 | */ |
||
65 | public function __construct($expectedType) |
||
69 | |||
70 | /** |
||
71 | * fluent-interface entry point |
||
72 | * |
||
73 | * @param string $expectedType |
||
74 | * the class or interface that we want to check against |
||
75 | * @return IsObjectOfType |
||
76 | */ |
||
77 | public static function using($expectedType) |
||
81 | |||
82 | /** |
||
83 | * do we have something that is a specific type of object? |
||
84 | * |
||
85 | * @param mixed $fieldOrVar |
||
86 | * the item to be checked |
||
87 | * @param string $expectedType |
||
88 | * the class or interface that we want to check against |
||
89 | * @return bool |
||
90 | * TRUE if the item is the requested type |
||
91 | * FALSE otherwise |
||
92 | */ |
||
93 | public static function check($fieldOrVar, $expectedType) |
||
106 | |||
107 | /** |
||
108 | * do we have something that is a specific type of object? |
||
109 | * |
||
110 | * @param mixed $fieldOrVar |
||
111 | * the item to be checked |
||
112 | * @return bool |
||
113 | * TRUE if the item is the requested type |
||
114 | * FALSE otherwise |
||
115 | */ |
||
116 | public function inspect($fieldOrVar) |
||
120 | } |
||
121 |