| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 17 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 43 | View Code Duplication | public function test_collection_gets_deep_nested_path_value() |
|
| 44 | { |
||
| 45 | $collection = [ |
||
| 46 | 'foo' => [ |
||
| 47 | 'bar' => [ |
||
| 48 | 'acme' => [ |
||
| 49 | 'name' => 'Acme Corp', |
||
| 50 | ] |
||
| 51 | ] |
||
| 52 | ], |
||
| 53 | ]; |
||
| 54 | $dotter = new ArrayDotCollection; |
||
| 55 | $expected = 'Acme Corp'; |
||
| 56 | $actual = $dotter->get($collection, 'foo.bar.acme.name'); |
||
| 57 | |||
| 58 | $this->assertEquals($expected, $actual); |
||
| 59 | } |
||
| 60 | |||
| 77 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.