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 to coding-standard v8.6 #54

Merged
merged 3 commits into from
Feb 25, 2022
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: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"slim/slim": "^3.12"
},
"require-dev": {
"brandembassy/coding-standard": "^8.1",
"brandembassy/mockery-tools": "^2.14",
"brandembassy/coding-standard": "^8.6",
"brandembassy/mockery-tools": "^3.8",
"mockery/mockery": "^1.2",
"phpunit/phpunit": "^8.5",
"roave/security-advisories": "dev-master"
},
"scripts": {
"phpcs": "vendor/bin/phpcs --standard=BrandEmbassyCodingStandard src tests --ignore=tests/temp",
"phpcbf": "./vendor/bin/phpcbf --standard=BrandEmbassyCodingStandard src tests --ignore=tests/temp",
"phpcs": "vendor/bin/phpcs --standard=BrandEmbassyCodingStandard src tests --ignore=tests/temp --runtime-set php_version 70200",
"phpcbf": "./vendor/bin/phpcbf --standard=BrandEmbassyCodingStandard src tests --ignore=tests/temp --runtime-set php_version 70200",
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon src",
"phpunit": "./vendor/bin/phpunit tests --no-coverage"
},
Expand Down
5 changes: 4 additions & 1 deletion src/DI/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use function assert;
use function class_exists;

final class ServiceProvider
/**
* @final
*/
class ServiceProvider
{
/**
* @return object
Expand Down
5 changes: 4 additions & 1 deletion src/DI/SlimApiExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
use Slim\Container;
use Slim\Router;

final class SlimApiExtension extends CompilerExtension
/**
* @final
*/
class SlimApiExtension extends CompilerExtension
{
public function getConfigSchema(): Schema
{
Expand Down
5 changes: 4 additions & 1 deletion src/Middleware/BeforeRouteMiddlewares.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace BrandEmbassy\Slim\Middleware;

final class BeforeRouteMiddlewares
/**
* @final
*/
class BeforeRouteMiddlewares
{
/**
* @var callable[]
Expand Down
5 changes: 4 additions & 1 deletion src/Middleware/MiddlewareFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
use function assert;
use function is_callable;

final class MiddlewareFactory
/**
* @final
*/
class MiddlewareFactory
{
/**
* @var Container
Expand Down
5 changes: 4 additions & 1 deletion src/Middleware/MiddlewareGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
use function array_map;
use function array_merge_recursive;

final class MiddlewareGroups
/**
* @final
*/
class MiddlewareGroups
{
/**
* @var array<string, callable[]>
Expand Down
5 changes: 4 additions & 1 deletion src/Request/DefaultRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use Slim\Http\Environment;

final class DefaultRequestFactory implements RequestFactory
/**
* @final
*/
class DefaultRequestFactory implements RequestFactory
{
public function create(): RequestInterface
{
Expand Down
5 changes: 4 additions & 1 deletion src/Request/QueryParamMissingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use function sprintf;

final class QueryParamMissingException extends RequestException
/**
* @final
*/
class QueryParamMissingException extends RequestException
{
public static function create(string $key): self
{
Expand Down
4 changes: 3 additions & 1 deletion src/Request/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
/**
* @method string[]|string[][] getQueryParams()
* @method string|string[]|null getQueryParam(string $key, ?string $default = null)
*
* @final
*/
final class Request extends SlimRequest implements RequestInterface
class Request extends SlimRequest implements RequestInterface
{
private const ROUTE_INFO_ATTRIBUTE = 'routeInfo';
private const ROUTE_ATTRIBUTE = 'route';
Expand Down
5 changes: 4 additions & 1 deletion src/Request/RequestAttributeMissingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use function sprintf;

final class RequestAttributeMissingException extends RequestException
/**
* @final
*/
class RequestAttributeMissingException extends RequestException
{
public static function create(string $requestAttributeName): self
{
Expand Down
5 changes: 4 additions & 1 deletion src/Request/RequestFieldMissingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use function sprintf;

final class RequestFieldMissingException extends RequestException
/**
* @final
*/
class RequestFieldMissingException extends RequestException
{
public static function create(string $fieldName): self
{
Expand Down
5 changes: 4 additions & 1 deletion src/Request/RouteArgumentMissingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use function sprintf;

final class RouteArgumentMissingException extends RequestException
/**
* @final
*/
class RouteArgumentMissingException extends RequestException
{
public static function create(string $argument): self
{
Expand Down
5 changes: 4 additions & 1 deletion src/Response/DefaultResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace BrandEmbassy\Slim\Response;

final class DefaultResponseFactory implements ResponseFactory
/**
* @final
*/
class DefaultResponseFactory implements ResponseFactory
{
public function create(): ResponseInterface
{
Expand Down
5 changes: 4 additions & 1 deletion src/Response/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
use function assert;
use function is_array;

final class Response extends SlimResponse implements ResponseInterface
/**
* @final
*/
class Response extends SlimResponse implements ResponseInterface
{
/**
* @return mixed[]
Expand Down
5 changes: 4 additions & 1 deletion src/Route/InvalidRouteDefinitionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
use function implode;
use function sprintf;

final class InvalidRouteDefinitionException extends RuntimeException
/**
* @final
*/
class InvalidRouteDefinitionException extends RuntimeException
{
/**
* @param string[] $path
Expand Down
5 changes: 4 additions & 1 deletion src/Route/RouteDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace BrandEmbassy\Slim\Route;

final class RouteDefinition
/**
* @final
*/
class RouteDefinition
{
public const SERVICE = 'service';
public const MIDDLEWARES = 'middlewares';
Expand Down
5 changes: 4 additions & 1 deletion src/Route/RouteDefinitionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use LogicException;
use Nette\DI\Container;

final class RouteDefinitionFactory
/**
* @final
*/
class RouteDefinitionFactory
{
/**
* @var Container
Expand Down
5 changes: 4 additions & 1 deletion src/Route/RouteRegister.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
use function array_merge_recursive;
use function levenshtein;

final class RouteRegister
/**
* @final
*/
class RouteRegister
{
/**
* @var RouterInterface
Expand Down
5 changes: 4 additions & 1 deletion src/Route/UrlPatternResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use function trim;

final class UrlPatternResolver
/**
* @final
*/
class UrlPatternResolver
{
/**
* @var string
Expand Down
5 changes: 4 additions & 1 deletion src/SlimApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
use function is_callable;
use function sprintf;

final class SlimApplicationFactory
/**
* @final
*/
class SlimApplicationFactory
{
public const SLIM_CONFIGURATION = 'slimConfiguration';
public const BEFORE_ROUTE_MIDDLEWARES = 'beforeRouteMiddlewares';
Expand Down
5 changes: 4 additions & 1 deletion src/SlimContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use Slim\Container;
use Slim\Interfaces\RouterInterface;

final class SlimContainerFactory
/**
* @final
*/
class SlimContainerFactory
{
/**
* @var ResponseFactory
Expand Down
5 changes: 4 additions & 1 deletion tests/MiddlewareInvocationCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use BrandEmbassy\Slim\Response\ResponseInterface;

final class MiddlewareInvocationCounter
/**
* @final
*/
class MiddlewareInvocationCounter
{
/**
* @var int
Expand Down
5 changes: 4 additions & 1 deletion tests/Request/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
use PHPUnit\Framework\TestCase;
use function urlencode;

final class RequestTest extends TestCase
/**
* @final
*/
class RequestTest extends TestCase
{
private const PARAM_NAME = 'dateFrom';
private const DATE_TIME_STRING = '2017-06-10T01:00:00+01:00';
Expand Down
5 changes: 4 additions & 1 deletion tests/Response/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;

final class ResponseTest extends TestCase
/**
* @final
*/
class ResponseTest extends TestCase
{
public function testGetParsedBodyAsArray(): void
{
Expand Down
5 changes: 4 additions & 1 deletion tests/Sample/ApiErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use BrandEmbassy\Slim\Response\ResponseInterface;
use Throwable;

final class ApiErrorHandler implements ErrorHandler
/**
* @final
*/
class ApiErrorHandler implements ErrorHandler
{
public function __invoke(
RequestInterface $request,
Expand Down
5 changes: 4 additions & 1 deletion tests/Sample/CreateChannelRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
use BrandEmbassy\Slim\Response\ResponseInterface;
use BrandEmbassy\Slim\Route\Route;

final class CreateChannelRoute implements Route
/**
* @final
*/
class CreateChannelRoute implements Route
{
/**
* @param string[] $arguments
Expand Down
5 changes: 4 additions & 1 deletion tests/Sample/CreateChannelUserRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use BrandEmbassy\Slim\Route\Route;
use function assert;

final class CreateChannelUserRoute implements Route
/**
* @final
*/
class CreateChannelUserRoute implements Route
{
/**
* @var RequestInterface
Expand Down
5 changes: 4 additions & 1 deletion tests/Sample/ErrorThrowingRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use BrandEmbassy\Slim\Route\Route;
use LogicException;

final class ErrorThrowingRoute implements Route
/**
* @final
*/
class ErrorThrowingRoute implements Route
{
public function __invoke(RequestInterface $request, ResponseInterface $response): ResponseInterface
{
Expand Down
5 changes: 4 additions & 1 deletion tests/Sample/GoldenKeyAuthMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
use BrandEmbassy\Slim\Request\RequestInterface;
use BrandEmbassy\Slim\Response\ResponseInterface;

final class GoldenKeyAuthMiddleware implements Middleware
/**
* @final
*/
class GoldenKeyAuthMiddleware implements Middleware
{
public const ACCESS_TOKEN = 'uber-secret-token-made-of-pure-gold';

Expand Down
5 changes: 4 additions & 1 deletion tests/Sample/GroupMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use BrandEmbassy\Slim\Response\ResponseInterface;
use BrandEmbassyTest\Slim\MiddlewareInvocationCounter;

final class GroupMiddleware implements Middleware
/**
* @final
*/
class GroupMiddleware implements Middleware
{
public const HEADER_NAME = 'group-middleware';

Expand Down
5 changes: 4 additions & 1 deletion tests/Sample/HelloWorldRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
use BrandEmbassy\Slim\Response\ResponseInterface;
use BrandEmbassy\Slim\Route\Route;

final class HelloWorldRoute implements Route
/**
* @final
*/
class HelloWorldRoute implements Route
{
public function __invoke(RequestInterface $request, ResponseInterface $response): ResponseInterface
{
Expand Down
5 changes: 4 additions & 1 deletion tests/Sample/InvokeCounterMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use BrandEmbassy\Slim\Response\ResponseInterface;
use BrandEmbassyTest\Slim\MiddlewareInvocationCounter;

final class InvokeCounterMiddleware implements Middleware
/**
* @final
*/
class InvokeCounterMiddleware implements Middleware
{
public const HEADER_NAME_PREFIX = 'invoke-counter-';

Expand Down
Loading