Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ConceptName::create() #58

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/NullDev/Skeleton/Definition/PHP/Types/ConceptName.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion tests/NullDev/Skeleton/Definition/PHP/ParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions tests/NullDev/Skeleton/Definition/PHP/Types/ClassTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions tests/NullDev/Skeleton/Definition/PHP/Types/TraitTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down