Skip to content

Commit 952a350

Browse files
committed
Reformat code
1 parent 2e3c7cc commit 952a350

File tree

9 files changed

+28
-26
lines changed

9 files changed

+28
-26
lines changed

src/Codeception/Lib/Connector/Symfony.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
namespace Codeception\Lib\Connector;
66

77
use InvalidArgumentException;
8+
use ReflectionClass;
9+
use ReflectionMethod;
10+
use ReflectionProperty;
811
use Symfony\Bundle\FrameworkBundle\Test\TestContainer;
912
use Symfony\Component\DependencyInjection\ContainerInterface;
1013
use Symfony\Component\HttpFoundation\Request;
@@ -28,9 +31,9 @@ class Symfony extends HttpKernelBrowser
2831
/**
2932
* Constructor.
3033
*
31-
* @param Kernel $kernel A booted HttpKernel instance
32-
* @param array $services An injected services
33-
* @param bool $rebootable
34+
* @param Kernel $kernel A booted HttpKernel instance
35+
* @param array $services An injected services
36+
* @param bool $rebootable
3437
*/
3538
public function __construct(Kernel $kernel, array $services = [], bool $rebootable = true)
3639
{
@@ -133,17 +136,17 @@ private function persistDoctrineConnections(): void
133136
}
134137

135138
if ($this->container instanceof TestContainer) {
136-
$reflectedTestContainer = new \ReflectionMethod($this->container, 'getPublicContainer');
139+
$reflectedTestContainer = new ReflectionMethod($this->container, 'getPublicContainer');
137140
$reflectedTestContainer->setAccessible(true);
138141
$publicContainer = $reflectedTestContainer->invoke($this->container);
139142
} else {
140143
$publicContainer = $this->container;
141144
}
142145

143-
$reflectedContainer = new \ReflectionClass($publicContainer);
146+
$reflectedContainer = new ReflectionClass($publicContainer);
144147
$reflectionTarget = $reflectedContainer->hasProperty('parameters') ? $publicContainer : $publicContainer->getParameterBag();
145148

146-
$reflectedParameters = new \ReflectionProperty($reflectionTarget, 'parameters');
149+
$reflectedParameters = new ReflectionProperty($reflectionTarget, 'parameters');
147150
$reflectedParameters->setAccessible(true);
148151
$parameters = $reflectedParameters->getValue($reflectionTarget);
149152
unset($parameters['doctrine.connections']);

src/Codeception/Module/Symfony.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function _initialize(): void
193193
$maxNestingLevel = 200; // Symfony may have very long nesting level
194194
$xdebugMaxLevelKey = 'xdebug.max_nesting_level';
195195
if (ini_get($xdebugMaxLevelKey) < $maxNestingLevel) {
196-
ini_set($xdebugMaxLevelKey, (string) $maxNestingLevel);
196+
ini_set($xdebugMaxLevelKey, (string)$maxNestingLevel);
197197
}
198198

199199
$this->kernel = new $this->kernelClass($this->config['environment'], $this->config['debug']);

src/Codeception/Module/Symfony/ConsoleAssertionsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public function runSymfonyConsoleCommand(string $command, array $parameters = []
4040
$this->assertSame(
4141
$expectedExitCode,
4242
$exitCode,
43-
'Command did not exit with code '.$expectedExitCode
44-
.' but with '.$exitCode.': '.$output
43+
'Command did not exit with code ' . $expectedExitCode
44+
. ' but with ' . $exitCode . ': ' . $output
4545
);
4646

4747
return $output;

src/Codeception/Module/Symfony/DoctrineAssertionsTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ trait DoctrineAssertionsTrait
2525
* $I->grabNumRecords('User::class', ['name' => 'davert']);
2626
* ```
2727
*
28-
* @param string $entityClass The entity class
29-
* @param array $criteria Optional query criteria
28+
* @param string $entityClass The entity class
29+
* @param array $criteria Optional query criteria
3030
* @return int
3131
*/
3232
public function grabNumRecords(string $entityClass, array $criteria = []): int
@@ -59,7 +59,7 @@ public function grabNumRecords(string $entityClass, array $criteria = []): int
5959
* @param object|string $mixed
6060
* @return \Doctrine\ORM\EntityRepository|null
6161
*/
62-
public function grabRepository($mixed)
62+
public function grabRepository($mixed): ?EntityRepository
6363
{
6464
$entityRepoClass = EntityRepository::class;
6565
$isNotARepo = function () use ($mixed): void {
@@ -86,12 +86,12 @@ public function grabRepository($mixed)
8686
return $getRepo();
8787
}
8888

89-
if (!is_string($mixed) || !class_exists($mixed) ) {
89+
if (!is_string($mixed) || !class_exists($mixed)) {
9090
$isNotARepo();
9191
return null;
9292
}
9393

94-
if (is_subclass_of($mixed, $entityRepoClass)){
94+
if (is_subclass_of($mixed, $entityRepoClass)) {
9595
return $getRepo();
9696
}
9797

src/Codeception/Module/Symfony/EventsAssertionsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected function assertEventNotTriggered(Data $data, array $expected): void
125125
foreach ($expected as $expectedEvent) {
126126
$expectedEvent = is_object($expectedEvent) ? get_class($expectedEvent) : $expectedEvent;
127127
$this->assertFalse(
128-
$this->eventWasTriggered($actual, (string) $expectedEvent),
128+
$this->eventWasTriggered($actual, (string)$expectedEvent),
129129
"The '{$expectedEvent}' event triggered"
130130
);
131131
}
@@ -142,7 +142,7 @@ protected function assertEventTriggered(Data $data, array $expected): void
142142
foreach ($expected as $expectedEvent) {
143143
$expectedEvent = is_object($expectedEvent) ? get_class($expectedEvent) : $expectedEvent;
144144
$this->assertTrue(
145-
$this->eventWasTriggered($actual, (string) $expectedEvent),
145+
$this->eventWasTriggered($actual, (string)$expectedEvent),
146146
"The '{$expectedEvent}' event did not trigger"
147147
);
148148
}

src/Codeception/Module/Symfony/FormAssertionsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function dontSeeFormErrors(): void
2424
{
2525
$formCollector = $this->grabFormCollector(__FUNCTION__);
2626

27-
$errors = (int) $formCollector->getData()->offsetGet('nb_errors');
27+
$errors = (int)$formCollector->getData()->offsetGet('nb_errors');
2828

2929
$this->assertSame(
3030
0,

src/Codeception/Module/Symfony/RouterAssertionsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function seeInCurrentRoute(string $routeName): void
166166
$uri = explode('?', $this->grabFromCurrentUrl())[0];
167167
$matchedRouteName = '';
168168
try {
169-
$matchedRouteName = (string) $router->match($uri)['_route'];
169+
$matchedRouteName = (string)$router->match($uri)['_route'];
170170
} catch (ResourceNotFoundException $e) {
171171
$this->fail(sprintf('The "%s" url does not match with any route', $uri));
172172
}

src/Codeception/Module/Symfony/SessionAssertionsTrait.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public function amLoggedInAs(UserInterface $user, string $firewallName = 'main',
4444
}
4545

4646
if ($firewallContext) {
47-
$session->set('_security_'.$firewallContext, serialize($token));
47+
$session->set('_security_' . $firewallContext, serialize($token));
4848
} else {
49-
$session->set('_security_'.$firewallName, serialize($token));
49+
$session->set('_security_' . $firewallName, serialize($token));
5050
}
5151

5252
$session->save();
@@ -75,8 +75,7 @@ public function dontSeeInSession(string $attribute, $value = null): void
7575
if ($session->has($attribute)) {
7676
$this->fail("Session attribute with name '{$attribute}' does exist");
7777
}
78-
}
79-
else {
78+
} else {
8079
$this->assertNotSame($value, $session->get($attribute));
8180
}
8281
}

src/Codeception/Module/Symfony/TwigAssertionsTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function dontSeeRenderedTemplate(string $template): void
2323
{
2424
$twigCollector = $this->grabTwigCollector(__FUNCTION__);
2525

26-
$templates = (array) $twigCollector->getTemplates();
26+
$templates = (array)$twigCollector->getTemplates();
2727

2828
$this->assertArrayNotHasKey(
2929
$template,
@@ -46,8 +46,8 @@ public function seeCurrentTemplateIs(string $expectedTemplate): void
4646
{
4747
$twigCollector = $this->grabTwigCollector(__FUNCTION__);
4848

49-
$templates = (array) $twigCollector->getTemplates();
50-
$actualTemplate = (string) array_key_first($templates);
49+
$templates = (array)$twigCollector->getTemplates();
50+
$actualTemplate = (string)array_key_first($templates);
5151

5252
$this->assertSame(
5353
$expectedTemplate,
@@ -72,7 +72,7 @@ public function seeRenderedTemplate(string $template): void
7272
{
7373
$twigCollector = $this->grabTwigCollector(__FUNCTION__);
7474

75-
$templates = (array) $twigCollector->getTemplates();
75+
$templates = (array)$twigCollector->getTemplates();
7676

7777
$this->assertArrayHasKey(
7878
$template,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy