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

Upgrade dependencies #27

Merged
merged 6 commits into from
Mar 28, 2020
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
4 changes: 2 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
rabbitmq: false
mongodb: false
php:
version: 7.3
version: 7.4
cache:
disabled: false
directories:
Expand All @@ -23,7 +23,7 @@ build:

dependencies:
override:
- composer install --no-interaction --prefer-dist
- COMPOSER_ROOT_VERSION=0.4.x-dev composer install --no-interaction --prefer-dist

checks:
php: true
Expand Down
24 changes: 16 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
dist: xenial
sudo: false
language: php

php:
- 7.3
- 7.4snapshot
- 7.4
- nightly

cache:
Expand All @@ -15,6 +12,9 @@ before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
- composer self-update

env:
- COMPOSER_ROOT_VERSION="0.4.x-dev"

install: travis_retry composer install

script:
Expand All @@ -26,7 +26,9 @@ jobs:

include:
- stage: Code Quality
env: TEST_COVERAGE=1
env:
- TEST_COVERAGE=1
- COMPOSER_ROOT_VERSION="0.4.x-dev"
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
Expand All @@ -37,17 +39,23 @@ jobs:
- php ocular.phar code-coverage:upload --format=php-clover ./clover.xml

- stage: Code Quality
env: CODE_STANDARD=1
env:
- CODE_STANDARD=1
- COMPOSER_ROOT_VERSION="0.4.x-dev"
script:
- ./vendor/bin/phpcs

- stage: Code Quality
env: STATIC_ANALYSIS=1
env:
- STATIC_ANALYSIS=1
- COMPOSER_ROOT_VERSION="0.4.x-dev"
script:
- ./vendor/bin/phpstan analyse

- stage: Code Quality
env: MUTATION_TESTS=1
env:
- MUTATION_TESTS=1
- COMPOSER_ROOT_VERSION="0.4.x-dev"
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for mutation tests"; exit 1; fi
Expand Down
23 changes: 12 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
"sort-packages": true
},
"require": {
"php": "^7.3 || ^8.0",
"chimera/foundation": "^0.3",
"php": "^7.4 || ^8.0",
"chimera/foundation": "self.version",
"fig/http-message-util": "^1.1",
"lcobucci/content-negotiation-middleware": "^2.1",
"middlewares/negotiation": "^1.1",
"lcobucci/content-negotiation-middleware": "^2.2",
"middlewares/negotiation": "^2.0",
"psr/http-factory": "^1.0",
"psr/http-server-middleware": "^1.0"
},
"require-dev": {
"infection/infection": "^0.15",
"lcobucci/coding-standard": "^3.1",
"phpstan/phpstan": "^0.11",
"phpstan/phpstan-deprecation-rules": "^0.11",
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-strict-rules": "^0.11",
"phpunit/phpunit": "^9.0",
"zendframework/zend-diactoros": "^2.2"
"laminas/laminas-diactoros": "^2.2",
"lcobucci/coding-standard": "^4.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-deprecation-rules": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 0 additions & 6 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon

parameters:
level: 7
paths:
Expand Down
38 changes: 6 additions & 32 deletions src/Handler/CreateAndFetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,12 @@
*/
final class CreateAndFetch implements RequestHandlerInterface
{
/**
* @var ExecuteCommand
*/
private $writeAction;

/**
* @var ExecuteQuery
*/
private $readAction;

/**
* @var ResponseFactoryInterface
*/
private $responseFactory;

/**
* @var string
*/
private $routeName;

/**
* @var UriGenerator
*/
private $uriGenerator;

/**
* @var IdentifierGenerator
*/
private $identifierGenerator;
private ExecuteCommand $writeAction;
private ExecuteQuery $readAction;
private ResponseFactoryInterface $responseFactory;
private string $routeName;
private UriGenerator $uriGenerator;
private IdentifierGenerator $identifierGenerator;

public function __construct(
ExecuteCommand $writeAction,
Expand All @@ -67,9 +44,6 @@ public function __construct(
$this->identifierGenerator = $identifierGenerator;
}

/**
* {@inheritdoc}
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$request = $request->withAttribute(
Expand Down
37 changes: 6 additions & 31 deletions src/Handler/CreateOnly.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,12 @@
*/
final class CreateOnly implements RequestHandlerInterface
{
/**
* @var ExecuteCommand
*/
private $action;

/**
* @var ResponseFactoryInterface
*/
private $responseFactory;

/**
* @var string
*/
private $routeName;

/**
* @var UriGenerator
*/
private $uriGenerator;

/**
* @var int
*/
private $statusCode;
/**
* @var IdentifierGenerator
*/
private $identifierGenerator;
private ExecuteCommand $action;
private ResponseFactoryInterface $responseFactory;
private string $routeName;
private UriGenerator $uriGenerator;
private int $statusCode;
private IdentifierGenerator $identifierGenerator;

public function __construct(
ExecuteCommand $action,
Expand All @@ -63,9 +41,6 @@ public function __construct(
$this->statusCode = $statusCode;
}

/**
* {@inheritdoc}
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$request = $request->withAttribute(
Expand Down
20 changes: 3 additions & 17 deletions src/Handler/ExecuteAndFetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,9 @@
*/
final class ExecuteAndFetch implements RequestHandlerInterface
{
/**
* @var ExecuteCommand
*/
private $writeAction;

/**
* @var ExecuteQuery
*/
private $readAction;

/**
* @var ResponseFactoryInterface
*/
private $responseFactory;
private ExecuteCommand $writeAction;
private ExecuteQuery $readAction;
private ResponseFactoryInterface $responseFactory;

public function __construct(
ExecuteCommand $writeAction,
Expand All @@ -43,9 +32,6 @@ public function __construct(
$this->responseFactory = $responseFactory;
}

/**
* {@inheritdoc}
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$input = new HttpRequest($request);
Expand Down
20 changes: 3 additions & 17 deletions src/Handler/ExecuteOnly.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,9 @@
*/
final class ExecuteOnly implements RequestHandlerInterface
{
/**
* @var ExecuteCommand
*/
private $action;

/**
* @var ResponseFactoryInterface
*/
private $responseFactory;

/**
* @var int
*/
private $statusCode;
private ExecuteCommand $action;
private ResponseFactoryInterface $responseFactory;
private int $statusCode;

public function __construct(ExecuteCommand $action, ResponseFactoryInterface $responseFactory, int $statusCode)
{
Expand All @@ -37,9 +26,6 @@ public function __construct(ExecuteCommand $action, ResponseFactoryInterface $re
$this->statusCode = $statusCode;
}

/**
* {@inheritdoc}
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->action->execute(new HttpRequest($request));
Expand Down
14 changes: 2 additions & 12 deletions src/Handler/FetchOnly.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,15 @@
*/
final class FetchOnly implements RequestHandlerInterface
{
/**
* @var ExecuteQuery
*/
private $action;

/**
* @var ResponseFactoryInterface
*/
private $responseFactory;
private ExecuteQuery $action;
private ResponseFactoryInterface $responseFactory;

public function __construct(ExecuteQuery $action, ResponseFactoryInterface $responseFactory)
{
$this->action = $action;
$this->responseFactory = $responseFactory;
}

/**
* {@inheritdoc}
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
return new UnformattedResponse(
Expand Down
7 changes: 2 additions & 5 deletions src/HttpRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
*/
final class HttpRequest implements Input
{
/**
* @var ServerRequestInterface
*/
private $request;
private ServerRequestInterface $request;

public function __construct(ServerRequestInterface $request)
{
Expand All @@ -42,7 +39,7 @@ public function getData(): array
}

/**
* @return string[]
* @return array<string, mixed>
*/
private function getContext(): array
{
Expand Down
8 changes: 1 addition & 7 deletions src/RouteParamsExtraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@

final class RouteParamsExtraction implements MiddlewareInterface
{
/**
* @var RouteParamsExtractor
*/
private $extractor;
private RouteParamsExtractor $extractor;

public function __construct(RouteParamsExtractor $extractor)
{
$this->extractor = $extractor;
}

/**
* {@inheritdoc}
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
return $handler->handle(
Expand Down
Loading