diff --git a/lib/Twig/BaseNodeVisitor.php b/lib/Twig/BaseNodeVisitor.php index 8c42cfb25..c2f66c3b8 100644 --- a/lib/Twig/BaseNodeVisitor.php +++ b/lib/Twig/BaseNodeVisitor.php @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Environment.php'; -require_once __DIR__.'/Node.php'; +class_exists('Twig_Environment'); +class_exists('Twig_Node'); /** * Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x. diff --git a/lib/Twig/Compiler.php b/lib/Twig/Compiler.php index ca4789ea7..a61ae6ffe 100644 --- a/lib/Twig/Compiler.php +++ b/lib/Twig/Compiler.php @@ -10,7 +10,7 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Node.php'; +class_exists('Twig_Node'); /** * Compiles a node to PHP code. diff --git a/lib/Twig/Error.php b/lib/Twig/Error.php index d59edb9e1..7d0d492ab 100644 --- a/lib/Twig/Error.php +++ b/lib/Twig/Error.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Source.php'; +class_exists('Twig_Source'); /** * Twig base exception. diff --git a/lib/Twig/Extension.php b/lib/Twig/Extension.php index 54fb3866b..1d62bab30 100644 --- a/lib/Twig/Extension.php +++ b/lib/Twig/Extension.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Environment.php'; +class_exists('Twig_Environment'); abstract class Twig_Extension implements Twig_ExtensionInterface { diff --git a/lib/Twig/Extension/Profiler.php b/lib/Twig/Extension/Profiler.php index 4163b2406..723a63e4f 100644 --- a/lib/Twig/Extension/Profiler.php +++ b/lib/Twig/Extension/Profiler.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/../Profiler/Profile.php'; +class_exists('Twig_Profiler_Profile'); class Twig_Extension_Profiler extends Twig_Extension { diff --git a/lib/Twig/ExtensionInterface.php b/lib/Twig/ExtensionInterface.php index 6e091adbc..81b68dbad 100644 --- a/lib/Twig/ExtensionInterface.php +++ b/lib/Twig/ExtensionInterface.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Environment.php'; +class_exists('Twig_Environment'); /** * Interface implemented by extension classes. diff --git a/lib/Twig/Node.php b/lib/Twig/Node.php index aaaa58f76..5ad374748 100644 --- a/lib/Twig/Node.php +++ b/lib/Twig/Node.php @@ -10,7 +10,7 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Compiler.php'; +class_exists('Twig_Compiler'); /** * Represents a node in the AST. diff --git a/lib/Twig/NodeVisitorInterface.php b/lib/Twig/NodeVisitorInterface.php index 1b326403a..36e81efb2 100644 --- a/lib/Twig/NodeVisitorInterface.php +++ b/lib/Twig/NodeVisitorInterface.php @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Environment.php'; -require_once __DIR__.'/Node.php'; +class_exists('Twig_Environment'); +class_exists('Twig_Node'); /** * Twig_NodeVisitorInterface is the interface the all node visitor classes must implement. diff --git a/lib/Twig/Parser.php b/lib/Twig/Parser.php index b01ea0c78..3d491a28c 100644 --- a/lib/Twig/Parser.php +++ b/lib/Twig/Parser.php @@ -10,8 +10,8 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Node.php'; -require_once __DIR__.'/TokenStream.php'; +class_exists('Twig_Node'); +class_exists('Twig_TokenStream'); /** * Default parser implementation. diff --git a/lib/Twig/Test/NodeTestCase.php b/lib/Twig/Test/NodeTestCase.php index 89b2ac842..ff26c92cd 100644 --- a/lib/Twig/Test/NodeTestCase.php +++ b/lib/Twig/Test/NodeTestCase.php @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/../Environment.php'; -require_once __DIR__.'/../Node.php'; +class_exists('Twig_Environment'); +class_exists('Twig_Node'); use PHPUnit\Framework\TestCase; diff --git a/lib/Twig/TokenParserInterface.php b/lib/Twig/TokenParserInterface.php index 5c32fa905..2114a34c6 100644 --- a/lib/Twig/TokenParserInterface.php +++ b/lib/Twig/TokenParserInterface.php @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ -require_once __DIR__.'/Parser.php'; -require_once __DIR__.'/Token.php'; +class_exists('Twig_Parser'); +class_exists('Twig_Token'); /** * Interface implemented by token parsers.