8000 Fixed bugs found by psalm · symfony/symfony@0a0cd7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a0cd7a

Browse files
Nyholmnicolas-grekas
authored andcommitted
Fixed bugs found by psalm
1 parent 77870a5 commit 0a0cd7a

File tree

8 files changed

+9
-7
lines changed

8 files changed

+9
-7
lines changed

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private function displayJson(OutputInterface $output, array $filesInfo)
226226
return min($errors, 1);
227227
}
228228

229-
private function renderException(OutputInterface $output, string $template, Error $exception, string $file = null)
229+
private function renderException(SymfonyStyle $output, string $template, Error $exception, string $file = null)
230230
{
231231
$line = $exception->getTemplateLine();
232232

src/Symfony/Bridge/Twig/Mime/WrappedTemplatedEmail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function getBcc(): array
182182
*/
183183
public function setPriority(int $priority): self
184184
{
185-
$this->message->setPriority($priority);
185+
$this->message->priority($priority);
186186

187187
return $this;
188188
}

src/Symfony/Component/DependencyInjection/Definition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function setChanges(array $changes)
102102
/**
103103
* Sets a factory.
104104
*
105-
* @param string|array|Reference $factory A PHP function, reference or an array containing a class/Reference and a method to call
105+
* @param string|array|Reference|null $factory A PHP function, reference or an array containing a class/Reference and a method to call
106106
*
107107
* @return $this
108108
*/

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
5959
}
6060

6161
// Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default
62-
if (false === $target = @fopen($targetFile, 'w', null, stream_context_create(['ftp' => ['overwrite' => true]]))) {
62+
if (false === $target = @fopen($targetFile, 'w', false, stream_context_create(['ftp' => ['overwrite' => true]]))) {
6363
throw new IOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing.', $originFile, $targetFile), 0, null, $originFile);
6464
}
6565

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ public function getContent($asResource = false)
15641564
*/
15651565
public function getETags()
15661566
{
1567-
return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, \PREG_SPLIT_NO_EMPTY);
1567+
return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), -1, \PREG_SPLIT_NO_EMPTY);
15681568
}
15691569

15701570
/**

src/Symfony/Component/VarDumper/Command/ServerDumpCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9595
$this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) {
9696
$descriptor->describe($io, $data, $context, $clientId);
9797
});
98+
99+
return 0;
98100
}
99101
}

src/Symfony/Component/VarExporter/Internal/Exporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount
8282
}
8383

8484
if (!\is_array($properties = $value->__serialize())) {
85-
throw new \Typerror($class.'::__serialize() must return an array');
85+
throw new \TypeError($class.'::__serialize() must return an array');
8686
}
8787

8888
goto prepare_value;

src/Symfony/Contracts/Service/ServiceSubscriberTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function getSubscribedServices(): array
4343
}
4444

4545
if (self::class === $method->getDeclaringClass()->name && ($returnType = $method->getReturnType()) && !$returnType->isBuiltin()) {
46-
$services[self::class.'::'.$method->name] = '?'.($returnType instanceof \ReflectionNamedType ? $returnType->getName() : $type);
46+
$services[self::class.'::'.$method->name] = '?'.($returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType);
4747
}
4848
}
4949

0 commit comments

Comments
 (0)
0