Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #45 from tux-rampage/feature/strict-types
Browse files Browse the repository at this point in the history
Declare strict types
  • Loading branch information
Ocramius committed Nov 23, 2018
2 parents d82ccc9 + d670566 commit 34fe8bf
Show file tree
Hide file tree
Showing 127 changed files with 255 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/CodeGenerator/AbstractInjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\CodeGenerator;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/CodeGenerator/AutoloadGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\CodeGenerator;

use SplFileObject;
Expand Down
2 changes: 2 additions & 0 deletions src/CodeGenerator/FactoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\CodeGenerator;

use SplFileObject;
Expand Down
2 changes: 2 additions & 0 deletions src/CodeGenerator/FactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\CodeGenerator;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/CodeGenerator/GeneratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\CodeGenerator;

use Zend\Di\Exception\GenerateCodeException;
Expand Down
2 changes: 2 additions & 0 deletions src/CodeGenerator/InjectorGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\CodeGenerator;

use Psr\Log\LoggerInterface;
Expand Down
4 changes: 3 additions & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di;

use ArrayAccess;
Expand Down Expand Up @@ -225,7 +227,7 @@ public function setTypePreference(string $type, string $preference, ?string $con
public function setAlias(string $name, string $class) : self
{
if (! class_exists($class) && ! interface_exists($class)) {
throw new Exception\ClassNotFoundException('Could not find class "' . $class . '"');
throw new Exception\ClassNotFoundException($class);
}

$this->types[$name]['typeOf'] = $class;
Expand Down
2 changes: 2 additions & 0 deletions src/ConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Container/AutowireFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Container;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Container/ConfigFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Container;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Container/GeneratorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Container;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Container/InjectorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Container;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Container/ServiceManager/AutowireFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Container\ServiceManager;

use Interop\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/DefaultContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Definition/ClassDefinitionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Definition;

use ReflectionClass;
Expand Down
2 changes: 2 additions & 0 deletions src/Definition/DefinitionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Definition;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Definition/ParameterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Definition;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Definition/Reflection/ClassDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Definition\Reflection;

use ReflectionClass;
Expand Down
2 changes: 2 additions & 0 deletions src/Definition/Reflection/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Definition\Reflection;

use ReflectionParameter;
Expand Down
2 changes: 2 additions & 0 deletions src/Definition/RuntimeDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Definition;

use Zend\Di\Definition\Reflection\ClassDefinition;
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/CircularDependencyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

use DomainException;
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

use Throwable;
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/GenerateCodeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/InvalidCallbackException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/InvalidParamNameException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

class InvalidParamNameException extends InvalidArgumentException
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/InvalidPositionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

class InvalidPositionException extends InvalidArgumentException
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/LogicException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

class LogicException extends \LogicException implements ExceptionInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/MissingPropertyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

use DomainException;
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

class RuntimeException extends \RuntimeException implements ExceptionInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/UndefinedReferenceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

use DomainException;
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Exception;

class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Injector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di;

use Psr\Container\ContainerExceptionInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/InjectorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/LegacyConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di;

use Traversable;
Expand Down
2 changes: 2 additions & 0 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Resolver/AbstractInjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Resolver;

use const E_USER_DEPRECATED;
Expand Down
2 changes: 2 additions & 0 deletions src/Resolver/DependencyResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Resolver;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Resolver/DependencyResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Resolver;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Resolver/InjectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Resolver;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Resolver/TypeInjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Resolver;

use Psr\Container\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Resolver/ValueInjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license https://github.com/zendframework/zend-di/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\Di\Resolver;

use Psr\Container\ContainerInterface;
Expand Down

0 comments on commit 34fe8bf

Please sign in to comment.