From 2565cace0fcb7e5bb0e318faa92cc07ae51b4355 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 11 Nov 2023 05:20:11 +0900 Subject: [PATCH] Rename gen code classes --- src/AopCodeGen.php | 8 ++++---- src/{AopCodeGenNewCode.php => GeneratedCode.php} | 2 +- ...deGenMethodSignature.php => MethodSignatureString.php} | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename src/{AopCodeGenNewCode.php => GeneratedCode.php} (98%) rename src/{AopCodeGenMethodSignature.php => MethodSignatureString.php} (98%) diff --git a/src/AopCodeGen.php b/src/AopCodeGen.php index 1a7bd662..b772e1b5 100644 --- a/src/AopCodeGen.php +++ b/src/AopCodeGen.php @@ -27,12 +27,12 @@ final class AopCodeGen { public const INTERCEPT_STATEMENT = '\$this->_intercept(__FUNCTION__, func_get_args());'; - /** @var AopCodeGenMethodSignature */ + /** @var MethodSignatureString */ private $methodSignature; public function __construct() { - $this->methodSignature = new AopCodeGenMethodSignature(PHP_VERSION_ID); + $this->methodSignature = new MethodSignatureString(PHP_VERSION_ID); } /** @@ -56,7 +56,7 @@ public function generate(ReflectionClass $sourceClass, BindInterface $bind, stri $tokens = token_get_all($code); $inClass = false; $className = ''; - $newCode = new AopCodeGenNewCode(); + $newCode = new GeneratedCode(); $iterator = new ArrayIterator($tokens); for ($iterator->rewind(); $iterator->valid(); $iterator->next()) { @@ -99,7 +99,7 @@ public function generate(ReflectionClass $sourceClass, BindInterface $bind, stri } /** @param ReflectionClass $class */ - private function addMethods(AopCodeGenNewCode $newCode, ReflectionClass $class, BindInterface $bind): void + private function addMethods(GeneratedCode $newCode, ReflectionClass $class, BindInterface $bind): void { $bindings = array_keys($bind->getBindings()); diff --git a/src/AopCodeGenNewCode.php b/src/GeneratedCode.php similarity index 98% rename from src/AopCodeGenNewCode.php rename to src/GeneratedCode.php index 82ededbe..68fe97ec 100644 --- a/src/AopCodeGenNewCode.php +++ b/src/GeneratedCode.php @@ -8,7 +8,7 @@ use function preg_replace_callback; use function sprintf; -final class AopCodeGenNewCode +final class GeneratedCode { /** @var string */ private $code = ''; diff --git a/src/AopCodeGenMethodSignature.php b/src/MethodSignatureString.php similarity index 98% rename from src/AopCodeGenMethodSignature.php rename to src/MethodSignatureString.php index 178b44a8..a1509459 100644 --- a/src/AopCodeGenMethodSignature.php +++ b/src/MethodSignatureString.php @@ -19,7 +19,7 @@ use const PHP_MAJOR_VERSION; /** @SuppressWarnings(PHPMD.CyclomaticComplexity) */ -final class AopCodeGenMethodSignature +final class MethodSignatureString { /** @var TypeString */ private $typeString;