Skip to content

Commit

Permalink
Merge pull request #3180 from nbayramberdiyev/types
Browse files Browse the repository at this point in the history
Declare types
  • Loading branch information
l0gicgate committed Mar 31, 2022
2 parents 0dfc7d2 + aaa7adb commit bd18889
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 177 deletions.
10 changes: 2 additions & 8 deletions Slim/App.php
Expand Up @@ -40,15 +40,9 @@ class App extends RouteCollectorProxy implements RequestHandlerInterface
*/
public const VERSION = '4.10.0';

/**
* @var RouteResolverInterface
*/
protected $routeResolver;
protected RouteResolverInterface $routeResolver;

/**
* @var MiddlewareDispatcherInterface
*/
protected $middlewareDispatcher;
protected MiddlewareDispatcherInterface $middlewareDispatcher;

/**
* @param ResponseFactoryInterface $responseFactory
Expand Down
10 changes: 2 additions & 8 deletions Slim/CallableResolver.php
Expand Up @@ -28,15 +28,9 @@

final class CallableResolver implements AdvancedCallableResolverInterface
{
/**
* @var string
*/
public static $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!';
public static string $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!';

/**
* @var ContainerInterface|null
*/
private $container;
private ?ContainerInterface $container;

/**
* @param ContainerInterface|null $container
Expand Down
34 changes: 7 additions & 27 deletions Slim/MiddlewareDispatcher.php
Expand Up @@ -32,20 +32,12 @@ class MiddlewareDispatcher implements MiddlewareDispatcherInterface
{
/**
* Tip of the middleware call stack
*
* @var RequestHandlerInterface
*/
protected $tip;
protected RequestHandlerInterface $tip;

/**
* @var CallableResolverInterface|null
*/
protected $callableResolver;
protected ?CallableResolverInterface $callableResolver;

/**
* @var ContainerInterface|null
*/
protected $container;
protected ?ContainerInterface $container;

/**
* @param RequestHandlerInterface $kernel
Expand Down Expand Up @@ -170,25 +162,13 @@ public function addDeferred(string $middleware): self
$this->container,
$this->callableResolver
) implements RequestHandlerInterface {
/**
* @var string
*/
private $middleware;
private string $middleware;

/**
* @var RequestHandlerInterface
*/
private $next;
private RequestHandlerInterface $next;

/**
* @var ContainerInterface|null
*/
private $container;
private ?ContainerInterface $container;

/**
* @var CallableResolverInterface|null
*/
private $callableResolver;
private ?CallableResolverInterface $callableResolver;

public function __construct(
string $middleware,
Expand Down
5 changes: 1 addition & 4 deletions Slim/ResponseEmitter.php
Expand Up @@ -25,10 +25,7 @@

class ResponseEmitter
{
/**
* @var int
*/
private $responseChunkSize;
private int $responseChunkSize;

/**
* @param int $responseChunkSize
Expand Down

0 comments on commit bd18889

Please sign in to comment.