Skip to content

Commit 31bc58e

Browse files
committed
update to PHP 7.4
1 parent e08c9b7 commit 31bc58e

File tree

6 files changed

+49
-37
lines changed

6 files changed

+49
-37
lines changed

composer.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@
1919
"ext-json": "*",
2020
"antidot-fw/antidot-react-http": "dev-master",
2121
"antidot-fw/antidot-react-psr15": "dev-master",
22-
"antidot-fw/fast-router-adapter": "dev-master",
23-
"antidot-fw/cli": "^1.0.0",
24-
"antidot-fw/container": "^0.0.2",
25-
"antidot-fw/dev-tools": "dev-master",
26-
"antidot-fw/event-dispatcher": "^1.1.0",
27-
"antidot-fw/framework": "^0.0.2",
28-
"antidot-fw/logger": "^1.0.1",
29-
"antidot-fw/symfony-config-translator": "^1.0.0",
30-
"antidot-fw/yaml-config-provider": "dev-master",
31-
"symfony/yaml": "^4.2.7",
32-
"wshafer/psr11-monolog": "@dev"
22+
"antidot-fw/fast-router-adapter": "^0.1.0",
23+
"antidot-fw/cli": "^1.1.0",
24+
"antidot-fw/container": "^0.1.0",
25+
"antidot-fw/dev-tools": "^0.1.2",
26+
"antidot-fw/event-dispatcher": "^1.1.1",
27+
"antidot-fw/framework": "^0.1.1",
28+
"antidot-fw/logger": "^1.1.0",
29+
"antidot-fw/symfony-config-translator": "^1.1.0",
30+
"antidot-fw/yaml-config-provider": "^0.1.0",
31+
"webmozart/assert": "^1.7.0",
32+
"wshafer/psr11-monolog": "^3.0.0"
3333
},
3434
"require-dev": {
3535
"blackfire/php-sdk": "^1.20",
3636
"franzl/whoops-middleware": "^1.1",
37-
"phpro/grumphp": "^0.15.0",
37+
"phpro/grumphp": "0.17.2",
3838
"phpstan/phpstan": "^0.11.5",
3939
"phpunit/phpunit": "^8.0",
4040
"roave/security-advisories": "dev-master",
4141
"seregazhuk/php-watcher": "^0.5.1",
4242
"squizlabs/php_codesniffer": "^3.4",
4343
"symfony/var-dumper": "^4.2",
44-
"zendframework/zend-component-installer": "^2.1"
44+
"laminas/laminas-component-installer": "^2.1.2"
4545
},
4646
"autoload": {
4747
"psr-4": {
@@ -83,7 +83,7 @@
8383
"antidot-fw/event-dispatcher",
8484
"antidot-fw/symfony-config-translator",
8585
"wshafer/psr11-monolog",
86-
"zendframework/zend-httphandlerrunner",
86+
"laminias/laminas-httphandlerrunner",
8787
"antidot-fw/antidot-react-http",
8888
"antidot-fw/antidot-react-psr15"
8989
]

config/cli-config.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22

33
declare(strict_types=1);
44

5-
use Zend\ConfigAggregator\ArrayProvider;
6-
use Zend\ConfigAggregator\ConfigAggregator;
5+
use Antidot\SymfonyConfigTranslator\Container\Config\ConfigAggregator;
6+
use Laminas\ConfigAggregator\ArrayProvider;
77

88
$config = require __DIR__ . '/config.php';
9-
$cliConfig['dependencies'] = $config['console']['dependencies'];
9+
$cliConfig['services'] = $config['console']['services'] ?? [];
10+
$cliConfig['factories'] = $config['console']['factories'] ?? [];
1011
$cacheConfig = [
1112
'cli_config_cache_path' => 'var/cache/cli-config-cache.php',
1213
];
1314

14-
return (new ConfigAggregator([
15-
new ArrayProvider($config),
16-
new ArrayProvider($cliConfig),
17-
new ArrayProvider($cacheConfig),
18-
], $cacheConfig['cli_config_cache_path']))->getMergedConfig();
15+
return (new ConfigAggregator(
16+
[
17+
new ArrayProvider($config),
18+
new ArrayProvider($cliConfig),
19+
new ArrayProvider($cacheConfig),
20+
], $cacheConfig['cli_config_cache_path']
21+
))->getMergedConfig();

config/cli-container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
// Load configuration
4-
use Antidot\Container\ContainerBuilder;
4+
use Antidot\Container\Builder;
55

66
$config = require __DIR__ . '/../config/cli-config.php';
77

8-
return ContainerBuilder::build($config, true);
8+
return Builder::build($config, true);

config/config.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
declare(strict_types=1);
44

5+
use Antidot\DevTools\Container\Config\ConfigProvider as DevToolsConfigProvider;
56
use Antidot\SymfonyConfigTranslator\Container\Config\ConfigAggregator;
67
use Antidot\Yaml\YamlConfigProvider;
7-
use Zend\ConfigAggregator\ArrayProvider;
8-
use Zend\ConfigAggregator\PhpFileProvider;
8+
use Laminas\ConfigAggregator\ArrayProvider;
9+
use Laminas\ConfigAggregator\PhpFileProvider;
910

1011
// To enable or disable caching, set the `ConfigAggregator::ENABLE_CACHE` boolean in
1112
// `config/autoload/local.php`.
@@ -14,7 +15,16 @@
1415
];
1516

1617
$aggregator = new ConfigAggregator([
18+
\WShafer\PSR11MonoLog\ConfigProvider::class,
19+
\Antidot\Event\Container\Config\ConfigProvider::class,
20+
\Antidot\Logger\Container\Config\ConfigProvider::class,
21+
\Antidot\Cli\Container\Config\ConfigProvider::class,
22+
\Antidot\Fast\Router\Container\Config\ConfigProvider::class,
23+
\Antidot\React\PSR15\Container\Config\ConfigProvider::class,
24+
\Antidot\Container\Config\ConfigProvider::class,
25+
\Laminas\HttpHandlerRunner\ConfigProvider::class,
1726
\Antidot\React\Container\Config\ConfigProvider::class,
27+
class_exists(DevToolsConfigProvider::class) ? DevToolsConfigProvider::class : fn() => [],
1828
// Load application config in a pre-defined order in such a way that local settings
1929
// overwrite global settings. (Loaded as first to last):
2030
// - `*.php`

config/container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

33
// Load configuration
4-
use Antidot\Container\ContainerBuilder;
4+
use Antidot\Container\Builder;
55

66
$config = require __DIR__ . '/../config/config.php';
77

88
// Build container
9-
return ContainerBuilder::build($config, true);
9+
return Builder::build($config, true);

src/Application/Http/Handler/HomePage.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
use Psr\Http\Message\ResponseInterface;
1111
use Psr\Http\Message\ServerRequestInterface;
1212
use Psr\Http\Server\RequestHandlerInterface;
13-
use React\Promise\FulfilledPromise;
1413
use Zend\Diactoros\Response\JsonResponse;
1514

15+
use function React\Promise\resolve;
16+
1617
class HomePage implements RequestHandlerInterface
1718
{
18-
/** @var EventDispatcherInterface */
19-
private $eventDispatcher;
19+
private EventDispatcherInterface $eventDispatcher;
2020

2121
public function __construct(EventDispatcherInterface $eventDispatcher)
2222
{
@@ -25,15 +25,14 @@ public function __construct(EventDispatcherInterface $eventDispatcher)
2525

2626
public function handle(ServerRequestInterface $request): ResponseInterface
2727
{
28-
$promise = new FulfilledPromise($request);
29-
28+
$eventDispatcher = $this->eventDispatcher;
3029
return new PromiseResponse(
31-
$promise
32-
->then(function (ServerRequestInterface $request) {
33-
$this->eventDispatcher->dispatch(SomeEvent::occur());
30+
resolve($request)
31+
->then(static function (ServerRequestInterface $request) use ($eventDispatcher) {
32+
$eventDispatcher->dispatch(SomeEvent::occur());
3433
return $request;
3534
})
36-
->then(function (ServerRequestInterface $request) {
35+
->then(static function (ServerRequestInterface $request) {
3736
return new JsonResponse([
3837
'docs' => 'https://antidotfw.io',
3938
'message' => $request->getAttribute('foo') . ' Welcome to Antidot Framework Starter',

0 commit comments

Comments
 (0)