Skip to content

Commit

Permalink
Appease Stan
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdalpino committed Sep 19, 2023
1 parent ad232bf commit 354012b
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 25 deletions.
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan": "0.12.*",
"phpstan/phpstan": "^1.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan-phpunit": "0.12.*",
"phpunit/phpunit": "8.5.*"
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -69,7 +69,10 @@
},
"config": {
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"funding": [
{
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ parameters:
paths:
- 'src'
- 'tests'
checkGenericClassInNonGenericObjectType: false
2 changes: 1 addition & 1 deletion src/HTTP/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ abstract class Controller
/**
* Return the routes this controller handles.
*
* @return array[]
* @return array<mixed>
*/
abstract public function routes() : array;
}
2 changes: 1 addition & 1 deletion src/HTTP/Controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(SSEChannel $channel)
/**
* Return the routes this controller handles.
*
* @return array[]
* @return array<mixed>
*/
public function routes() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/HTTP/Controllers/GraphQLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(Schema $schema, PromiseAdapter $adapter)
/**
* Return the routes this controller handles.
*
* @return array[]
* @return array<mixed>
*/
public function routes() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/HTTP/Controllers/ModelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(Model $model)
/**
* Return the routes this controller handles.
*
* @return array[]
* @return array<mixed>
*/
public function routes() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/HTTP/Controllers/ServerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(Server $server)
/**
* Return the routes this controller handles.
*
* @return array[]
* @return array<mixed>
*/
public function routes() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/HTTP/Controllers/StaticAssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct(string $basePath, Cache $cache)
/**
* Return the routes this controller handles.
*
* @return array[]
* @return array<mixed>
*/
public function routes() : array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers/JSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class JSON
*
* @param mixed $value
* @param int $options
* @param int $depth
* @param positive-int $depth
* @throws \Rubix\Server\Exceptions\JSONException
* @return string
*/
Expand All @@ -56,7 +56,7 @@ public static function encode($value, int $options = self::DEFAULT_OPTIONS, int
*
* @param string $data
* @param int $options
* @param int $depth
* @param positive-int $depth
* @throws \Rubix\Server\Exceptions\JSONException
* @return mixed[]
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/CloseSSEChannels.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(array $channels)
/**
* Return the events that this listener subscribes to.
*
* @return array[]
* @return array<array<\Rubix\Server\Listeners\Listener>>
*/
public function events() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/CloseSocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(Socket $socket)
/**
* Return the events that this listener subscribes to.
*
* @return array[]
* @return array<array<\Rubix\Server\Listeners\Listener>>
*/
public function events() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/DashboardEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(SSEChannel $channel)
/**
* Return the events that this listener subscribes to.
*
* @return array[]
* @return array<array<\Rubix\Server\Listeners\Listener|callable>>
*/
public function events() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Listener
/**
* Return the events that this listener subscribes to and their handlers.
*
* @return array[]
* @return array<array<\Rubix\Server\Listeners\Listener|callable>>
*/
public function events() : array;
}
2 changes: 1 addition & 1 deletion src/Listeners/LogFailures.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(LoggerInterface $logger)
/**
* Return the events that this listener subscribes to.
*
* @return array[]
* @return array<array<\Rubix\Server\Listeners\Listener>>
*/
public function events() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/RecordHTTPStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(HTTPStats $httpStats)
/**
* Return the events that this listener subscribes to.
*
* @return array[]
* @return array<array<\Rubix\Server\Listeners\Listener|callable>>
*/
public function events() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/StopTimers.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(Scheduler $scheduler, array $timers)
/**
* Return the events that this listener subscribes to.
*
* @return array[]
* @return array<array<\Rubix\Server\Listeners\Listener>>
*/
public function events() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function predict(Dataset $dataset) : array
*
* @param \Rubix\ML\Datasets\Dataset $dataset
* @throws \Rubix\Server\Exceptions\RuntimeException
* @return array[]
* @return array<array<float>>
*/
public function proba(Dataset $dataset) : array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Services/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Routes implements ArrayAccess
/**
* The routes and their controllers.
*
* @var array[]
* @var array<array<\Rubix\Server\HTTP\Controllers\Controller>>
*/
protected array $routes;

Expand Down Expand Up @@ -70,7 +70,7 @@ public static function collect(array $controllers) : self
}

/**
* @param array[] $routes
* @param array<array<\Rubix\Server\HTTP\Controllers\Controller>> $routes
* @throws \Rubix\Server\Exceptions\InvalidArgumentException
*/
public function __construct(array $routes)
Expand Down
6 changes: 3 additions & 3 deletions src/Services/Subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class Subscriptions implements ArrayAccess
/**
* The mapping of events to their handlers.
*
* @var array[]
* @var array<array<\Rubix\Server\Listeners\Listener|callable>>
*/
protected array $subscriptions;

/**
* Subscribe an array of listeners to their events.
*
* @param \Rubix\Server\Listeners\Listener[] $listeners
* @param array<\Rubix\Server\Listeners\Listener|callable> $listeners
* @throws \InvalidArgumentException
* @return self
*/
Expand All @@ -50,7 +50,7 @@ public static function subscribe(array $listeners) : self
}

/**
* @param array[] $subscriptions
* @param array<array<\Rubix\Server\Listeners\Listener|callable>> $subscriptions
* @throws \Rubix\Server\Exceptions\InvalidArgumentException
*/
public function __construct(array $subscriptions)
Expand Down

0 comments on commit 354012b

Please sign in to comment.