Skip to content

Commit

Permalink
Merge 4a154f5 into 40b854c
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleycoles committed May 4, 2022
2 parents 40b854c + 4a154f5 commit 3864b48
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 106 deletions.
45 changes: 9 additions & 36 deletions Slim/Factory/AppFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,50 +26,23 @@

class AppFactory
{
/**
* @var Psr17FactoryProviderInterface|null
*/
protected static $psr17FactoryProvider;
protected static ?Psr17FactoryProviderInterface $psr17FactoryProvider = null;

/**
* @var ResponseFactoryInterface|null
*/
protected static $responseFactory;
protected static ?ResponseFactoryInterface $responseFactory = null;

/**
* @var StreamFactoryInterface|null
*/
protected static $streamFactory;
protected static ?StreamFactoryInterface $streamFactory = null;

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

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

/**
* @var RouteCollectorInterface|null
*/
protected static $routeCollector;
protected static ?RouteCollectorInterface $routeCollector = null;

/**
* @var RouteResolverInterface|null
*/
protected static $routeResolver;
protected static ?RouteResolverInterface $routeResolver = null;

/**
* @var MiddlewareDispatcherInterface|null
*/
protected static $middlewareDispatcher;
protected static ?MiddlewareDispatcherInterface $middlewareDispatcher = null;

/**
* @var bool
*/
protected static $slimHttpDecoratorsAutomaticDetectionEnabled = true;
protected static bool $slimHttpDecoratorsAutomaticDetectionEnabled = true;

/**
* @param ResponseFactoryInterface|null $responseFactory
Expand Down
8 changes: 4 additions & 4 deletions Slim/Factory/Psr17/GuzzlePsr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

class GuzzlePsr17Factory extends Psr17Factory
{
protected static $responseFactoryClass = 'GuzzleHttp\Psr7\HttpFactory';
protected static $streamFactoryClass = 'GuzzleHttp\Psr7\HttpFactory';
protected static $serverRequestCreatorClass = 'GuzzleHttp\Psr7\ServerRequest';
protected static $serverRequestCreatorMethod = 'fromGlobals';
protected static string $responseFactoryClass = 'GuzzleHttp\Psr7\HttpFactory';
protected static string $streamFactoryClass = 'GuzzleHttp\Psr7\HttpFactory';
protected static string $serverRequestCreatorClass = 'GuzzleHttp\Psr7\ServerRequest';
protected static string $serverRequestCreatorMethod = 'fromGlobals';
}
8 changes: 4 additions & 4 deletions Slim/Factory/Psr17/HttpSoftPsr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

class HttpSoftPsr17Factory extends Psr17Factory
{
protected static $responseFactoryClass = 'HttpSoft\Message\ResponseFactory';
protected static $streamFactoryClass = 'HttpSoft\Message\StreamFactory';
protected static $serverRequestCreatorClass = 'HttpSoft\ServerRequest\ServerRequestCreator';
protected static $serverRequestCreatorMethod = 'createFromGlobals';
protected static string $responseFactoryClass = 'HttpSoft\Message\ResponseFactory';
protected static string $streamFactoryClass = 'HttpSoft\Message\StreamFactory';
protected static string $serverRequestCreatorClass = 'HttpSoft\ServerRequest\ServerRequestCreator';
protected static string $serverRequestCreatorMethod = 'createFromGlobals';
}
8 changes: 4 additions & 4 deletions Slim/Factory/Psr17/LaminasDiactorosPsr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

class LaminasDiactorosPsr17Factory extends Psr17Factory
{
protected static $responseFactoryClass = 'Laminas\Diactoros\ResponseFactory';
protected static $streamFactoryClass = 'Laminas\Diactoros\StreamFactory';
protected static $serverRequestCreatorClass = 'Laminas\Diactoros\ServerRequestFactory';
protected static $serverRequestCreatorMethod = 'fromGlobals';
protected static string $responseFactoryClass = 'Laminas\Diactoros\ResponseFactory';
protected static string $streamFactoryClass = 'Laminas\Diactoros\StreamFactory';
protected static string $serverRequestCreatorClass = 'Laminas\Diactoros\ServerRequestFactory';
protected static string $serverRequestCreatorMethod = 'fromGlobals';
}
8 changes: 4 additions & 4 deletions Slim/Factory/Psr17/NyholmPsr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

class NyholmPsr17Factory extends Psr17Factory
{
protected static $responseFactoryClass = 'Nyholm\Psr7\Factory\Psr17Factory';
protected static $streamFactoryClass = 'Nyholm\Psr7\Factory\Psr17Factory';
protected static $serverRequestCreatorClass = 'Nyholm\Psr7Server\ServerRequestCreator';
protected static $serverRequestCreatorMethod = 'fromGlobals';
protected static string $responseFactoryClass = 'Nyholm\Psr7\Factory\Psr17Factory';
protected static string $streamFactoryClass = 'Nyholm\Psr7\Factory\Psr17Factory';
protected static string $serverRequestCreatorClass = 'Nyholm\Psr7Server\ServerRequestCreator';
protected static string $serverRequestCreatorMethod = 'fromGlobals';

/**
* {@inheritdoc}
Expand Down
20 changes: 4 additions & 16 deletions Slim/Factory/Psr17/Psr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,13 @@

abstract class Psr17Factory implements Psr17FactoryInterface
{
/**
* @var string
*/
protected static $responseFactoryClass;
protected static string $responseFactoryClass;

/**
* @var string
*/
protected static $streamFactoryClass;
protected static string $streamFactoryClass;

/**
* @var string
*/
protected static $serverRequestCreatorClass;
protected static string $serverRequestCreatorClass;

/**
* @var string
*/
protected static $serverRequestCreatorMethod;
protected static string $serverRequestCreatorMethod;

/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion Slim/Factory/Psr17/Psr17FactoryProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Psr17FactoryProvider implements Psr17FactoryProviderInterface
/**
* @var string[]
*/
protected static $factories = [
protected static array $factories = [
SlimPsr17Factory::class,
HttpSoftPsr17Factory::class,
NyholmPsr17Factory::class,
Expand Down
5 changes: 1 addition & 4 deletions Slim/Factory/Psr17/ServerRequestCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ class ServerRequestCreator implements ServerRequestCreatorInterface
*/
protected $serverRequestCreator;

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

/**
* @param object|string $serverRequestCreator
Expand Down
2 changes: 1 addition & 1 deletion Slim/Factory/Psr17/SlimHttpPsr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class SlimHttpPsr17Factory extends Psr17Factory
{
protected static $responseFactoryClass = 'Slim\Http\Factory\DecoratedResponseFactory';
protected static string $responseFactoryClass = 'Slim\Http\Factory\DecoratedResponseFactory';

/**
* @param ResponseFactoryInterface $responseFactory
Expand Down
10 changes: 2 additions & 8 deletions Slim/Factory/Psr17/SlimHttpServerRequestCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@

class SlimHttpServerRequestCreator implements ServerRequestCreatorInterface
{
/**
* @var ServerRequestCreatorInterface
*/
protected $serverRequestCreator;
protected ServerRequestCreatorInterface $serverRequestCreator;

/**
* @var string
*/
protected static $serverRequestDecoratorClass = 'Slim\Http\ServerRequest';
protected static string $serverRequestDecoratorClass = 'Slim\Http\ServerRequest';

/**
* @param ServerRequestCreatorInterface $serverRequestCreator
Expand Down
8 changes: 4 additions & 4 deletions Slim/Factory/Psr17/SlimPsr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

class SlimPsr17Factory extends Psr17Factory
{
protected static $responseFactoryClass = 'Slim\Psr7\Factory\ResponseFactory';
protected static $streamFactoryClass = 'Slim\Psr7\Factory\StreamFactory';
protected static $serverRequestCreatorClass = 'Slim\Psr7\Factory\ServerRequestFactory';
protected static $serverRequestCreatorMethod = 'createFromGlobals';
protected static string $responseFactoryClass = 'Slim\Psr7\Factory\ResponseFactory';
protected static string $streamFactoryClass = 'Slim\Psr7\Factory\StreamFactory';
protected static string $serverRequestCreatorClass = 'Slim\Psr7\Factory\ServerRequestFactory';
protected static string $serverRequestCreatorMethod = 'createFromGlobals';
}
15 changes: 3 additions & 12 deletions Slim/Factory/ServerRequestCreatorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,11 @@

class ServerRequestCreatorFactory
{
/**
* @var Psr17FactoryProviderInterface|null
*/
protected static $psr17FactoryProvider;
protected static ?Psr17FactoryProviderInterface $psr17FactoryProvider = null;

/**
* @var ServerRequestCreatorInterface|null
*/
protected static $serverRequestCreator;
protected static ?ServerRequestCreatorInterface $serverRequestCreator = null;

/**
* @var bool
*/
protected static $slimHttpDecoratorsAutomaticDetectionEnabled = true;
protected static bool $slimHttpDecoratorsAutomaticDetectionEnabled = true;

/**
* @return ServerRequestCreatorInterface
Expand Down
8 changes: 4 additions & 4 deletions tests/Mocks/MockPsr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

class MockPsr17Factory extends Psr17Factory
{
protected static $responseFactoryClass = '';
protected static $streamFactoryClass = '';
protected static $serverRequestCreatorClass = '';
protected static $serverRequestCreatorMethod = '';
protected static string $responseFactoryClass = '';
protected static string $streamFactoryClass = '';
protected static string $serverRequestCreatorClass = '';
protected static string $serverRequestCreatorMethod = '';
}
8 changes: 4 additions & 4 deletions tests/Mocks/MockPsr17FactoryWithoutStreamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

class MockPsr17FactoryWithoutStreamFactory extends Psr17Factory
{
protected static $responseFactoryClass = 'Slim\Psr7\Factory\ResponseFactory';
protected static $streamFactoryClass = '';
protected static $serverRequestCreatorClass = '';
protected static $serverRequestCreatorMethod = '';
protected static string $responseFactoryClass = 'Slim\Psr7\Factory\ResponseFactory';
protected static string $streamFactoryClass = '';
protected static string $serverRequestCreatorClass = '';
protected static string $serverRequestCreatorMethod = '';
}

0 comments on commit 3864b48

Please sign in to comment.