1 | <?php |
||
9 | abstract class BaseTwitalLoader extends TwitalLoaderTwigLt3 implements \Twig_LoaderInterface, \Twig_ExistsLoaderInterface, \Twig_SourceContextLoaderInterface |
||
10 | { |
||
11 | /** |
||
12 | * {@inheritdoc} |
||
13 | */ |
||
14 | public function getSource($name) |
||
18 | } |
||
19 | } elseif (interface_exists(ExistsLoaderInterface::class)) { // Twig 2 |
||
38 |
This check looks for classes that have been defined more than once in the same file.
If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.
This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.