From ef704b8aa38846e9cc04c60d1e4a45335f23f03e Mon Sep 17 00:00:00 2001 From: Andrew DalPino Date: Fri, 21 May 2021 21:59:19 -0500 Subject: [PATCH] Add typed class properties --- src/Events/DatasetInferred.php | 2 +- src/Events/Failure.php | 2 +- src/Events/MemoryUsageUpdated.php | 2 +- src/Events/RequestReceived.php | 2 +- src/Events/ResponseSent.php | 2 +- src/GraphQL/Enums/DataTypeEnum.php | 2 +- src/GraphQL/Enums/EstimatorTypeEnum.php | 2 +- .../InputObjects/DatasetInputObject.php | 2 +- .../Objects/EstimatorInterfacesObject.php | 2 +- src/GraphQL/Objects/HTTPStatsObject.php | 2 +- src/GraphQL/Objects/HyperparameterObject.php | 2 +- src/GraphQL/Objects/MemoryObject.php | 2 +- src/GraphQL/Objects/ModelObject.php | 2 +- src/GraphQL/Objects/ProbabilityObject.php | 2 +- src/GraphQL/Objects/ProcessInfoObject.php | 2 +- src/GraphQL/Objects/RequestsObject.php | 2 +- src/GraphQL/Objects/ServerObject.php | 2 +- src/GraphQL/Objects/ServerSettingsObject.php | 2 +- src/GraphQL/Objects/TransfersObject.php | 2 +- src/HTTP/Controllers/DashboardController.php | 2 +- src/HTTP/Controllers/GraphQLController.php | 4 ++-- src/HTTP/Controllers/ModelController.php | 2 +- src/HTTP/Controllers/ServerController.php | 2 +- .../Controllers/StaticAssetsController.php | 4 ++-- .../Middleware/Client/BackoffAndRetry.php | 4 ++-- .../Middleware/Client/BasicAuthenticator.php | 2 +- .../Middleware/Client/CompressRequestBody.php | 4 ++-- .../Internal/AttachServerHeaders.php | 2 +- .../Middleware/Internal/CatchServerErrors.php | 2 +- .../Internal/CheckRequestBodySize.php | 2 +- .../Middleware/Internal/CircuitBreaker.php | 2 +- .../Middleware/Internal/DispatchEvents.php | 2 +- .../Middleware/Server/AccessLogGenerator.php | 2 +- .../Middleware/Server/BasicAuthenticator.php | 4 ++-- .../Server/SharedTokenAuthenticator.php | 4 ++-- src/HTTP/Middleware/Server/TrustedClients.php | 2 +- src/HTTPServer.php | 24 +++++++++---------- src/Jobs/EvictCacheItems.php | 2 +- src/Jobs/HandleEvent.php | 4 ++-- src/Jobs/UpdateMemoryUsage.php | 2 +- src/Listeners/CloseSSEChannels.php | 2 +- src/Listeners/CloseSocket.php | 2 +- src/Listeners/DashboardEmitter.php | 2 +- src/Listeners/LogFailures.php | 2 +- src/Listeners/RecordHTTPStats.php | 2 +- src/Listeners/StopTimers.php | 2 +- src/Loggers/File.php | 4 ++-- src/Models/HTTPStats.php | 10 ++++---- src/Models/Memory.php | 2 +- src/Models/Model.php | 6 ++--- src/Models/ProcessInfo.php | 4 ++-- src/Models/Server.php | 8 +++---- src/Models/ServerSettings.php | 2 +- src/RESTClient.php | 2 +- src/Services/Caches/CacheItem.php | 4 ++-- src/Services/Caches/InMemoryCache.php | 4 ++-- src/Services/EventBus.php | 6 ++--- src/Services/Router.php | 2 +- src/Services/Routes.php | 2 +- src/Services/SSEChannel.php | 8 +++---- src/Services/Scheduler.php | 2 +- src/Services/Subscriptions.php | 2 +- 62 files changed, 98 insertions(+), 98 deletions(-) diff --git a/src/Events/DatasetInferred.php b/src/Events/DatasetInferred.php index 0b5d0e5..bc1a397 100644 --- a/src/Events/DatasetInferred.php +++ b/src/Events/DatasetInferred.php @@ -18,7 +18,7 @@ class DatasetInferred implements Event * * @var \Rubix\ML\Datasets\Dataset */ - protected $dataset; + protected \Rubix\ML\Datasets\Dataset $dataset; /** * @param \Rubix\ML\Datasets\Dataset $dataset diff --git a/src/Events/Failure.php b/src/Events/Failure.php index 4120982..de6eb50 100644 --- a/src/Events/Failure.php +++ b/src/Events/Failure.php @@ -18,7 +18,7 @@ abstract class Failure implements Event * * @var \Exception */ - protected $exception; + protected \Exception $exception; /** * @param \Exception $exception diff --git a/src/Events/MemoryUsageUpdated.php b/src/Events/MemoryUsageUpdated.php index 128615a..3e61941 100644 --- a/src/Events/MemoryUsageUpdated.php +++ b/src/Events/MemoryUsageUpdated.php @@ -18,7 +18,7 @@ class MemoryUsageUpdated implements Event * * @var \Rubix\Server\Models\Memory */ - protected $memory; + protected \Rubix\Server\Models\Memory $memory; /** * @param \Rubix\Server\Models\Memory $memory diff --git a/src/Events/RequestReceived.php b/src/Events/RequestReceived.php index 56b4f4f..dcb2e22 100644 --- a/src/Events/RequestReceived.php +++ b/src/Events/RequestReceived.php @@ -18,7 +18,7 @@ class RequestReceived implements Event * * @var \Psr\Http\Message\ServerRequestInterface */ - protected $request; + protected \Psr\Http\Message\ServerRequestInterface $request; /** * @param \Psr\Http\Message\ServerRequestInterface $request diff --git a/src/Events/ResponseSent.php b/src/Events/ResponseSent.php index ad0ebb5..7760152 100644 --- a/src/Events/ResponseSent.php +++ b/src/Events/ResponseSent.php @@ -18,7 +18,7 @@ class ResponseSent implements Event * * @var \Psr\Http\Message\ResponseInterface */ - protected $response; + protected \Psr\Http\Message\ResponseInterface $response; /** * @param \Psr\Http\Message\ResponseInterface $response diff --git a/src/GraphQL/Enums/DataTypeEnum.php b/src/GraphQL/Enums/DataTypeEnum.php index 6dc669d..8a31401 100644 --- a/src/GraphQL/Enums/DataTypeEnum.php +++ b/src/GraphQL/Enums/DataTypeEnum.php @@ -11,7 +11,7 @@ class DataTypeEnum extends EnumType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Enums/EstimatorTypeEnum.php b/src/GraphQL/Enums/EstimatorTypeEnum.php index 0340da0..b97f4d4 100644 --- a/src/GraphQL/Enums/EstimatorTypeEnum.php +++ b/src/GraphQL/Enums/EstimatorTypeEnum.php @@ -11,7 +11,7 @@ class EstimatorTypeEnum extends EnumType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/InputObjects/DatasetInputObject.php b/src/GraphQL/InputObjects/DatasetInputObject.php index 99038e0..ea37674 100644 --- a/src/GraphQL/InputObjects/DatasetInputObject.php +++ b/src/GraphQL/InputObjects/DatasetInputObject.php @@ -12,7 +12,7 @@ class DatasetInputObject extends InputObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/EstimatorInterfacesObject.php b/src/GraphQL/Objects/EstimatorInterfacesObject.php index b0c16b1..bbb8786 100644 --- a/src/GraphQL/Objects/EstimatorInterfacesObject.php +++ b/src/GraphQL/Objects/EstimatorInterfacesObject.php @@ -12,7 +12,7 @@ class EstimatorInterfacesObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/HTTPStatsObject.php b/src/GraphQL/Objects/HTTPStatsObject.php index bfb59d2..337b8a7 100644 --- a/src/GraphQL/Objects/HTTPStatsObject.php +++ b/src/GraphQL/Objects/HTTPStatsObject.php @@ -12,7 +12,7 @@ class HTTPStatsObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/HyperparameterObject.php b/src/GraphQL/Objects/HyperparameterObject.php index 1337ac0..e8f6494 100644 --- a/src/GraphQL/Objects/HyperparameterObject.php +++ b/src/GraphQL/Objects/HyperparameterObject.php @@ -11,7 +11,7 @@ class HyperparameterObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/MemoryObject.php b/src/GraphQL/Objects/MemoryObject.php index 5fe323c..3f2bd59 100644 --- a/src/GraphQL/Objects/MemoryObject.php +++ b/src/GraphQL/Objects/MemoryObject.php @@ -13,7 +13,7 @@ class MemoryObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/ModelObject.php b/src/GraphQL/Objects/ModelObject.php index 01820c5..e4e5412 100644 --- a/src/GraphQL/Objects/ModelObject.php +++ b/src/GraphQL/Objects/ModelObject.php @@ -20,7 +20,7 @@ class ModelObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/ProbabilityObject.php b/src/GraphQL/Objects/ProbabilityObject.php index 4d3c3c6..ab83d16 100644 --- a/src/GraphQL/Objects/ProbabilityObject.php +++ b/src/GraphQL/Objects/ProbabilityObject.php @@ -11,7 +11,7 @@ class ProbabilityObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/ProcessInfoObject.php b/src/GraphQL/Objects/ProcessInfoObject.php index 0062e86..e01db5f 100644 --- a/src/GraphQL/Objects/ProcessInfoObject.php +++ b/src/GraphQL/Objects/ProcessInfoObject.php @@ -12,7 +12,7 @@ class ProcessInfoObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/RequestsObject.php b/src/GraphQL/Objects/RequestsObject.php index 4e892dd..c855d52 100644 --- a/src/GraphQL/Objects/RequestsObject.php +++ b/src/GraphQL/Objects/RequestsObject.php @@ -13,7 +13,7 @@ class RequestsObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/ServerObject.php b/src/GraphQL/Objects/ServerObject.php index d70095a..9fd6c7f 100644 --- a/src/GraphQL/Objects/ServerObject.php +++ b/src/GraphQL/Objects/ServerObject.php @@ -16,7 +16,7 @@ class ServerObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/ServerSettingsObject.php b/src/GraphQL/Objects/ServerSettingsObject.php index 128e9d2..76309f2 100644 --- a/src/GraphQL/Objects/ServerSettingsObject.php +++ b/src/GraphQL/Objects/ServerSettingsObject.php @@ -13,7 +13,7 @@ class ServerSettingsObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/GraphQL/Objects/TransfersObject.php b/src/GraphQL/Objects/TransfersObject.php index 3921039..8083ab7 100644 --- a/src/GraphQL/Objects/TransfersObject.php +++ b/src/GraphQL/Objects/TransfersObject.php @@ -13,7 +13,7 @@ class TransfersObject extends ObjectType * * @var self|null */ - protected static $instance; + protected static ?self $instance = null; /** * @return self diff --git a/src/HTTP/Controllers/DashboardController.php b/src/HTTP/Controllers/DashboardController.php index a4ef0ce..a86512a 100644 --- a/src/HTTP/Controllers/DashboardController.php +++ b/src/HTTP/Controllers/DashboardController.php @@ -14,7 +14,7 @@ class DashboardController extends JSONController * * @var \Rubix\Server\Services\SSEChannel */ - protected $channel; + protected \Rubix\Server\Services\SSEChannel $channel; /** * @param \Rubix\Server\Services\SSEChannel $channel diff --git a/src/HTTP/Controllers/GraphQLController.php b/src/HTTP/Controllers/GraphQLController.php index 2d0ae2f..7f43a43 100644 --- a/src/HTTP/Controllers/GraphQLController.php +++ b/src/HTTP/Controllers/GraphQLController.php @@ -20,14 +20,14 @@ class GraphQLController extends JSONController * * @var \Rubix\Server\GraphQL\Schema */ - protected $schema; + protected \Rubix\Server\GraphQL\Schema $schema; /** * The promise adapter. * * @var \GraphQL\Executor\Promise\PromiseAdapter */ - protected $adapter; + protected \GraphQL\Executor\Promise\PromiseAdapter $adapter; /** * @param \Rubix\Server\GraphQL\Schema $schema diff --git a/src/HTTP/Controllers/ModelController.php b/src/HTTP/Controllers/ModelController.php index 7a3b1ee..c92faec 100644 --- a/src/HTTP/Controllers/ModelController.php +++ b/src/HTTP/Controllers/ModelController.php @@ -19,7 +19,7 @@ class ModelController extends JSONController * * @var \Rubix\Server\Models\Model */ - protected $model; + protected \Rubix\Server\Models\Model $model; /** * @param \Rubix\Server\Models\Model $model diff --git a/src/HTTP/Controllers/ServerController.php b/src/HTTP/Controllers/ServerController.php index 2cc221c..b1bb84b 100644 --- a/src/HTTP/Controllers/ServerController.php +++ b/src/HTTP/Controllers/ServerController.php @@ -14,7 +14,7 @@ class ServerController extends JSONController * * @var \Rubix\Server\Models\Server */ - protected $server; + protected \Rubix\Server\Models\Server $server; /** * @param \Rubix\Server\Models\Server $server diff --git a/src/HTTP/Controllers/StaticAssetsController.php b/src/HTTP/Controllers/StaticAssetsController.php index cf0c510..98e2c80 100644 --- a/src/HTTP/Controllers/StaticAssetsController.php +++ b/src/HTTP/Controllers/StaticAssetsController.php @@ -31,14 +31,14 @@ class StaticAssetsController extends Controller * * @var string */ - protected $basePath; + protected string $basePath; /** * The cache. * * @var \Rubix\Server\Services\Caches\Cache */ - protected $cache; + protected \Rubix\Server\Services\Caches\Cache $cache; /** * @param string $basePath diff --git a/src/HTTP/Middleware/Client/BackoffAndRetry.php b/src/HTTP/Middleware/Client/BackoffAndRetry.php index 338a3a0..1c59539 100644 --- a/src/HTTP/Middleware/Client/BackoffAndRetry.php +++ b/src/HTTP/Middleware/Client/BackoffAndRetry.php @@ -39,14 +39,14 @@ class BackoffAndRetry implements Middleware * * @var int */ - protected $maxRetries; + protected int $maxRetries; /** * The number of seconds to delay between retries before exponential backoff is applied. * * @var float */ - protected $initialDelay; + protected float $initialDelay; /** * @param int $maxRetries diff --git a/src/HTTP/Middleware/Client/BasicAuthenticator.php b/src/HTTP/Middleware/Client/BasicAuthenticator.php index b3e46d5..8aa74ca 100644 --- a/src/HTTP/Middleware/Client/BasicAuthenticator.php +++ b/src/HTTP/Middleware/Client/BasicAuthenticator.php @@ -21,7 +21,7 @@ class BasicAuthenticator implements Middleware * * @var string */ - protected $credentials; + protected string $credentials; /** * @param string $username diff --git a/src/HTTP/Middleware/Client/CompressRequestBody.php b/src/HTTP/Middleware/Client/CompressRequestBody.php index 31ed065..b659067 100644 --- a/src/HTTP/Middleware/Client/CompressRequestBody.php +++ b/src/HTTP/Middleware/Client/CompressRequestBody.php @@ -30,14 +30,14 @@ class CompressRequestBody implements Middleware * * @var int */ - protected $level; + protected int $level; /** * The minimum size of the request body in bytes in order to be compressed. * * @var int */ - protected $threshold; + protected int $threshold; /** * @param int $level diff --git a/src/HTTP/Middleware/Internal/AttachServerHeaders.php b/src/HTTP/Middleware/Internal/AttachServerHeaders.php index b9ccc48..b7cbdd8 100644 --- a/src/HTTP/Middleware/Internal/AttachServerHeaders.php +++ b/src/HTTP/Middleware/Internal/AttachServerHeaders.php @@ -15,7 +15,7 @@ class AttachServerHeaders * * @var string */ - protected $serverName; + protected string $serverName; /** * @param string $serverName diff --git a/src/HTTP/Middleware/Internal/CatchServerErrors.php b/src/HTTP/Middleware/Internal/CatchServerErrors.php index 3b64181..df8317f 100644 --- a/src/HTTP/Middleware/Internal/CatchServerErrors.php +++ b/src/HTTP/Middleware/Internal/CatchServerErrors.php @@ -18,7 +18,7 @@ class CatchServerErrors * * @var \Rubix\Server\Services\EventBus */ - protected $eventBus; + protected \Rubix\Server\Services\EventBus $eventBus; /** * @param \Rubix\Server\Services\EventBus $eventBus diff --git a/src/HTTP/Middleware/Internal/CheckRequestBodySize.php b/src/HTTP/Middleware/Internal/CheckRequestBodySize.php index ed75279..8d16e8f 100644 --- a/src/HTTP/Middleware/Internal/CheckRequestBodySize.php +++ b/src/HTTP/Middleware/Internal/CheckRequestBodySize.php @@ -12,7 +12,7 @@ class CheckRequestBodySize * * @var int */ - protected $postMaxSize; + protected int $postMaxSize; /** * @param int $postMaxSize diff --git a/src/HTTP/Middleware/Internal/CircuitBreaker.php b/src/HTTP/Middleware/Internal/CircuitBreaker.php index c27def6..da7aed8 100644 --- a/src/HTTP/Middleware/Internal/CircuitBreaker.php +++ b/src/HTTP/Middleware/Internal/CircuitBreaker.php @@ -13,7 +13,7 @@ class CircuitBreaker * * @var \Rubix\Server\Models\Server */ - protected $server; + protected \Rubix\Server\Models\Server $server; /** * @param \Rubix\Server\Models\Server $server diff --git a/src/HTTP/Middleware/Internal/DispatchEvents.php b/src/HTTP/Middleware/Internal/DispatchEvents.php index e2b4959..b8e0baa 100644 --- a/src/HTTP/Middleware/Internal/DispatchEvents.php +++ b/src/HTTP/Middleware/Internal/DispatchEvents.php @@ -18,7 +18,7 @@ class DispatchEvents * * @var \Rubix\Server\Services\EventBus */ - protected $eventBus; + protected \Rubix\Server\Services\EventBus $eventBus; /** * @param \Rubix\Server\Services\EventBus $eventBus diff --git a/src/HTTP/Middleware/Server/AccessLogGenerator.php b/src/HTTP/Middleware/Server/AccessLogGenerator.php index 2b2177e..b04fd7a 100644 --- a/src/HTTP/Middleware/Server/AccessLogGenerator.php +++ b/src/HTTP/Middleware/Server/AccessLogGenerator.php @@ -26,7 +26,7 @@ class AccessLogGenerator implements Middleware * * @var \Psr\Log\LoggerInterface */ - protected $logger; + protected \Psr\Log\LoggerInterface $logger; /** * @param \Psr\Log\LoggerInterface $logger diff --git a/src/HTTP/Middleware/Server/BasicAuthenticator.php b/src/HTTP/Middleware/Server/BasicAuthenticator.php index 2e13e8b..85d9f74 100644 --- a/src/HTTP/Middleware/Server/BasicAuthenticator.php +++ b/src/HTTP/Middleware/Server/BasicAuthenticator.php @@ -37,14 +37,14 @@ class BasicAuthenticator implements Middleware * * @var string[] */ - protected $passwords; + protected array $passwords; /** * The unique name given to the scope of permissions required for this server. * * @var string */ - protected $realm; + protected string $realm; /** * @param string[] $passwords diff --git a/src/HTTP/Middleware/Server/SharedTokenAuthenticator.php b/src/HTTP/Middleware/Server/SharedTokenAuthenticator.php index 76c3313..02100b9 100644 --- a/src/HTTP/Middleware/Server/SharedTokenAuthenticator.php +++ b/src/HTTP/Middleware/Server/SharedTokenAuthenticator.php @@ -31,14 +31,14 @@ class SharedTokenAuthenticator implements Middleware * * @var (int|string)[] */ - protected $tokens; + protected array $tokens; /** * The unique name given to the scope of permissions required for this server. * * @var string */ - protected $realm; + protected string $realm; /** * @param string[] $tokens diff --git a/src/HTTP/Middleware/Server/TrustedClients.php b/src/HTTP/Middleware/Server/TrustedClients.php index 421e5b2..87912a2 100644 --- a/src/HTTP/Middleware/Server/TrustedClients.php +++ b/src/HTTP/Middleware/Server/TrustedClients.php @@ -24,7 +24,7 @@ class TrustedClients implements Middleware * * @var (int|string)[] */ - protected $ips; + protected array $ips; /** * @param string[] $ips diff --git a/src/HTTPServer.php b/src/HTTPServer.php index a140d19..e81de8c 100644 --- a/src/HTTPServer.php +++ b/src/HTTPServer.php @@ -78,84 +78,84 @@ class HTTPServer implements Server, Verbose * * @var string */ - protected $host; + protected string $host; /** * The transmission control protocol (TCP) port to run the HTTP services on. * * @var int */ - protected $port; + protected int $port; /** * The path to the certificate used to authenticate and encrypt the secure (HTTPS) channel. * * @var string|null */ - protected $cert; + protected ?string $cert; /** * The HTTP middleware stack. * * @var \Rubix\Server\HTTP\Middleware\Server\Middleware[] */ - protected $middlewares; + protected array $middlewares; /** * The maximum number of requests that can be handled concurrently. * * @var int */ - protected $maxConcurrentRequests; + protected int $maxConcurrentRequests; /** * The cache used to serve static asset requests. * * @var \Rubix\Server\Services\Caches\Cache */ - protected $staticAssetsCache; + protected \Rubix\Server\Services\Caches\Cache $staticAssetsCache; /** * The maximum number of events to store in the server-sent events (SSE) reconnect buffer. * * @var int */ - protected $sseReconnectBuffer; + protected int $sseReconnectBuffer; /** * The maximum number of bytes that the server can consume. * * @var int */ - protected $memoryLimit; + protected int $memoryLimit; /** * The maximum size of a request body in bytes. * * @var int */ - protected $postMaxSize; + protected int $postMaxSize; /** * A PSR-3 logger instance. * * @var \Psr\Log\LoggerInterface */ - protected $logger; + protected \Psr\Log\LoggerInterface $logger; /** * The event bus. * * @var \Rubix\Server\Services\EventBus */ - protected $eventBus; + protected \Rubix\Server\Services\EventBus $eventBus; /** * The event loop. * * @var \React\EventLoop\LoopInterface */ - protected $loop; + protected \React\EventLoop\LoopInterface $loop; /** * @param string $host diff --git a/src/Jobs/EvictCacheItems.php b/src/Jobs/EvictCacheItems.php index 14089b9..063ce5f 100644 --- a/src/Jobs/EvictCacheItems.php +++ b/src/Jobs/EvictCacheItems.php @@ -11,7 +11,7 @@ class EvictCacheItems implements Job * * @var \Rubix\Server\Services\Caches\Cache */ - protected $cache; + protected \Rubix\Server\Services\Caches\Cache $cache; /** * @param \Rubix\Server\Services\Caches\Cache $cache diff --git a/src/Jobs/HandleEvent.php b/src/Jobs/HandleEvent.php index 90184b8..b385da8 100644 --- a/src/Jobs/HandleEvent.php +++ b/src/Jobs/HandleEvent.php @@ -22,14 +22,14 @@ class HandleEvent implements Job * * @var \Rubix\Server\Events\Event */ - protected $event; + protected \Rubix\Server\Events\Event $event; /** * A logger instance. * * @var \Psr\Log\LoggerInterface */ - protected $logger; + protected \Psr\Log\LoggerInterface $logger; /** * @param callable $handler diff --git a/src/Jobs/UpdateMemoryUsage.php b/src/Jobs/UpdateMemoryUsage.php index fe6eed2..01b6e56 100644 --- a/src/Jobs/UpdateMemoryUsage.php +++ b/src/Jobs/UpdateMemoryUsage.php @@ -11,7 +11,7 @@ class UpdateMemoryUsage implements Job * * @var \Rubix\Server\Models\Memory */ - protected $memory; + protected \Rubix\Server\Models\Memory $memory; /** * @param \Rubix\Server\Models\Memory $memory diff --git a/src/Listeners/CloseSSEChannels.php b/src/Listeners/CloseSSEChannels.php index fecf9e4..8171e40 100644 --- a/src/Listeners/CloseSSEChannels.php +++ b/src/Listeners/CloseSSEChannels.php @@ -11,7 +11,7 @@ class CloseSSEChannels implements Listener * * @var \Rubix\Server\Services\SSEChannel[] */ - protected $channels; + protected array $channels; /** * @param \Rubix\Server\Services\SSEChannel[] $channels diff --git a/src/Listeners/CloseSocket.php b/src/Listeners/CloseSocket.php index add28d4..03d2a25 100644 --- a/src/Listeners/CloseSocket.php +++ b/src/Listeners/CloseSocket.php @@ -12,7 +12,7 @@ class CloseSocket implements Listener * * @var \React\Socket\ServerInterface */ - protected $socket; + protected \React\Socket\ServerInterface $socket; /** * @param \React\Socket\ServerInterface $socket diff --git a/src/Listeners/DashboardEmitter.php b/src/Listeners/DashboardEmitter.php index e5b95f4..e54d5d7 100644 --- a/src/Listeners/DashboardEmitter.php +++ b/src/Listeners/DashboardEmitter.php @@ -15,7 +15,7 @@ class DashboardEmitter implements Listener * * @var \Rubix\Server\Services\SSEChannel */ - protected $channel; + protected \Rubix\Server\Services\SSEChannel $channel; /** * @param \Rubix\Server\Services\SSEChannel $channel diff --git a/src/Listeners/LogFailures.php b/src/Listeners/LogFailures.php index ede90a5..415c9bc 100644 --- a/src/Listeners/LogFailures.php +++ b/src/Listeners/LogFailures.php @@ -13,7 +13,7 @@ class LogFailures implements Listener * * @var \Psr\Log\LoggerInterface */ - protected $logger; + protected \Psr\Log\LoggerInterface $logger; /** * @param \Psr\Log\LoggerInterface $logger diff --git a/src/Listeners/RecordHTTPStats.php b/src/Listeners/RecordHTTPStats.php index a363bcb..d98179e 100644 --- a/src/Listeners/RecordHTTPStats.php +++ b/src/Listeners/RecordHTTPStats.php @@ -13,7 +13,7 @@ class RecordHTTPStats implements Listener * * @var \Rubix\Server\Models\HTTPStats */ - protected $httpStats; + protected \Rubix\Server\Models\HTTPStats $httpStats; /** * @param \Rubix\Server\Models\HTTPStats $httpStats diff --git a/src/Listeners/StopTimers.php b/src/Listeners/StopTimers.php index 5afa9d3..3790b33 100644 --- a/src/Listeners/StopTimers.php +++ b/src/Listeners/StopTimers.php @@ -12,7 +12,7 @@ class StopTimers implements Listener * * @var \Rubix\Server\Services\Scheduler */ - protected $scheduler; + protected \Rubix\Server\Services\Scheduler $scheduler; /** * The timers. diff --git a/src/Loggers/File.php b/src/Loggers/File.php index 707a406..6a9e8a3 100644 --- a/src/Loggers/File.php +++ b/src/Loggers/File.php @@ -28,14 +28,14 @@ class File extends Logger * * @var string */ - protected $channel; + protected string $channel; /** * The format of the timestamp. * * @var string */ - protected $timestampFormat; + protected string $timestampFormat; /** * @param string $path diff --git a/src/Models/HTTPStats.php b/src/Models/HTTPStats.php index 160c7df..e0a4113 100644 --- a/src/Models/HTTPStats.php +++ b/src/Models/HTTPStats.php @@ -12,35 +12,35 @@ class HTTPStats * * @var int */ - protected $numSuccessful = 0; + protected int $numSuccessful = 0; /** * The number of rejected requests. * * @var int */ - protected $numRejected = 0; + protected int $numRejected = 0; /** * The number of failed requests. * * @var int */ - protected $numFailed = 0; + protected int $numFailed = 0; /** * The number of bytes that have been received by the server. * * @var int */ - protected $bytesReceived = 0; + protected int $bytesReceived = 0; /** * The number of bytes that have been sent by the server. * * @var int */ - protected $bytesSent = 0; + protected int $bytesSent = 0; /** * Record an HTTP request. diff --git a/src/Models/Memory.php b/src/Models/Memory.php index 0065944..780c09b 100644 --- a/src/Models/Memory.php +++ b/src/Models/Memory.php @@ -15,7 +15,7 @@ class Memory * * @var \Rubix\Server\Services\EventBus */ - protected $eventBus; + protected \Rubix\Server\Services\EventBus $eventBus; /** * @param \Rubix\Server\Services\EventBus $eventBus diff --git a/src/Models/Model.php b/src/Models/Model.php index 600bfa8..6b80cba 100644 --- a/src/Models/Model.php +++ b/src/Models/Model.php @@ -22,21 +22,21 @@ class Model * * @var \Rubix\ML\Estimator */ - protected $estimator; + protected \Rubix\ML\Estimator $estimator; /** * The event bus. * * @var \Rubix\Server\Services\EventBus */ - protected $eventBus; + protected \Rubix\Server\Services\EventBus $eventBus; /** * The number of samples that have been predicted so far. * * @var int */ - protected $numSamplesInferred = 0; + protected int $numSamplesInferred = 0; /** * @param \Rubix\ML\Estimator $estimator diff --git a/src/Models/ProcessInfo.php b/src/Models/ProcessInfo.php index 30e622c..ab1abc6 100644 --- a/src/Models/ProcessInfo.php +++ b/src/Models/ProcessInfo.php @@ -9,14 +9,14 @@ class ProcessInfo * * @var int */ - protected $start; + protected int $start; /** * The process ID (PID) of the server. * * @var int|null */ - protected $pid; + protected ?int $pid; public function __construct() { diff --git a/src/Models/Server.php b/src/Models/Server.php index bfbccc7..3b7f742 100644 --- a/src/Models/Server.php +++ b/src/Models/Server.php @@ -12,28 +12,28 @@ class Server * * @var \Rubix\Server\Models\HTTPStats */ - protected $httpStats; + protected \Rubix\Server\Models\HTTPStats $httpStats; /** * The memory model. * * @var \Rubix\Server\Models\Memory */ - protected $memory; + protected \Rubix\Server\Models\Memory $memory; /** * The server info model. * * @var \Rubix\Server\Models\ProcessInfo */ - protected $info; + protected \Rubix\Server\Models\ProcessInfo $info; /** * The server settings. * * @var \Rubix\Server\Models\ServerSettings */ - protected $settings; + protected \Rubix\Server\Models\ServerSettings $settings; /** * @param \Rubix\Server\HTTPServer $server diff --git a/src/Models/ServerSettings.php b/src/Models/ServerSettings.php index 6bccbfe..6686c2e 100644 --- a/src/Models/ServerSettings.php +++ b/src/Models/ServerSettings.php @@ -11,7 +11,7 @@ class ServerSettings * * @var \Rubix\Server\HTTPServer */ - protected $server; + protected \Rubix\Server\HTTPServer $server; /** * @param \Rubix\Server\HTTPServer $server diff --git a/src/RESTClient.php b/src/RESTClient.php index cab14e1..7ccf676 100644 --- a/src/RESTClient.php +++ b/src/RESTClient.php @@ -44,7 +44,7 @@ class RESTClient implements Client, AsyncClient * * @var \GuzzleHttp\Client */ - protected $client; + protected \GuzzleHttp\Client $client; /** * @param string $host diff --git a/src/Services/Caches/CacheItem.php b/src/Services/Caches/CacheItem.php index 83dbc8c..869b891 100644 --- a/src/Services/Caches/CacheItem.php +++ b/src/Services/Caches/CacheItem.php @@ -16,14 +16,14 @@ class CacheItem * * @var int */ - protected $expiresAfter; + protected int $expiresAfter; /** * The timestamp of the last time the item was accessed. * * @var int */ - protected $accessedAt; + protected int $accessedAt; /** * @param mixed $data diff --git a/src/Services/Caches/InMemoryCache.php b/src/Services/Caches/InMemoryCache.php index a42678f..8525f49 100644 --- a/src/Services/Caches/InMemoryCache.php +++ b/src/Services/Caches/InMemoryCache.php @@ -12,14 +12,14 @@ class InMemoryCache implements Cache * * @var int */ - protected $expiresAfter; + protected int $expiresAfter; /** * The item store. * * @var \Rubix\Server\Services\Caches\CacheItem[] */ - protected $store = [ + protected array $store = [ // ]; diff --git a/src/Services/EventBus.php b/src/Services/EventBus.php index 3a8a424..e3f16bc 100644 --- a/src/Services/EventBus.php +++ b/src/Services/EventBus.php @@ -22,21 +22,21 @@ class EventBus * * @var \Rubix\Server\Services\Scheduler */ - protected $scheduler; + protected \Rubix\Server\Services\Scheduler $scheduler; /** * A PSR-3 logger instance. * * @var \Psr\Log\LoggerInterface */ - protected $logger; + protected \Psr\Log\LoggerInterface $logger; /** * The mapping of events to their listeners. * * @var \Rubix\Server\Services\Subscriptions|null */ - protected $subscriptions; + protected ?\Rubix\Server\Services\Subscriptions $subscriptions; /** * @param \Rubix\Server\Services\Scheduler $scheduler diff --git a/src/Services/Router.php b/src/Services/Router.php index 8974efa..0211b45 100644 --- a/src/Services/Router.php +++ b/src/Services/Router.php @@ -17,7 +17,7 @@ class Router * * @var \Rubix\Server\Services\Routes */ - protected $routes; + protected \Rubix\Server\Services\Routes $routes; /** * @param \Rubix\Server\Services\Routes $routes diff --git a/src/Services/Routes.php b/src/Services/Routes.php index 40f05fc..4d5a54b 100644 --- a/src/Services/Routes.php +++ b/src/Services/Routes.php @@ -28,7 +28,7 @@ class Routes implements ArrayAccess * * @var array[] */ - protected $routes; + protected array $routes; /** * Collect the routes from an array of controllers. diff --git a/src/Services/SSEChannel.php b/src/Services/SSEChannel.php index e074315..86aff31 100644 --- a/src/Services/SSEChannel.php +++ b/src/Services/SSEChannel.php @@ -16,28 +16,28 @@ class SSEChannel * * @var int */ - protected $bufferSize; + protected int $bufferSize; /** * The current open response body streams. * * @var \SplObjectStorage */ - protected $streams; + protected \SplObjectStorage $streams; /** * A counter used to identify individual events. * * @var int */ - protected $id = 1; + protected int $id = 1; /** * The reconnect buffer. * * @var string[] */ - protected $buffer = [ + protected array $buffer = [ // ]; diff --git a/src/Services/Scheduler.php b/src/Services/Scheduler.php index bc11e87..42ffcbe 100644 --- a/src/Services/Scheduler.php +++ b/src/Services/Scheduler.php @@ -13,7 +13,7 @@ class Scheduler * * @var \React\EventLoop\LoopInterface */ - protected $loop; + protected \React\EventLoop\LoopInterface $loop; /** * @param \React\EventLoop\LoopInterface $loop diff --git a/src/Services/Subscriptions.php b/src/Services/Subscriptions.php index be35ee9..b5438a4 100644 --- a/src/Services/Subscriptions.php +++ b/src/Services/Subscriptions.php @@ -20,7 +20,7 @@ class Subscriptions implements ArrayAccess * * @var array[] */ - protected $subscriptions; + protected array $subscriptions; /** * Subscribe an array of listeners to their events.