| Conditions | 7 |
| Paths | 5 |
| Total Lines | 26 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function scan(): array |
||
| 41 | { |
||
| 42 | $properties = []; |
||
| 43 | $bindings = $this->container->getBindings(); |
||
| 44 | |||
| 45 | foreach ($bindings as $name => $resolver) { |
||
| 46 | // skip complex things. complex things are bad. |
||
| 47 | if (is_array($resolver)) { |
||
| 48 | continue; |
||
| 49 | } |
||
| 50 | |||
| 51 | // skip if it's not looks like a short binding |
||
| 52 | if (lcfirst($name) !== $name || strpos($name, '\\')) { |
||
| 53 | continue; |
||
| 54 | } |
||
| 55 | |||
| 56 | // skip if target class doesn't exists |
||
| 57 | if (!class_exists($resolver) && !interface_exists($resolver)) { |
||
| 58 | continue; |
||
| 59 | } |
||
| 60 | |||
| 61 | $properties[] = new ClassProperty($name, $resolver); |
||
| 62 | } |
||
| 63 | |||
| 64 | return $properties; |
||
| 65 | } |
||
| 66 | } |
||
| 67 |