From b75b394630d10c2e91fe8d2031bc72664f94b1e6 Mon Sep 17 00:00:00 2001 From: Miro Svrtan Date: Thu, 27 Jul 2017 20:37:52 +0200 Subject: [PATCH 1/2] Remove ConceptName::create() --- src/NullDev/Skeleton/Definition/PHP/Types/ConceptName.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/NullDev/Skeleton/Definition/PHP/Types/ConceptName.php b/src/NullDev/Skeleton/Definition/PHP/Types/ConceptName.php index 61fd38fc..cd7b799f 100644 --- a/src/NullDev/Skeleton/Definition/PHP/Types/ConceptName.php +++ b/src/NullDev/Skeleton/Definition/PHP/Types/ConceptName.php @@ -47,14 +47,6 @@ public function getFullName(): string return $this->namespace.self::NAMESPACE_SEPARATOR.$this->name; } - /** - * @deprecated Use createFromFullyQualified() directly - */ - public static function create(string $fullName): self - { - return static::createFromFullyQualified($fullName); - } - public static function createFromFullyQualified(string $fullName): self { $parts = explode(self::NAMESPACE_SEPARATOR, $fullName); From 8eb948c267e8f5b0b7fbcee39a057fcff816245d Mon Sep 17 00:00:00 2001 From: Miro Svrtan Date: Thu, 27 Jul 2017 20:42:01 +0200 Subject: [PATCH 2/2] Stop using ConceptName::create() and use ConceptName::createFromFullyQualified() --- .../Skeleton/Definition/PHP/Methods/ConstructorMethodTest.php | 2 +- tests/NullDev/Skeleton/Definition/PHP/ParameterTest.php | 2 +- tests/NullDev/Skeleton/Definition/PHP/Types/ClassTypeTest.php | 4 ++-- .../Skeleton/Definition/PHP/Types/InterfaceTypeTest.php | 4 ++-- tests/NullDev/Skeleton/Definition/PHP/Types/TraitTypeTest.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/NullDev/Skeleton/Definition/PHP/Methods/ConstructorMethodTest.php b/tests/NullDev/Skeleton/Definition/PHP/Methods/ConstructorMethodTest.php index bd08a0eb..f85aa156 100644 --- a/tests/NullDev/Skeleton/Definition/PHP/Methods/ConstructorMethodTest.php +++ b/tests/NullDev/Skeleton/Definition/PHP/Methods/ConstructorMethodTest.php @@ -40,7 +40,7 @@ public function testItCanReturnOnlyTypesUsedInConstructor(): void { $param1 = new Parameter('noType'); - $type2 = ClassType::create('Namespace1\Namespace2\MyClass'); + $type2 = ClassType::createFromFullyQualified('Namespace1\Namespace2\MyClass'); $param2 = new Parameter('name', $type2); $method = new ConstructorMethod([$param1, $param2]); diff --git a/tests/NullDev/Skeleton/Definition/PHP/ParameterTest.php b/tests/NullDev/Skeleton/Definition/PHP/ParameterTest.php index c9d489fb..9655c711 100644 --- a/tests/NullDev/Skeleton/Definition/PHP/ParameterTest.php +++ b/tests/NullDev/Skeleton/Definition/PHP/ParameterTest.php @@ -16,7 +16,7 @@ class ParameterTest extends PHPUnit_Framework_TestCase { public function testItWorksWithType(): void { - $type = ClassType::create('Vendor\Namespace\MyClass'); + $type = ClassType::createFromFullyQualified('Vendor\Namespace\MyClass'); $parameter = new Parameter('name', $type); diff --git a/tests/NullDev/Skeleton/Definition/PHP/Types/ClassTypeTest.php b/tests/NullDev/Skeleton/Definition/PHP/Types/ClassTypeTest.php index 8a50a0f1..5e7b4af7 100644 --- a/tests/NullDev/Skeleton/Definition/PHP/Types/ClassTypeTest.php +++ b/tests/NullDev/Skeleton/Definition/PHP/Types/ClassTypeTest.php @@ -36,7 +36,7 @@ public function testNonNamespacedInterface(): void public function testNamespacedInterfaceCanBeCreatedFromFullyQualifiedClassName(): void { - $interfaceType = ClassType::create('Namespace1\Namespace2\MyClass'); + $interfaceType = ClassType::createFromFullyQualified('Namespace1\Namespace2\MyClass'); self::assertEquals('MyClass', $interfaceType->getName()); self::assertEquals('Namespace1\Namespace2\MyClass', $interfaceType->getFullName()); @@ -46,7 +46,7 @@ public function testNamespacedInterfaceCanBeCreatedFromFullyQualifiedClassName() public function testNonNamespacedInterfaceCanBeCreatedFromFullyQualifiedClassName(): void { - $interfaceType = ClassType::create('MyClass'); + $interfaceType = ClassType::createFromFullyQualified('MyClass'); self::assertEquals('MyClass', $interfaceType->getName()); self::assertEquals('MyClass', $interfaceType->getFullName()); diff --git a/tests/NullDev/Skeleton/Definition/PHP/Types/InterfaceTypeTest.php b/tests/NullDev/Skeleton/Definition/PHP/Types/InterfaceTypeTest.php index c81d1d0c..20b9260a 100644 --- a/tests/NullDev/Skeleton/Definition/PHP/Types/InterfaceTypeTest.php +++ b/tests/NullDev/Skeleton/Definition/PHP/Types/InterfaceTypeTest.php @@ -36,7 +36,7 @@ public function testNonNamespacedInterface(): void public function testNamespacedInterfaceCanBeCreatedFromFullyQualifiedClassName(): void { - $interfaceType = InterfaceType::create('Namespace1\Namespace2\MyInterface'); + $interfaceType = InterfaceType::createFromFullyQualified('Namespace1\Namespace2\MyInterface'); self::assertEquals('MyInterface', $interfaceType->getName()); self::assertEquals('Namespace1\Namespace2\MyInterface', $interfaceType->getFullName()); @@ -46,7 +46,7 @@ public function testNamespacedInterfaceCanBeCreatedFromFullyQualifiedClassName() public function testNonNamespacedInterfaceCanBeCreatedFromFullyQualifiedClassName(): void { - $interfaceType = InterfaceType::create('MyInterface'); + $interfaceType = InterfaceType::createFromFullyQualified('MyInterface'); self::assertEquals('MyInterface', $interfaceType->getName()); self::assertEquals('MyInterface', $interfaceType->getFullName()); diff --git a/tests/NullDev/Skeleton/Definition/PHP/Types/TraitTypeTest.php b/tests/NullDev/Skeleton/Definition/PHP/Types/TraitTypeTest.php index 2e2a282d..cc57cc67 100644 --- a/tests/NullDev/Skeleton/Definition/PHP/Types/TraitTypeTest.php +++ b/tests/NullDev/Skeleton/Definition/PHP/Types/TraitTypeTest.php @@ -36,7 +36,7 @@ public function testNonNamespacedTrait(): void public function testNamespacedTraitCanBeCreatedFromFullyQualifiedClassName(): void { - $traitType = TraitType::create('Namespace1\Namespace2\MyTrait'); + $traitType = TraitType::createFromFullyQualified('Namespace1\Namespace2\MyTrait'); self::assertEquals('MyTrait', $traitType->getName()); self::assertEquals('Namespace1\Namespace2\MyTrait', $traitType->getFullName()); @@ -46,7 +46,7 @@ public function testNamespacedTraitCanBeCreatedFromFullyQualifiedClassName(): vo public function testNonNamespacedTraitCanBeCreatedFromFullyQualifiedClassName(): void { - $traitType = TraitType::create('MyTrait'); + $traitType = TraitType::createFromFullyQualified('MyTrait'); self::assertEquals('MyTrait', $traitType->getName()); self::assertEquals('MyTrait', $traitType->getFullName());