not multiple classes are defined in the same file.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Silk\Support; |
||
4 | |||
5 | /** |
||
6 | * The Tightenco namespaced Collection class has only been available since 5.5.33 |
||
7 | * with aliases for the previous Illuminate\Support class for backwards compat. |
||
8 | * |
||
9 | * For PHP 5.6, v5.4 of the library will be installed, thus the namespaced version |
||
10 | * won't be available. |
||
11 | */ |
||
12 | |||
13 | // @codeCoverageIgnoreStart |
||
14 | if (class_exists('Tightenco\Collect\Support\Collection')) { |
||
15 | class Collection extends \Tightenco\Collect\Support\Collection |
||
16 | { |
||
17 | } |
||
18 | } else { |
||
19 | class Collection extends \Illuminate\Support\Collection |
||
1 ignored issue
–
show
|
|||
20 | { |
||
21 | } |
||
22 | } |
||
23 | // @codeCoverageIgnoreEnd |
||
24 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.