Skip to content

Commit

Permalink
Update README and fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
nguereza-tony committed Dec 2, 2023
1 parent 3c0663e commit 520b208
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 38 deletions.
5 changes: 2 additions & 3 deletions src/ConstructorResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

class ConstructorResolver implements ResolverInterface
{

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -110,10 +109,10 @@ protected function resolveParameter(
ReflectionParameter $parameter,
?ParameterCollection $parameters = null
) {
$class = $parameter->getType() && !$parameter->getType()->isBuiltin()
$class = $parameter->getType() && !$parameter->getType()->isBuiltin()
? new ReflectionClass($parameter->getType()->getName())
: null;

//If the parameter is not a class
if ($class === null) {
if ($parameters !== null) {
Expand Down
1 change: 0 additions & 1 deletion src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

class Container implements ContainerInterface
{

/**
* The container global instance
* @var Container|null
Expand Down
1 change: 0 additions & 1 deletion src/ContainerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

interface ContainerInterface
{

/**
* Finds an entry of the container by its identifier and returns it.
*
Expand Down
1 change: 0 additions & 1 deletion src/Exception/ContainerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@

class ContainerException extends Exception
{

}
1 change: 0 additions & 1 deletion src/Exception/NotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@

class NotFoundException extends ContainerException
{

}
1 change: 0 additions & 1 deletion src/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

class Parameter implements ParameterInterface
{

/**
* The parameter name
* @var string
Expand Down
1 change: 0 additions & 1 deletion src/ParameterCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

class ParameterCollection
{

/**
* The array of parameters
* @var array<string, ParameterInterface>
Expand Down
1 change: 0 additions & 1 deletion src/ParameterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

interface ParameterInterface
{

/**
* Return the name of the parameter
*
Expand Down
1 change: 0 additions & 1 deletion src/ResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

interface ResolverInterface
{

/**
* Resolve the instance of the given type
*
Expand Down
1 change: 0 additions & 1 deletion src/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

class Storage implements StorageInterface
{

/**
* The storage name
* @var string
Expand Down
1 change: 0 additions & 1 deletion src/StorageCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

class StorageCollection
{

/**
* The array of storages
* @var array<string, StorageInterface>
Expand Down
1 change: 0 additions & 1 deletion src/StorageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

interface StorageInterface
{

/**
* Return the name of the storage
*
Expand Down
1 change: 0 additions & 1 deletion tests/ConstructorResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
class ConstructorResolverTest extends PlatineTestCase
{

public function testResolveClassNotFound(): void
{
$this->expectException(ContainerException::class);
Expand Down
1 change: 0 additions & 1 deletion tests/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
*/
class ContainerTest extends PlatineTestCase
{

public function testConstructionDefault(): void
{
$c = new Container();
Expand Down
1 change: 0 additions & 1 deletion tests/ParameterCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
class ParameterCollectionTest extends PlatineTestCase
{

public function testConstructorOneValueIsNotInstanceOfParameter(): void
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
1 change: 0 additions & 1 deletion tests/ParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class ParameterTest extends PlatineTestCase
{

public function testSimpleParameter(): void
{
$name = 'foo';
Expand Down
1 change: 0 additions & 1 deletion tests/StorageCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
class StorageCollectionTest extends PlatineTestCase
{

public function testConstructorOneValueIsNotInstanceOfStorage(): void
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
1 change: 0 additions & 1 deletion tests/StorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
class StorageTest extends PlatineTestCase
{

public function testConstructionDefault(): void
{
$name = 'foo';
Expand Down
18 changes: 0 additions & 18 deletions tests/fixtures/fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@

abstract class ContainerTestAbstractClass
{

public function __construct()
{
}
}

final class ContainerTesFinalClass
{

}

class ContainerTestClass
{

public $a;
public $b;
public $c;
Expand All @@ -42,23 +39,20 @@ public function bar(float $a): void

class ContainerTestClassCyclicOne
{

public function __construct(ContainerTestClassCyclicTwo $a)
{
}
}

class ContainerTestClassCyclicTwo
{

public function __construct(ContainerTestClassCyclicOne $a)
{
}
}

class ContainerTestClassInterfaceDependency
{

public $a = null;

public function __construct(ContainerTestInterface $a)
Expand All @@ -69,15 +63,13 @@ public function __construct(ContainerTestInterface $a)

class ContainerTestClassNoPublicConstructor
{

private function __construct()
{
}
}

class ContainerTestClassUsingGlobalValue
{

public $value = 1;

public function __construct(int $globalValue)
Expand All @@ -88,7 +80,6 @@ public function __construct(int $globalValue)

class ContainerTestClassWithoutConstructor
{

public $a;

public function foo(): void
Expand All @@ -99,15 +90,13 @@ public function foo(): void

class ContainerTestClassWithoutConstructorParam
{

public function __construct()
{
}
}

class ContainerTestClassConstructorVariadicParam
{

public $a = 0;

public function __construct(?int ...$a)
Expand All @@ -118,13 +107,11 @@ public function __construct(?int ...$a)

interface ContainerTestInterface
{

public function foo(): ?string;
}

class ContainerTestInterfaceImpl implements ContainerTestInterface
{

public function foo(): ?string
{
return null;
Expand All @@ -133,7 +120,6 @@ public function foo(): ?string

class ContainerTestClassGetUsingDefine
{

public function result()
{
return 6;
Expand All @@ -142,7 +128,6 @@ public function result()

class ContainerTestClassConstructorParamDefaultValue
{

public $a;

public function __construct(int $a = 50)
Expand All @@ -153,7 +138,6 @@ public function __construct(int $a = 50)

class ContainerTestClassConstructorParamDefaultValueClass
{

public $a;

public function __construct(ContainerTestClassWithoutConstructorParam $a = null)
Expand All @@ -164,7 +148,6 @@ public function __construct(ContainerTestClassWithoutConstructorParam $a = null)

class ContainerTestDelegateParent
{

public function build()
{
return new \stdClass();
Expand All @@ -173,7 +156,6 @@ public function build()

class ContainerTestDelegate extends ContainerTestDelegateParent
{

public function create()
{
return new \stdClass();
Expand Down

0 comments on commit 520b208

Please sign in to comment.