Skip to content

Commit

Permalink
Merge branch 'use-webmozart-assert'
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jan 13, 2019
2 parents 6f09740 + 3130b64 commit 0d71cc3
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
],
"require": {
"php": "^7.1",
"beberlei/assert": "^3.0",
"psr/container": "^1.0",
"seld/jsonlint": "^1.5",
"webmozart/assert": "^1.4",
"zendframework/zend-db": "^2.5",
"zendframework/zend-diactoros": "^2.0",
"zendframework/zend-log": "^2.5",
Expand All @@ -64,7 +64,7 @@
"php-coveralls/php-coveralls": "^2.0",
"php-di/php-di": "^6.0",
"phpstan/phpstan": "^0.10",
"phpstan/phpstan-beberlei-assert": "^0.10",
"phpstan/phpstan-webmozart-assert": "^0.10.0",
"pimple/pimple": "^3.2",
"symfony/dependency-injection": "^4.0",
"zendframework/zend-expressive": "^3.0",
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
includes:
- vendor/phpstan/phpstan-beberlei-assert/extension.neon
- vendor/phpstan/phpstan-webmozart-assert/extension.neon

parameters:
excludes_analyse:
Expand Down
6 changes: 3 additions & 3 deletions src/Handler/Logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace ErrorHeroModule\Handler;

use Assert\Assertion;
use ErrorException;
use ErrorHeroModule\HeroConstant;
use RuntimeException;
use Throwable;
use Webmozart\Assert\Assert;
use Zend\Console\Request as ConsoleRequest;
use Zend\Http\Header\Cookie;
use Zend\Http\PhpEnvironment\RemoteAddress;
Expand Down Expand Up @@ -104,7 +104,7 @@ private function getRequestData(RequestInterface $request) : array
return [];
}

Assertion::isInstanceOf($request, HttpRequest::class);
Assert::isInstanceOf($request, HttpRequest::class);
$query_data = $request->getQuery()->toArray();
$request_method = $request->getMethod();
$body_data = $request->getPost()->toArray();
Expand Down Expand Up @@ -160,7 +160,7 @@ private function collectErrorExceptionExtraData(array $collectedExceptionData, R
. ' ' . \get_current_user()
. '$ ' . \PHP_BINARY . ' ' . $request->getScriptName() . ' ' . $request->toString();
} else {
Assertion::isInstanceOf($request, HttpRequest::class);
Assert::isInstanceOf($request, HttpRequest::class);
$uri = $request->getUri();
$serverUrl = $uri->getScheme() . '://' . $uri->getHost();
$port = $uri->getPort();
Expand Down
4 changes: 2 additions & 2 deletions src/Listener/Mvc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace ErrorHeroModule\Listener;

use Assert\Assertion;
use ErrorHeroModule\Handler\Logging;
use ErrorHeroModule\HeroTrait;
use Webmozart\Assert\Assert;
use Zend\Console\Response as ConsoleResponse;
use Zend\EventManager\AbstractListenerAggregate;
use Zend\EventManager\EventManagerInterface;
Expand Down Expand Up @@ -103,7 +103,7 @@ private function showDefaultView(MvcEvent $e, RequestInterface $request) : void
{
if ($request instanceof Request) {
$response = $e->getResponse();
Assertion::isInstanceOf($response, Response::class);
Assert::isInstanceOf($response, Response::class);
$response->setStatusCode(500);

$application = $e->getApplication();
Expand Down
4 changes: 2 additions & 2 deletions src/Transformer/AuraService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

namespace ErrorHeroModule\Transformer;

use Assert\Assertion;
use Aura\Di\Container as AuraContainer;
use Closure;
use Psr\Container\ContainerInterface;
use Webmozart\Assert\Assert;

class AuraService extends TransformerAbstract implements TransformerInterface
{
public static function transform(ContainerInterface $container, array $configuration) : ContainerInterface
{
Assertion::isInstanceOf($container, AuraContainer::class);
Assert::isInstanceOf($container, AuraContainer::class);

$dbAdapterConfig = parent::getDbAdapterConfig($configuration);
$logger = parent::getLoggerInstance($configuration, $dbAdapterConfig);
Expand Down
4 changes: 2 additions & 2 deletions src/Transformer/AurynService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

namespace ErrorHeroModule\Transformer;

use Assert\Assertion;
use Closure;
use Northwoods\Container\InjectorContainer as AurynInjectorContainer;
use Psr\Container\ContainerInterface;
use Webmozart\Assert\Assert;

class AurynService extends TransformerAbstract implements TransformerInterface
{
public static function transform(ContainerInterface $container, array $configuration) : ContainerInterface
{
Assertion::isInstanceOf($container, AurynInjectorContainer::class);
Assert::isInstanceOf($container, AurynInjectorContainer::class);

$dbAdapterConfig = parent::getDbAdapterConfig($configuration);
$logger = parent::getLoggerInstance($configuration, $dbAdapterConfig);
Expand Down
4 changes: 2 additions & 2 deletions src/Transformer/Doctrine.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

namespace ErrorHeroModule\Transformer;

use Assert\Assertion;
use Doctrine\ORM\EntityManager;
use Psr\Container\ContainerInterface;
use Webmozart\Assert\Assert;
use Zend\ServiceManager\ServiceManager as ZendServiceManager;

class Doctrine extends TransformerAbstract implements TransformerInterface
{
public static function transform(ContainerInterface $container, array $configuration) : ContainerInterface
{
Assertion::isInstanceOf($container, ZendServiceManager::class);
Assert::isInstanceOf($container, ZendServiceManager::class);

$entityManager = $container->get(EntityManager::class);
$doctrineDBALConnection = $entityManager->getConnection();
Expand Down
4 changes: 2 additions & 2 deletions src/Transformer/PHPDIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace ErrorHeroModule\Transformer;

use Assert\Assertion;
use DI\Container as PHPDIContainer;
use Psr\Container\ContainerInterface;
use Webmozart\Assert\Assert;

class PHPDIService extends TransformerAbstract implements TransformerInterface
{
public static function transform(ContainerInterface $container, array $configuration) : ContainerInterface
{
Assertion::isInstanceOf($container, PHPDIContainer::class);
Assert::isInstanceOf($container, PHPDIContainer::class);

$dbAdapterConfig = parent::getDbAdapterConfig($configuration);
$logger = parent::getLoggerInstance($configuration, $dbAdapterConfig);
Expand Down
4 changes: 2 additions & 2 deletions src/Transformer/PimpleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

namespace ErrorHeroModule\Transformer;

use Assert\Assertion;
use Closure;
use Pimple\Psr11\Container as Psr11PimpleContainer;
use Psr\Container\ContainerInterface;
use Webmozart\Assert\Assert;

class PimpleService extends TransformerAbstract implements TransformerInterface
{
public static function transform(ContainerInterface $container, array $configuration) : ContainerInterface
{
Assertion::isInstanceOf($container, Psr11PimpleContainer::class);
Assert::isInstanceOf($container, Psr11PimpleContainer::class);

$dbAdapterConfig = parent::getDbAdapterConfig($configuration);
$logger = parent::getLoggerInstance($configuration, $dbAdapterConfig);
Expand Down
4 changes: 2 additions & 2 deletions src/Transformer/SymfonyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace ErrorHeroModule\Transformer;

use Assert\Assertion;
use Psr\Container\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder as SymfonyContainerBuilder;
use Webmozart\Assert\Assert;

class SymfonyService extends TransformerAbstract implements TransformerInterface
{
public static function transform(ContainerInterface $container, array $configuration) : ContainerInterface
{
Assertion::isInstanceOf($container, SymfonyContainerBuilder::class);
Assert::isInstanceOf($container, SymfonyContainerBuilder::class);

$dbAdapterConfig = parent::getDbAdapterConfig($configuration);
$logger = parent::getLoggerInstance($configuration, $dbAdapterConfig);
Expand Down

0 comments on commit 0d71cc3

Please sign in to comment.