Skip to content

Update code standards to PHP 7.0+ #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2020
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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"require": {
"php": ">=7.0.8 <8.0",
"codeception/lib-innerbrowser": "^1.3",
"codeception/codeception": "^4.0"
"codeception/codeception": "^4.0",
"ext-json": "*"
},
"require-dev": {
"codeception/module-asserts": "^1.3",
Expand Down
11 changes: 7 additions & 4 deletions src/Codeception/Lib/Connector/Symfony.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Codeception\Lib\Connector;

use InvalidArgumentException;
Expand Down Expand Up @@ -42,11 +44,11 @@ class Symfony extends HttpKernelBrowser
* @param array $services An injected services
* @param bool $rebootable
*/
public function __construct(Kernel $kernel, array $services = [], $rebootable = true)
public function __construct(Kernel $kernel, array $services = [], bool $rebootable = true)
{
parent::__construct($kernel);
$this->followRedirects(true);
$this->rebootable = (boolean)$rebootable;
$this->rebootable = $rebootable;
$this->persistentServices = $services;
$this->container = $this->kernel->getContainer();
$this->rebootKernel();
Expand All @@ -56,7 +58,7 @@ public function __construct(Kernel $kernel, array $services = [], $rebootable =
* @param Request $request
* @return Response
*/
protected function doRequest($request)
protected function doRequest($request): Response
{
if ($this->rebootable) {
if ($this->hasPerformedRequest) {
Expand All @@ -78,7 +80,7 @@ protected function doRequest($request)
public function rebootKernel()
{
if ($this->container) {
foreach ($this->persistentServices as $serviceName => $service) {
foreach (array_keys($this->persistentServices) as $serviceName) {
if ($this->container->has($serviceName)) {
$this->persistentServices[$serviceName] = $this->container->get($serviceName);
}
Expand All @@ -87,6 +89,7 @@ public function rebootKernel()

$this->kernel->shutdown();
$this->kernel->boot();

$this->container = $this->kernel->getContainer();

foreach ($this->persistentServices as $serviceName => $service) {
Expand Down
Loading