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: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ jobs:
uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main
cs:
uses: innmind/github-workflows/.github/workflows/cs.yml@main
with:
php-version: '8.2'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ use Innmind\Framework\{
Application,
};
use Innmind\OperatingSystem\OperatingSystem;
use Innmind\TimeContinuum\{
use Innmind\Time\{
Clock,
Format,
};
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"issues": "http://github.com/Innmind/framework/issues"
},
"require": {
"php": "~8.2",
"innmind/foundation": "~1.10",
"php": "~8.4",
"innmind/foundation": "~2.1",
"innmind/di": "~3.0"
},
"autoload": {
Expand All @@ -30,14 +30,14 @@
}
},
"require-dev": {
"innmind/static-analysis": "^1.2.1",
"innmind/static-analysis": "~1.3",
"innmind/black-box": "~6.5",
"innmind/coding-standard": "~2.0",
"innmind/async-http-server": "~4.0"
"innmind/async-http-server": "~5.0"
},
"conflict": {
"innmind/black-box": "<6.0|~7.0",
"innmind/async-http-server": "<3.0|~5.0"
"innmind/async-http-server": "<4.0|~6.0"
},
"suggest": {
"innmind/black-box": "For property based testing",
Expand Down
4 changes: 2 additions & 2 deletions docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use Innmind\Framework\{
use Innmind\OperatingSystem\OperatingSystem;
use Innmind\AMQP\Factory;
use Innmind\IO\Sockets\Internet\Transport;
use Innmind\TimeContinuum\Period;
use Innmind\Time\Period;
use Innmind\Url\Url;

new class extends Http|Cli {
Expand Down Expand Up @@ -96,7 +96,7 @@ use Innmind\Framework\{
use Innmind\OperatingSystem\OperatingSystem;
use Innmind\AMQP\Factory;
use Innmind\IO\Sockets\Internet\Transport;
use Innmind\TimeContinuum\Period;
use Innmind\Time\Period;
use Innmind\Url\Url;

new class extends Http|Cli {
Expand Down
4 changes: 2 additions & 2 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use Innmind\Framework\{
Environment,
};
use Innmind\OperatingSystem\Factory;
use Innmind\CLI\Environment\InMemory;
use Innmind\CLI\Environment;
use PHPUnit\Framework\TestCase;

final class AppTest extends TestCase
Expand All @@ -65,7 +65,7 @@ final class AppTest extends TestCase
new Kernel,
);

$environment = $app->run(InMemory::of(
$environment = $app->run(Environment::inMemory(
[], // input chunks
false, // interactive
['entrypoint.php'], // arguments
Expand Down
5 changes: 3 additions & 2 deletions src/Application/Async/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
Sequence,
Attempt,
SideEffect,
Map,
};

/**
Expand Down Expand Up @@ -258,15 +259,15 @@ public function run($input): Attempt

$run = Commands::of(Serve::of(
$this->os,
static function(ServerRequest $request, OperatingSystem $os) use (
static function(ServerRequest $request, OperatingSystem $os, Map $env) use (
$map,
$container,
$routes,
$notFound,
$mapRoute,
$recover,
): Response {
$env = Environment::http($request->environment());
$env = Environment::of($env);
[$os, $env] = $map($os, $env);
$container = $container($os, $env)->build();
$pipe = Pipe::new();
Expand Down
13 changes: 0 additions & 13 deletions src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
namespace Innmind\Framework;

use Innmind\Framework\Exception\LogicException;
use Innmind\Http\ServerRequest\Environment as HttpEnvironment;
use Innmind\Immutable\{
Map,
Maybe,
Expand Down Expand Up @@ -44,18 +43,6 @@ public static function test(array $variables): self
return self::of(Map::of(...$variables));
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function http(HttpEnvironment $env): self
{
return $env->reduce(
new self(Map::of()),
static fn(self $env, $key, $value) => $env->with($key, $value),
);
}

#[\NoDiscard]
public function with(string $key, string $value): self
{
Expand Down
6 changes: 3 additions & 3 deletions src/Main/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
use Innmind\Http\{
ServerRequest,
Response,
ServerRequest\Environment,
};
use Innmind\Immutable\Map;

abstract class Http extends Main
{
/** @var Application<ServerRequest, Response> */
private Application $app;

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

#[\Override]
Expand Down
Loading
Loading