| Conditions | 7 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function exists($className, $field, $value) |
||
| 10 | { |
||
| 11 | if (!isset($this->cache[$className])) { |
||
| 12 | return false; |
||
| 13 | } |
||
| 14 | |||
| 15 | if (!is_array($this->cache[$className]) || !isset($this->cache[$className][$field])) { |
||
| 16 | return false; |
||
| 17 | } |
||
| 18 | |||
| 19 | if (!is_array($this->cache[$className][$field])) { |
||
| 20 | return false; |
||
| 21 | } |
||
| 22 | |||
| 23 | foreach ($this->cache[$className][$field] as $cacheValue) { |
||
| 24 | if ($value === $cacheValue) { |
||
| 25 | return true; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | return false; |
||
| 30 | } |
||
| 31 | |||
| 56 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.