Skip to content

Commit 9686df0

Browse files
committed
cs
1 parent 2e5ef31 commit 9686df0

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

src/Symfony/Component/ErrorHandler/Exception/FlattenException.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,19 @@ public function setTraceFromThrowable(\Throwable $throwable): self
278278
public function setTrace($trace, $file = null, $line = null): self
279279
{
280280
$this->trace = [];
281-
if ($file)
282-
$this->trace[] = [
283-
'namespace' => '',
284-
'short_class' => '',
285-
'class' => '',
286-
'type' => '',
287-
'function' => '',
288-
'file' => $file,
289-
'line' => $line,
290-
'args' => [],
291-
];
281+
if (null !== $file) {
282+
$this->trace[] = [
283+
'namespace' => '',
284+
'short_class' => '',
285+
'class' => '',
286+
'type' => '',
287+
'function' => '',
288+
'file' => $file,
289+
'line' => $line,
290+
'args' => [],
291+
];
292+
}
293+
292294
foreach ($trace as $entry) {
293295
$class = '';
294296
$namespace = '';
@@ -358,14 +360,14 @@ private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value): str
358360

359361
public function getTraceAsString(): string
360362
{
361-
if ($this->traceAsString === null) {
363+
if (null === $this->traceAsString) {
362364
$this->traceAsString = '';
363-
if ($this->trace !== null) {
365+
if (null !== $this->trace) {
364366
foreach ($this->trace as $i => $trace) {
365-
if ($i === 0) {
367+
if (0 === $i) {
366368
continue;
367369
}
368-
$this->traceAsString .= sprintf('#%d %s(%s): %s%s%s()', $i-1, $trace['file'], $trace['line'], $trace['class'], $trace['type'], $trace['function']).PHP_EOL;
370+
$this->traceAsString .= sprintf('#%d %s(%s): %s%s%s()', $i - 1, $trace['file'], $trace['line'], $trace['class'], $trace['type'], $trace['function']).\PHP_EOL;
369371
}
370372
}
371373
}

src/Symfony/Component/ErrorHandler/Tests/Exception/FlattenExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public function testSerialize()
422422

423423
// Verify that they look kind of similar.
424424
$this->assertEquals(substr($trace, 0, 100), substr($restoredTrace, 0, 100));
425-
$this->assertEquals(count(explode(PHP_EOL, $trace)), count(explode(PHP_EOL, $restoredTrace)));
425+
$this->assertEquals(\count(explode(\PHP_EOL, $trace)), \count(explode(\PHP_EOL, $restoredTrace)));
426426
}
427427

428428
private function createException($foo): \Exception

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ private function getWriteInfo(string $class, string $property, $value): Property
610610
'enable_magic_methods_extraction' => $this->magicMethodsFlags,
611611
'enable_constructor_extraction' => false,
612612
'enable_adder_remover_extraction' => $useAdderAndRemover,
613-
'value' => $value
613+
'value' => $value,
614614
]);
615615

616616
if (isset($item)) {

src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public function getWriteInfo(string $class, string $property, array $context = [
390390
$method = $reflClass->getMethod($methodName);
391391
/** @var \ReflectionParameter $parameter */
392392
$parameter = $method->getParameters()[0];
393-
if (array_key_exists('value', $context) && $context['value'] === null && !$parameter->allowsNull()) {
393+
if (\array_key_exists('value', $context) && null === $context['value'] && !$parameter->allowsNull()) {
394394
$errors[] = sprintf('The method "%s" in class "%s" was found but does not allow null.', $methodName, $class);
395395
continue;
396396
}

0 commit comments

Comments
 (0)