Skip to content

Commit

Permalink
Merge pull request #3191 from ashleycoles/middlewareTypes
Browse files Browse the repository at this point in the history
Adding property types to Middleware classes
  • Loading branch information
l0gicgate authored May 4, 2022
2 parents f87addd + 2f8e69e commit 474de30
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Slim/Middleware/BodyParsingMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BodyParsingMiddleware implements MiddlewareInterface
/**
* @var callable[]
*/
protected $bodyParsers;
protected array $bodyParsers;

/**
* @param callable[] $bodyParsers list of body parsers as an associative array of mediaType => callable
Expand Down
34 changes: 8 additions & 26 deletions Slim/Middleware/ErrorMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,27 @@

class ErrorMiddleware implements MiddlewareInterface
{
/**
* @var CallableResolverInterface
*/
protected $callableResolver;
protected CallableResolverInterface $callableResolver;

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

/**
* @var bool
*/
protected $displayErrorDetails;
protected bool $displayErrorDetails;

/**
* @var bool
*/
protected $logErrors;
protected bool $logErrors;

/**
* @var bool
*/
protected $logErrorDetails;
protected bool $logErrorDetails;

/**
* @var LoggerInterface|null
*/
protected $logger;
protected ?LoggerInterface $logger = null;

/**
* @var ErrorHandlerInterface[]|callable[]|string[]
*/
protected $handlers = [];
protected array $handlers = [];

/**
* @var ErrorHandlerInterface[]|callable[]|string[]
*/
protected $subClassHandlers = [];
protected array $subClassHandlers = [];

/**
* @var ErrorHandlerInterface|callable|string|null
Expand Down
10 changes: 2 additions & 8 deletions Slim/Middleware/OutputBufferingMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ class OutputBufferingMiddleware implements MiddlewareInterface
public const APPEND = 'append';
public const PREPEND = 'prepend';

/**
* @var StreamFactoryInterface
*/
protected $streamFactory;
protected StreamFactoryInterface $streamFactory;

/**
* @var string
*/
protected $style;
protected string $style;

/**
* @param StreamFactoryInterface $streamFactory
Expand Down
10 changes: 2 additions & 8 deletions Slim/Middleware/RoutingMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@

class RoutingMiddleware implements MiddlewareInterface
{
/**
* @var RouteResolverInterface
*/
protected $routeResolver;
protected RouteResolverInterface $routeResolver;

/**
* @var RouteParserInterface
*/
protected $routeParser;
protected RouteParserInterface $routeParser;

/**
* @param RouteResolverInterface $routeResolver
Expand Down

0 comments on commit 474de30

Please sign in to comment.