Skip to content
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 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
},
"require-dev": {
"vimeo/psalm": "~5.6",
"innmind/static-analysis": "^1.2.1",
"innmind/black-box": "~6.5",
"innmind/coding-standard": "~2.0",
"innmind/async-http-server": "~2.0|~3.0"
Expand Down
10 changes: 10 additions & 0 deletions src/Application/Async/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public static function of(OperatingSystem $os): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapEnvironment(callable $map): self
{
$previous = $this->map;
Expand All @@ -120,6 +121,7 @@ static function(OperatingSystem $os, Environment $env) use ($previous, $map): ar
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapOperatingSystem(callable $map): self
{
$previous = $this->map;
Expand All @@ -142,6 +144,7 @@ static function(OperatingSystem $os, Environment $env) use ($previous, $map): ar
/**
* @psalm-mutation-free
*/
#[\Override]
public function service(string|Service $name, callable $definition): self
{
$container = $this->container;
Expand All @@ -162,6 +165,7 @@ public function service(string|Service $name, callable $definition): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function command(callable $command): self
{
return $this;
Expand All @@ -170,6 +174,7 @@ public function command(callable $command): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapCommand(callable $map): self
{
return $this;
Expand All @@ -178,6 +183,7 @@ public function mapCommand(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function route(string $pattern, callable $handle): self
{
return $this->appendRoutes(
Expand All @@ -196,6 +202,7 @@ public function route(string $pattern, callable $handle): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function appendRoutes(callable $append): self
{
return new self(
Expand All @@ -211,6 +218,7 @@ public function appendRoutes(callable $append): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapRequestHandler(callable $map): self
{
$previous = $this->mapRequestHandler;
Expand Down Expand Up @@ -238,6 +246,7 @@ public function mapRequestHandler(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function notFoundRequestHandler(callable $handle): self
{
return new self(
Expand All @@ -250,6 +259,7 @@ public function notFoundRequestHandler(callable $handle): self
);
}

#[\Override]
public function run($input)
{
$map = $this->map;
Expand Down
10 changes: 10 additions & 0 deletions src/Application/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public static function of(OperatingSystem $os, Environment $env): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapEnvironment(callable $map): self
{
/** @psalm-suppress ImpureFunctionCall Mutation free to force the user to use the returned object */
Expand All @@ -92,6 +93,7 @@ public function mapEnvironment(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapOperatingSystem(callable $map): self
{
/** @psalm-suppress ImpureFunctionCall Mutation free to force the user to use the returned object */
Expand All @@ -107,6 +109,7 @@ public function mapOperatingSystem(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function service(string|Service $name, callable $definition): self
{
$container = $this->container;
Expand All @@ -126,6 +129,7 @@ public function service(string|Service $name, callable $definition): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function command(callable $command): self
{
/** @psalm-suppress ImpureMethodCall Mutation free to force the user to use the returned object */
Expand All @@ -144,6 +148,7 @@ public function command(callable $command): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapCommand(callable $map): self
{
$previous = $this->mapCommand;
Expand All @@ -170,6 +175,7 @@ public function mapCommand(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function route(string $pattern, callable $handle): self
{
return $this;
Expand All @@ -178,6 +184,7 @@ public function route(string $pattern, callable $handle): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function appendRoutes(callable $append): self
{
return $this;
Expand All @@ -186,6 +193,7 @@ public function appendRoutes(callable $append): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapRequestHandler(callable $map): self
{
return $this;
Expand All @@ -194,11 +202,13 @@ public function mapRequestHandler(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function notFoundRequestHandler(callable $handle): self
{
return $this;
}

#[\Override]
public function run($input)
{
$container = ($this->container)($this->os, $this->env)->build();
Expand Down
10 changes: 10 additions & 0 deletions src/Application/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public static function of(OperatingSystem $os, Environment $env): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapEnvironment(callable $map): self
{
/** @psalm-suppress ImpureFunctionCall Mutation free to force the user to use the returned object */
Expand All @@ -103,6 +104,7 @@ public function mapEnvironment(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapOperatingSystem(callable $map): self
{
/** @psalm-suppress ImpureFunctionCall Mutation free to force the user to use the returned object */
Expand All @@ -119,6 +121,7 @@ public function mapOperatingSystem(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function service(string|Service $name, callable $definition): self
{
$container = $this->container;
Expand All @@ -139,6 +142,7 @@ public function service(string|Service $name, callable $definition): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function command(callable $command): self
{
return $this;
Expand All @@ -147,6 +151,7 @@ public function command(callable $command): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapCommand(callable $map): self
{
return $this;
Expand All @@ -155,6 +160,7 @@ public function mapCommand(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function route(string $pattern, callable $handle): self
{
return $this->appendRoutes(
Expand All @@ -173,6 +179,7 @@ public function route(string $pattern, callable $handle): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function appendRoutes(callable $append): self
{
return new self(
Expand All @@ -188,6 +195,7 @@ public function appendRoutes(callable $append): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function mapRequestHandler(callable $map): self
{
$previous = $this->mapRequestHandler;
Expand Down Expand Up @@ -215,6 +223,7 @@ public function mapRequestHandler(callable $map): self
/**
* @psalm-mutation-free
*/
#[\Override]
public function notFoundRequestHandler(callable $handle): self
{
return new self(
Expand All @@ -227,6 +236,7 @@ public function notFoundRequestHandler(callable $handle): self
);
}

#[\Override]
public function run($input)
{
$container = ($this->container)($this->os, $this->env)->build();
Expand Down
2 changes: 2 additions & 0 deletions src/Cli/Command/Defer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct(
$this->map = $map;
}

#[\Override]
public function __invoke(Console $console): Console
{
// we map the command when running it instead of when loading it to
Expand All @@ -50,6 +51,7 @@ public function __invoke(Console $console): Console
/**
* @psalm-mutation-free
*/
#[\Override]
public function usage(): string
{
/** @psalm-suppress ImpureMethodCall */
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/LogicException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

namespace Innmind\Framework\Exception;

class LogicException extends \LogicException implements Exception
final class LogicException extends \LogicException implements Exception
{
}
1 change: 1 addition & 0 deletions src/Http/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __construct(Sequence $routes, Maybe $notFound)
$this->notFound = $notFound;
}

#[\Override]
public function __invoke(ServerRequest $request): Response
{
$match = new RequestMatcher($this->routes);
Expand Down
1 change: 1 addition & 0 deletions src/Main/Async/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
abstract class Http extends Main
{
#[\Override]
protected function main(Environment $env, OperatingSystem $os): Environment
{
/**
Expand Down
1 change: 1 addition & 0 deletions src/Main/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

abstract class Cli extends Main
{
#[\Override]
protected function main(Environment $env, OperatingSystem $os): Environment
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/Main/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ abstract class Http extends Main
{
private Application $app;

#[\Override]
protected function preload(OperatingSystem $os, Environment $env): void
{
$this->app = static::configure(Application::http($os, AppEnv::http($env)));
}

#[\Override]
protected function main(ServerRequest $request): Response
{
/**
Expand Down
1 change: 1 addition & 0 deletions src/Middleware/LoadDotEnv.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ private function __construct(Path $folder)
$this->folder = $folder;
}

#[\Override]
public function __invoke(Application $app): Application
{
$folder = $this->folder;
Expand Down
1 change: 1 addition & 0 deletions src/Middleware/Optional.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ private function __construct(string $middleware, callable $factory)
$this->factory = $factory;
}

#[\Override]
public function __invoke(Application $app): Application
{
if (!\class_exists($this->middleware)) {
Expand Down
Loading