Skip to content

Commit d97e51e

Browse files
committed
Fix access to static property form 'self::' to 'static::'
1 parent 46c7666 commit d97e51e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/Test/WebTestCase.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function runCommand(string $name, array $params = [], bool $reuseKerne
8888
static::ensureKernelShutdown();
8989
}
9090

91-
$kernel = static::bootKernel(['environment' => self::$env]);
91+
$kernel = static::bootKernel(['environment' => static::$env]);
9292
$kernel->boot();
9393
} else {
9494
$kernel = $this->getContainer()->get('kernel');
@@ -208,10 +208,10 @@ public function isDecorated(bool $decorated): void
208208
*/
209209
private function getDependencyInjectionContainer(): ContainerInterface
210210
{
211-
$cacheKey = self::$env;
211+
$cacheKey = static::$env;
212212
if (empty($this->containers[$cacheKey])) {
213213
$kernel = static::createKernel([
214-
'environment' => self::$env,
214+
'environment' => static::$env,
215215
]);
216216
$kernel->boot();
217217

@@ -229,7 +229,7 @@ private function getDependencyInjectionContainer(): ContainerInterface
229229
protected static function createKernel(array $options = []): KernelInterface
230230
{
231231
if (!isset($options['environment'])) {
232-
$options['environment'] = self::$env;
232+
$options['environment'] = static::$env;
233233
}
234234

235235
return parent::createKernel($options);
@@ -253,9 +253,9 @@ public function __set($name, $value)
253253
throw new \Exception(sprintf('There is no property with name "%s"', $name));
254254
}
255255

256-
@trigger_error('Setting "environment" property is deprecated, please use self::$env.', \E_USER_DEPRECATED);
256+
@trigger_error('Setting "environment" property is deprecated, please use static::$env.', \E_USER_DEPRECATED);
257257

258-
self::$env = $value;
258+
static::$env = $value;
259259
}
260260

261261
public function __isset($name)
@@ -264,7 +264,7 @@ public function __isset($name)
264264
throw new \Exception(sprintf('There is no property with name "%s"', $name));
265265
}
266266

267-
@trigger_error('Checking "environment" property is deprecated, please use self::$env.', \E_USER_DEPRECATED);
267+
@trigger_error('Checking "environment" property is deprecated, please use static::$env.', \E_USER_DEPRECATED);
268268

269269
return true;
270270
}
@@ -275,9 +275,9 @@ public function __get($name)
275275
throw new \Exception(sprintf('There is no property with name "%s"', $name));
276276
}
277277

278-
@trigger_error('Getting "environment" property is deprecated, please use self::$env.', \E_USER_DEPRECATED);
278+
@trigger_error('Getting "environment" property is deprecated, please use static::$env.', \E_USER_DEPRECATED);
279279

280-
return self::$env;
280+
return static::$env;
281281
}
282282

283283
/**
@@ -496,7 +496,7 @@ protected function createClientWithParams(array $params, ?string $username = nul
496496
static::ensureKernelShutdown();
497497
}
498498

499-
$client = static::createClient(['environment' => self::$env], $params);
499+
$client = static::createClient(['environment' => static::$env], $params);
500500

501501
if ($this->firewallLogins) {
502502
// has to be set otherwise "hasPreviousSession" in Request returns false.

tests/Command/CommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function testRunCommandWithInputs(): void
7676
public function testRunCommandWithoutOptionsAndNotReuseKernel(bool $useEnv): void
7777
{
7878
if ($useEnv) {
79-
self::$env = 'test';
79+
static::$env = 'test';
8080
} else {
8181
$this->environment = 'test';
8282
}
@@ -96,7 +96,7 @@ public function testRunCommandWithoutOptionsAndNotReuseKernel(bool $useEnv): voi
9696

9797
// Run command and reuse kernel
9898
if ($useEnv) {
99-
self::$env = 'prod';
99+
static::$env = 'prod';
100100
} else {
101101
$this->environment = 'prod';
102102
}

0 commit comments

Comments
 (0)