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

Adding property types to Middleware classes #3191

Merged
merged 4 commits into from
May 4, 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
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