From c341ab2ecfa117b265c452666f11471e152c9416 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 2 Apr 2014 09:44:45 +0200 Subject: [PATCH] Make autoloader for new names PSR-0 compliant --- lib/PhpParser/Autoloader.php | 2 +- lib/PhpParser/Builder/{Class.php => Class_.php} | 0 lib/PhpParser/Builder/{Function.php => Function_.php} | 0 lib/PhpParser/Builder/{Interface.php => Interface_.php} | 0 lib/PhpParser/Node/{Const.php => Const_.php} | 0 lib/PhpParser/Node/Expr/{Array.php => Array_.php} | 0 lib/PhpParser/Node/Expr/Cast/{Array.php => Array_.php} | 0 lib/PhpParser/Node/Expr/Cast/{Unset.php => Unset_.php} | 0 lib/PhpParser/Node/Expr/{Clone.php => Clone_.php} | 0 lib/PhpParser/Node/Expr/{Empty.php => Empty_.php} | 0 lib/PhpParser/Node/Expr/{Eval.php => Eval_.php} | 0 lib/PhpParser/Node/Expr/{Exit.php => Exit_.php} | 0 lib/PhpParser/Node/Expr/{Include.php => Include_.php} | 0 lib/PhpParser/Node/Expr/{Instanceof.php => Instanceof_.php} | 0 lib/PhpParser/Node/Expr/{Isset.php => Isset_.php} | 0 lib/PhpParser/Node/Expr/{List.php => List_.php} | 0 lib/PhpParser/Node/Expr/{New.php => New_.php} | 0 lib/PhpParser/Node/Expr/{Print.php => Print_.php} | 0 lib/PhpParser/Node/Expr/{Yield.php => Yield_.php} | 0 lib/PhpParser/Node/Scalar/MagicConst/{Class.php => Class_.php} | 0 .../Node/Scalar/MagicConst/{Function.php => Function_.php} | 0 .../Node/Scalar/MagicConst/{Namespace.php => Namespace_.php} | 0 lib/PhpParser/Node/Scalar/MagicConst/{Trait.php => Trait_.php} | 0 lib/PhpParser/Node/Stmt/{Break.php => Break_.php} | 0 lib/PhpParser/Node/Stmt/{Case.php => Case_.php} | 0 lib/PhpParser/Node/Stmt/{Catch.php => Catch_.php} | 0 lib/PhpParser/Node/Stmt/{Class.php => Class_.php} | 0 lib/PhpParser/Node/Stmt/{Const.php => Const_.php} | 0 lib/PhpParser/Node/Stmt/{Continue.php => Continue_.php} | 0 lib/PhpParser/Node/Stmt/{Declare.php => Declare_.php} | 0 lib/PhpParser/Node/Stmt/{Do.php => Do_.php} | 0 lib/PhpParser/Node/Stmt/{Echo.php => Echo_.php} | 0 lib/PhpParser/Node/Stmt/{ElseIf.php => ElseIf_.php} | 0 lib/PhpParser/Node/Stmt/{Else.php => Else_.php} | 0 lib/PhpParser/Node/Stmt/{For.php => For_.php} | 0 lib/PhpParser/Node/Stmt/{Foreach.php => Foreach_.php} | 0 lib/PhpParser/Node/Stmt/{Function.php => Function_.php} | 0 lib/PhpParser/Node/Stmt/{Global.php => Global_.php} | 0 lib/PhpParser/Node/Stmt/{Goto.php => Goto_.php} | 0 lib/PhpParser/Node/Stmt/{If.php => If_.php} | 0 lib/PhpParser/Node/Stmt/{Interface.php => Interface_.php} | 0 lib/PhpParser/Node/Stmt/{Namespace.php => Namespace_.php} | 0 lib/PhpParser/Node/Stmt/{Return.php => Return_.php} | 0 lib/PhpParser/Node/Stmt/{Static.php => Static_.php} | 0 lib/PhpParser/Node/Stmt/{Switch.php => Switch_.php} | 0 lib/PhpParser/Node/Stmt/{Throw.php => Throw_.php} | 0 lib/PhpParser/Node/Stmt/{Trait.php => Trait_.php} | 0 lib/PhpParser/Node/Stmt/{Unset.php => Unset_.php} | 0 lib/PhpParser/Node/Stmt/{Use.php => Use_.php} | 0 lib/PhpParser/Node/Stmt/{While.php => While_.php} | 0 50 files changed, 1 insertion(+), 1 deletion(-) rename lib/PhpParser/Builder/{Class.php => Class_.php} (100%) rename lib/PhpParser/Builder/{Function.php => Function_.php} (100%) rename lib/PhpParser/Builder/{Interface.php => Interface_.php} (100%) rename lib/PhpParser/Node/{Const.php => Const_.php} (100%) rename lib/PhpParser/Node/Expr/{Array.php => Array_.php} (100%) rename lib/PhpParser/Node/Expr/Cast/{Array.php => Array_.php} (100%) rename lib/PhpParser/Node/Expr/Cast/{Unset.php => Unset_.php} (100%) rename lib/PhpParser/Node/Expr/{Clone.php => Clone_.php} (100%) rename lib/PhpParser/Node/Expr/{Empty.php => Empty_.php} (100%) rename lib/PhpParser/Node/Expr/{Eval.php => Eval_.php} (100%) rename lib/PhpParser/Node/Expr/{Exit.php => Exit_.php} (100%) rename lib/PhpParser/Node/Expr/{Include.php => Include_.php} (100%) rename lib/PhpParser/Node/Expr/{Instanceof.php => Instanceof_.php} (100%) rename lib/PhpParser/Node/Expr/{Isset.php => Isset_.php} (100%) rename lib/PhpParser/Node/Expr/{List.php => List_.php} (100%) rename lib/PhpParser/Node/Expr/{New.php => New_.php} (100%) rename lib/PhpParser/Node/Expr/{Print.php => Print_.php} (100%) rename lib/PhpParser/Node/Expr/{Yield.php => Yield_.php} (100%) rename lib/PhpParser/Node/Scalar/MagicConst/{Class.php => Class_.php} (100%) rename lib/PhpParser/Node/Scalar/MagicConst/{Function.php => Function_.php} (100%) rename lib/PhpParser/Node/Scalar/MagicConst/{Namespace.php => Namespace_.php} (100%) rename lib/PhpParser/Node/Scalar/MagicConst/{Trait.php => Trait_.php} (100%) rename lib/PhpParser/Node/Stmt/{Break.php => Break_.php} (100%) rename lib/PhpParser/Node/Stmt/{Case.php => Case_.php} (100%) rename lib/PhpParser/Node/Stmt/{Catch.php => Catch_.php} (100%) rename lib/PhpParser/Node/Stmt/{Class.php => Class_.php} (100%) rename lib/PhpParser/Node/Stmt/{Const.php => Const_.php} (100%) rename lib/PhpParser/Node/Stmt/{Continue.php => Continue_.php} (100%) rename lib/PhpParser/Node/Stmt/{Declare.php => Declare_.php} (100%) rename lib/PhpParser/Node/Stmt/{Do.php => Do_.php} (100%) rename lib/PhpParser/Node/Stmt/{Echo.php => Echo_.php} (100%) rename lib/PhpParser/Node/Stmt/{ElseIf.php => ElseIf_.php} (100%) rename lib/PhpParser/Node/Stmt/{Else.php => Else_.php} (100%) rename lib/PhpParser/Node/Stmt/{For.php => For_.php} (100%) rename lib/PhpParser/Node/Stmt/{Foreach.php => Foreach_.php} (100%) rename lib/PhpParser/Node/Stmt/{Function.php => Function_.php} (100%) rename lib/PhpParser/Node/Stmt/{Global.php => Global_.php} (100%) rename lib/PhpParser/Node/Stmt/{Goto.php => Goto_.php} (100%) rename lib/PhpParser/Node/Stmt/{If.php => If_.php} (100%) rename lib/PhpParser/Node/Stmt/{Interface.php => Interface_.php} (100%) rename lib/PhpParser/Node/Stmt/{Namespace.php => Namespace_.php} (100%) rename lib/PhpParser/Node/Stmt/{Return.php => Return_.php} (100%) rename lib/PhpParser/Node/Stmt/{Static.php => Static_.php} (100%) rename lib/PhpParser/Node/Stmt/{Switch.php => Switch_.php} (100%) rename lib/PhpParser/Node/Stmt/{Throw.php => Throw_.php} (100%) rename lib/PhpParser/Node/Stmt/{Trait.php => Trait_.php} (100%) rename lib/PhpParser/Node/Stmt/{Unset.php => Unset_.php} (100%) rename lib/PhpParser/Node/Stmt/{Use.php => Use_.php} (100%) rename lib/PhpParser/Node/Stmt/{While.php => While_.php} (100%) diff --git a/lib/PhpParser/Autoloader.php b/lib/PhpParser/Autoloader.php index 4b28aa11..4498bc53 100644 --- a/lib/PhpParser/Autoloader.php +++ b/lib/PhpParser/Autoloader.php @@ -24,7 +24,7 @@ class Autoloader */ static public function autoload($class) { if (0 === strpos($class, 'PhpParser\\')) { - $fileName = dirname(__DIR__) . '/' . rtrim(strtr($class, '\\', '/'), '_') . '.php'; + $fileName = dirname(__DIR__) . '/' . strtr($class, '\\', '/') . '.php'; if (file_exists($fileName)) { require $fileName; } diff --git a/lib/PhpParser/Builder/Class.php b/lib/PhpParser/Builder/Class_.php similarity index 100% rename from lib/PhpParser/Builder/Class.php rename to lib/PhpParser/Builder/Class_.php diff --git a/lib/PhpParser/Builder/Function.php b/lib/PhpParser/Builder/Function_.php similarity index 100% rename from lib/PhpParser/Builder/Function.php rename to lib/PhpParser/Builder/Function_.php diff --git a/lib/PhpParser/Builder/Interface.php b/lib/PhpParser/Builder/Interface_.php similarity index 100% rename from lib/PhpParser/Builder/Interface.php rename to lib/PhpParser/Builder/Interface_.php diff --git a/lib/PhpParser/Node/Const.php b/lib/PhpParser/Node/Const_.php similarity index 100% rename from lib/PhpParser/Node/Const.php rename to lib/PhpParser/Node/Const_.php diff --git a/lib/PhpParser/Node/Expr/Array.php b/lib/PhpParser/Node/Expr/Array_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Array.php rename to lib/PhpParser/Node/Expr/Array_.php diff --git a/lib/PhpParser/Node/Expr/Cast/Array.php b/lib/PhpParser/Node/Expr/Cast/Array_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Cast/Array.php rename to lib/PhpParser/Node/Expr/Cast/Array_.php diff --git a/lib/PhpParser/Node/Expr/Cast/Unset.php b/lib/PhpParser/Node/Expr/Cast/Unset_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Cast/Unset.php rename to lib/PhpParser/Node/Expr/Cast/Unset_.php diff --git a/lib/PhpParser/Node/Expr/Clone.php b/lib/PhpParser/Node/Expr/Clone_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Clone.php rename to lib/PhpParser/Node/Expr/Clone_.php diff --git a/lib/PhpParser/Node/Expr/Empty.php b/lib/PhpParser/Node/Expr/Empty_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Empty.php rename to lib/PhpParser/Node/Expr/Empty_.php diff --git a/lib/PhpParser/Node/Expr/Eval.php b/lib/PhpParser/Node/Expr/Eval_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Eval.php rename to lib/PhpParser/Node/Expr/Eval_.php diff --git a/lib/PhpParser/Node/Expr/Exit.php b/lib/PhpParser/Node/Expr/Exit_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Exit.php rename to lib/PhpParser/Node/Expr/Exit_.php diff --git a/lib/PhpParser/Node/Expr/Include.php b/lib/PhpParser/Node/Expr/Include_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Include.php rename to lib/PhpParser/Node/Expr/Include_.php diff --git a/lib/PhpParser/Node/Expr/Instanceof.php b/lib/PhpParser/Node/Expr/Instanceof_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Instanceof.php rename to lib/PhpParser/Node/Expr/Instanceof_.php diff --git a/lib/PhpParser/Node/Expr/Isset.php b/lib/PhpParser/Node/Expr/Isset_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Isset.php rename to lib/PhpParser/Node/Expr/Isset_.php diff --git a/lib/PhpParser/Node/Expr/List.php b/lib/PhpParser/Node/Expr/List_.php similarity index 100% rename from lib/PhpParser/Node/Expr/List.php rename to lib/PhpParser/Node/Expr/List_.php diff --git a/lib/PhpParser/Node/Expr/New.php b/lib/PhpParser/Node/Expr/New_.php similarity index 100% rename from lib/PhpParser/Node/Expr/New.php rename to lib/PhpParser/Node/Expr/New_.php diff --git a/lib/PhpParser/Node/Expr/Print.php b/lib/PhpParser/Node/Expr/Print_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Print.php rename to lib/PhpParser/Node/Expr/Print_.php diff --git a/lib/PhpParser/Node/Expr/Yield.php b/lib/PhpParser/Node/Expr/Yield_.php similarity index 100% rename from lib/PhpParser/Node/Expr/Yield.php rename to lib/PhpParser/Node/Expr/Yield_.php diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Class.php b/lib/PhpParser/Node/Scalar/MagicConst/Class_.php similarity index 100% rename from lib/PhpParser/Node/Scalar/MagicConst/Class.php rename to lib/PhpParser/Node/Scalar/MagicConst/Class_.php diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Function.php b/lib/PhpParser/Node/Scalar/MagicConst/Function_.php similarity index 100% rename from lib/PhpParser/Node/Scalar/MagicConst/Function.php rename to lib/PhpParser/Node/Scalar/MagicConst/Function_.php diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Namespace.php b/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php similarity index 100% rename from lib/PhpParser/Node/Scalar/MagicConst/Namespace.php rename to lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Trait.php b/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php similarity index 100% rename from lib/PhpParser/Node/Scalar/MagicConst/Trait.php rename to lib/PhpParser/Node/Scalar/MagicConst/Trait_.php diff --git a/lib/PhpParser/Node/Stmt/Break.php b/lib/PhpParser/Node/Stmt/Break_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Break.php rename to lib/PhpParser/Node/Stmt/Break_.php diff --git a/lib/PhpParser/Node/Stmt/Case.php b/lib/PhpParser/Node/Stmt/Case_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Case.php rename to lib/PhpParser/Node/Stmt/Case_.php diff --git a/lib/PhpParser/Node/Stmt/Catch.php b/lib/PhpParser/Node/Stmt/Catch_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Catch.php rename to lib/PhpParser/Node/Stmt/Catch_.php diff --git a/lib/PhpParser/Node/Stmt/Class.php b/lib/PhpParser/Node/Stmt/Class_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Class.php rename to lib/PhpParser/Node/Stmt/Class_.php diff --git a/lib/PhpParser/Node/Stmt/Const.php b/lib/PhpParser/Node/Stmt/Const_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Const.php rename to lib/PhpParser/Node/Stmt/Const_.php diff --git a/lib/PhpParser/Node/Stmt/Continue.php b/lib/PhpParser/Node/Stmt/Continue_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Continue.php rename to lib/PhpParser/Node/Stmt/Continue_.php diff --git a/lib/PhpParser/Node/Stmt/Declare.php b/lib/PhpParser/Node/Stmt/Declare_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Declare.php rename to lib/PhpParser/Node/Stmt/Declare_.php diff --git a/lib/PhpParser/Node/Stmt/Do.php b/lib/PhpParser/Node/Stmt/Do_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Do.php rename to lib/PhpParser/Node/Stmt/Do_.php diff --git a/lib/PhpParser/Node/Stmt/Echo.php b/lib/PhpParser/Node/Stmt/Echo_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Echo.php rename to lib/PhpParser/Node/Stmt/Echo_.php diff --git a/lib/PhpParser/Node/Stmt/ElseIf.php b/lib/PhpParser/Node/Stmt/ElseIf_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/ElseIf.php rename to lib/PhpParser/Node/Stmt/ElseIf_.php diff --git a/lib/PhpParser/Node/Stmt/Else.php b/lib/PhpParser/Node/Stmt/Else_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Else.php rename to lib/PhpParser/Node/Stmt/Else_.php diff --git a/lib/PhpParser/Node/Stmt/For.php b/lib/PhpParser/Node/Stmt/For_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/For.php rename to lib/PhpParser/Node/Stmt/For_.php diff --git a/lib/PhpParser/Node/Stmt/Foreach.php b/lib/PhpParser/Node/Stmt/Foreach_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Foreach.php rename to lib/PhpParser/Node/Stmt/Foreach_.php diff --git a/lib/PhpParser/Node/Stmt/Function.php b/lib/PhpParser/Node/Stmt/Function_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Function.php rename to lib/PhpParser/Node/Stmt/Function_.php diff --git a/lib/PhpParser/Node/Stmt/Global.php b/lib/PhpParser/Node/Stmt/Global_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Global.php rename to lib/PhpParser/Node/Stmt/Global_.php diff --git a/lib/PhpParser/Node/Stmt/Goto.php b/lib/PhpParser/Node/Stmt/Goto_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Goto.php rename to lib/PhpParser/Node/Stmt/Goto_.php diff --git a/lib/PhpParser/Node/Stmt/If.php b/lib/PhpParser/Node/Stmt/If_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/If.php rename to lib/PhpParser/Node/Stmt/If_.php diff --git a/lib/PhpParser/Node/Stmt/Interface.php b/lib/PhpParser/Node/Stmt/Interface_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Interface.php rename to lib/PhpParser/Node/Stmt/Interface_.php diff --git a/lib/PhpParser/Node/Stmt/Namespace.php b/lib/PhpParser/Node/Stmt/Namespace_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Namespace.php rename to lib/PhpParser/Node/Stmt/Namespace_.php diff --git a/lib/PhpParser/Node/Stmt/Return.php b/lib/PhpParser/Node/Stmt/Return_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Return.php rename to lib/PhpParser/Node/Stmt/Return_.php diff --git a/lib/PhpParser/Node/Stmt/Static.php b/lib/PhpParser/Node/Stmt/Static_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Static.php rename to lib/PhpParser/Node/Stmt/Static_.php diff --git a/lib/PhpParser/Node/Stmt/Switch.php b/lib/PhpParser/Node/Stmt/Switch_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Switch.php rename to lib/PhpParser/Node/Stmt/Switch_.php diff --git a/lib/PhpParser/Node/Stmt/Throw.php b/lib/PhpParser/Node/Stmt/Throw_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Throw.php rename to lib/PhpParser/Node/Stmt/Throw_.php diff --git a/lib/PhpParser/Node/Stmt/Trait.php b/lib/PhpParser/Node/Stmt/Trait_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Trait.php rename to lib/PhpParser/Node/Stmt/Trait_.php diff --git a/lib/PhpParser/Node/Stmt/Unset.php b/lib/PhpParser/Node/Stmt/Unset_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Unset.php rename to lib/PhpParser/Node/Stmt/Unset_.php diff --git a/lib/PhpParser/Node/Stmt/Use.php b/lib/PhpParser/Node/Stmt/Use_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/Use.php rename to lib/PhpParser/Node/Stmt/Use_.php diff --git a/lib/PhpParser/Node/Stmt/While.php b/lib/PhpParser/Node/Stmt/While_.php similarity index 100% rename from lib/PhpParser/Node/Stmt/While.php rename to lib/PhpParser/Node/Stmt/While_.php