Skip to content

Commit cd575d0

Browse files
Merge branch '4.3' into 4.4
* 4.3: cs fix Fix inconsistent return points. [Config] Add handling for ignored keys in ArrayNode::mergeValues. Fix inconsistent return points. [Security/Core] UserInterface::getPassword() can return null [Router] Fix TraceableUrlMatcher behaviour with trailing slash Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
2 parents 4edd6ff + 2d1b123 commit cd575d0

12 files changed

+39
-22
lines changed

Command/ConfigDumpReferenceCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8686
'For dumping a specific option, add its path as the second argument of this command. (e.g. <comment>config:dump-reference FrameworkBundle profiler.matcher</comment> to dump the <comment>framework.profiler.matcher</comment> configuration)',
8787
]);
8888

89-
return;
89+
return null;
9090
}
9191

9292
$extension = $this->findExtension($name);
@@ -129,5 +129,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
129129
}
130130

131131
$io->writeln(null === $path ? $dumper->dump($configuration, $extension->getNamespace()) : $dumper->dumpAtPath($configuration, $path));
132+
133+
return null;
132134
}
133135
}

Command/DebugAutowiringCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
145145
}
146146

147147
$io->newLine();
148+
149+
return null;
148150
}
149151

150152
private function getFileLink(string $class): string

Command/RouterMatchCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
113113

114114
return 1;
115115
}
116+
117+
return null;
116118
}
117119
}

Command/TranslationUpdateCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
236236
if (!\count($operation->getDomains())) {
237237
$errorIo->warning('No translation messages were found.');
238238

239-
return;
239+
return null;
240240
}
241241

242242
$resultMessage = 'Translation files were successfully updated';
@@ -301,6 +301,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
301301
}
302302

303303
$errorIo->success($resultMessage.'.');
304+
305+
return null;
304306
}
305307

306308
private function filterCatalogue(MessageCatalogue $catalogue, string $domain): MessageCatalogue

Console/Descriptor/JsonDescriptor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ protected function describeContainerDefinition(Definition $definition, array $op
143143
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null)
144144
{
145145
if (!$builder) {
146-
return $this->writeData($this->getContainerAliasData($alias), $options);
146+
$this->writeData($this->getContainerAliasData($alias), $options);
147+
148+
return;
147149
}
148150

149151
$this->writeData(

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
253253
."\n".'- Public: '.($alias->isPublic() && !$alias->isPrivate() ? 'yes' : 'no');
254254

255255
if (!isset($options['id'])) {
256-
return $this->write($output);
256+
$this->write($output);
257+
258+
return;
257259
}
258260

259261
$this->write(sprintf("### %s\n\n%s\n", $options['id'], $output));

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
387387
return;
388388
}
389389

390-
return $this->describeContainerDefinition($builder->getDefinition((string) $alias), array_merge($options, ['id' => (string) $alias]));
390+
$this->describeContainerDefinition($builder->getDefinition((string) $alias), array_merge($options, ['id' => (string) $alias]));
391391
}
392392

393393
/**

Console/Descriptor/XmlDescriptor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
100100
$dom->appendChild($dom->importNode($this->getContainerAliasDocument($alias, isset($options['id']) ? $options['id'] : null)->childNodes->item(0), true));
101101

102102
if (!$builder) {
103-
return $this->writeDocument($dom);
103+
$this->writeDocument($dom);
104+
105+
return;
104106
}
105107

106108
$dom->appendChild($dom->importNode($this->getContainerDefinitionDocument($builder->getDefinition((string) $alias), (string) $alias)->childNodes->item(0), true));

Templating/GlobalVariables.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,20 @@ public function getToken()
4949
public function getUser()
5050
{
5151
if (!$token = $this->getToken()) {
52-
return;
52+
return null;
5353
}
5454

5555
$user = $token->getUser();
56-
if (!\is_object($user)) {
57-
return;
58-
}
5956

60-
return $user;
57+
return \is_object($user) ? $user : null;
6158
}
6259

6360
/**
6461
* @return Request|null The HTTP request object
6562
*/
6663
public function getRequest()
6764
{
68-
if ($this->container->has('request_stack')) {
69-
return $this->container->get('request_stack')->getCurrentRequest();
70-
}
65+
return $this->container->has('request_stack') ? $this->container->get('request_stack')->getCurrentRequest() : null;
7166
}
7267

7368
/**

Templating/Helper/CodeHelper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function formatArgs(array $args)
116116
* @param string $file A file path
117117
* @param int $line The selected line number
118118
*
119-
* @return string An HTML string
119+
* @return string|null An HTML string
120120
*/
121121
public function fileExcerpt($file, $line)
122122
{
@@ -144,6 +144,8 @@ public function fileExcerpt($file, $line)
144144

145145
return '<ol start="'.max($line - 3, 1).'">'.implode("\n", $lines).'</ol>';
146146
}
147+
148+
return null;
147149
}
148150

149151
/**

0 commit comments

Comments
 (0)