Use class_exists instead of require to play nice with inlining

This commit is contained in:
Nicolas Grekas
2017-06-05 20:12:18 +02:00
parent 8bc1c950cd
commit dfe0dc2b58
11 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -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.
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
require_once __DIR__.'/Source.php';
class_exists('Twig_Source');
/**
* Twig base exception.
+1 -1
View File
@@ -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
{
+1 -1
View File
@@ -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
{
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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.
+2 -2
View File
@@ -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.
+2 -2
View File
@@ -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.
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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.