10000 [FrameworkBundle][WebProfilerBundle] Don't pass null to string parame… · symfony/symfony@5af6eda · GitHub
[go: up one dir, main page]

Skip to content

Commit 5af6eda

Browse files
committed
[FrameworkBundle][WebProfilerBundle] Don't pass null to string parameters
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent b87de42 commit 5af6eda

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ private function getContainerDefinitionDocument(Definition $definition, string $
285285
$descriptionXML->appendChild($dom->createCDATASection($classDescription));
286286
}
287287

288-
$serviceXML->setAttribute('class', $definition->getClass());
288+
$serviceXML->setAttribute('class', $definition->getClass() ?? '');
289289

290290
if ($factory = $definition->getFactory()) {
291291
$serviceXML->appendChild($factoryXML = $dom->createElement('factory'));
@@ -311,7 +311,7 @@ private function getContainerDefinitionDocument(Definition $definition, string $
311311
$serviceXML->setAttribute('abstract', $definition->isAbstract() ? 'true' : 'false');
312312
$serviceXML->setAttribute('autowired', $definition->isAutowired() ? 'true' : 'false');
313313
$serviceXML->setAttribute('autoconfigured', $definition->isAutoconfigured() ? 'true' : 'false');
314-
$serviceXML->setAttribute('file', $definition->getFile());
314+
$serviceXML->setAttribute('file', $definition->getFile() ?? '');
315315

316316
$calls = $definition->getMethodCalls();
317317
if (\count($calls) > 0) {

src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ public function __wakeup()
7676

7777
public function __destruct()
7878
{
79-
$fs = new Filesystem();
80-
$fs->remove($this->cacheDir);
79+
if ($this->cacheDir) {
80+
$fs = new Filesystem();
81+
$fs->remove($this->cacheDir);
82+
}
8183
}
8284

8385
protected function configureRoutes(RouteCollectionBuilder $routes)

src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function onKernelResponse(FilterResponseEvent $event)
103103
|| $response->isRedirection()
104104
|| ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))
105105
|| 'html' !== $request->getRequestFormat()
106-
|| false !== stripos($response->headers->get('Content-Disposition'), 'attachment;')
106+
|| false !== stripos($response->headers->get('Content-Disposition', ''), 'attachment;')
107107
) {
108108
return;
109109
}

0 commit comments

Comments
 (0)
0