Skip to content

Commit b65b2c7

Browse files
authored
Update code standards to PHP 7.0+ (#41)
1 parent 261f951 commit b65b2c7

File tree

3 files changed

+87
-84
lines changed

3 files changed

+87
-84
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"require": {
1515
"php": ">=7.0.8 <8.0",
1616
"codeception/lib-innerbrowser": "^1.3",
17-
"codeception/codeception": "^4.0"
17+
"codeception/codeception": "^4.0",
18+
"ext-json": "*"
1819
},
1920
"require-dev": {
2021
"codeception/module-asserts": "^1.3",

src/Codeception/Lib/Connector/Symfony.php

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

3+
declare(strict_types=1);
4+
35
namespace Codeception\Lib\Connector;
46

57
use InvalidArgumentException;
@@ -42,11 +44,11 @@ class Symfony extends HttpKernelBrowser
4244
* @param array $services An injected services
4345
* @param bool $rebootable
4446
*/
45-
public function __construct(Kernel $kernel, array $services = [], $rebootable = true)
47+
public function __construct(Kernel $kernel, array $services = [], bool $rebootable = true)
4648
{
4749
parent::__construct($kernel);
4850
$this->followRedirects(true);
49-
$this->rebootable = (boolean)$rebootable;
51+
$this->rebootable = $rebootable;
5052
$this->persistentServices = $services;
5153
$this->container = $this->kernel->getContainer();
5254
$this->rebootKernel();
@@ -56,7 +58,7 @@ public function __construct(Kernel $kernel, array $services = [], $rebootable =
5658
* @param Request $request
5759
* @return Response
5860
*/
59-
protected function doRequest($request)
61+
protected function doRequest($request): Response
6062
{
6163
if ($this->rebootable) {
6264
if ($this->hasPerformedRequest) {
@@ -78,7 +80,7 @@ protected function doRequest($request)
7880
public function rebootKernel()
7981
{
8082
if ($this->container) {
81-
foreach ($this->persistentServices as $serviceName => $service) {
83+
foreach (array_keys($this->persistentServices) as $serviceName) {
8284
if ($this->container->has($serviceName)) {
8385
$this->persistentServices[$serviceName] = $this->container->get($serviceName);
8486
}
@@ -87,6 +89,7 @@ public function rebootKernel()
8789

8890
$this->kernel->shutdown();
8991
$this->kernel->boot();
92+
9093
$this->container = $this->kernel->getContainer();
9194

9295
foreach ($this->persistentServices as $serviceName => $service) {

0 commit comments

Comments
 (0)