diff --git a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php index dbd47e66de25..3ee0a805f8b4 100644 --- a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php +++ b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php @@ -123,7 +123,7 @@ private function generateSignature(\ReflectionClass $class): iterable yield print_r($attributes, true); $attributes = []; - yield $class->getDocComment(); + yield $class->getDocComment() ?: ''; yield (int) $class->isFinal(); yield (int) $class->isAbstract(); @@ -145,7 +145,7 @@ private function generateSignature(\ReflectionClass $class): iterable yield print_r($attributes, true); $attributes = []; - yield $p->getDocComment(); + yield $p->getDocComment() ?: ''; yield $p->isDefault() ? '' : ''; yield $p->isPublic() ? 'public' : 'protected'; yield $p->isStatic() ? 'static' : ''; diff --git a/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php b/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php index 722df54cbcf2..c15e4776897e 100644 --- a/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php +++ b/src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php @@ -198,6 +198,8 @@ private function assertDirectorySame($expected, $current) } $currentFiles[substr($file->getPathname(), \strlen($current))] = $file->getPathname(); } + ksort($expectedFiles); + ksort($currentFiles); $this->assertSame(array_keys($expectedFiles), array_keys($currentFiles)); foreach ($expectedFiles as $fileName => $filePath) { diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 6e33c42fe49e..8fc3645590d3 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -1125,7 +1125,7 @@ private function createService(Definition $definition, array &$inlineServices, b if (!$definition->isDeprecated() && \is_array($factory) && \is_string($factory[0])) { $r = new \ReflectionClass($factory[0]); - if (0 < strpos($r->getDocComment(), "\n * @deprecated ")) { + if (0 < strpos($r->getDocComment() ?: '', "\n * @deprecated ")) { trigger_deprecation('', '', 'The "%s" service relies on the deprecated "%s" factory class. It should either be deprecated or its factory upgraded.', $id, $r->name); } } @@ -1142,7 +1142,7 @@ private function createService(Definition $definition, array &$inlineServices, b $service = $r->getConstructor() ? $r->newInstanceArgs($arguments) : $r->newInstance(); } - if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment(), "\n * @deprecated ")) { + if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment() ?: '', "\n * @deprecated ")) { trigger_deprecation('', '', 'The "%s" service relies on the deprecated "%s" class. It should either be deprecated or its implementation upgraded.', $id, $r->name); } } diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 09cb2ef322b8..6604d82e7eb1 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -542,7 +542,7 @@ private function collectLineage(string $class, array &$lineage): void return; } $file = $r->getFileName(); - if (str_ends_with($file, ') : eval()\'d code')) { + if ($file && str_ends_with($file, ') : eval()\'d code')) { $file = substr($file, 0, strrpos($file, '(', -17)); } if (!$file || $this->doExport($file) === $exportedFile = $this->export($file)) { @@ -589,12 +589,13 @@ private function generateProxyClasses(): array continue; } do { - $file = $r->getFileName(); - if (str_ends_with($file, ') : eval()\'d code')) { - $file = substr($file, 0, strrpos($file, '(', -17)); - } - if (is_file($file)) { - $this->container->addResource(new FileResource($file)); + if ($file = $r->getFileName()) { + if (str_ends_with($file, ') : eval()\'d code')) { + $file = substr($file, 0, strrpos($file, '(', -17)); + } + if (is_file($file)) { + $this->container->addResource(new FileResource($file)); + } } $r = $r->getParentClass() ?: null; } while ($r?->isUserDefined()); diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 04b37369d1a6..c9aad2e83c97 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -339,7 +339,11 @@ private function parseDefinition(\DOMElement $service, string $file, Definition } foreach ($this->getChildren($service, 'call') as $call) { - $definition->addMethodCall($call->getAttribute('method'), $this->getArgumentsAsPhp($call, 'argument', $file), XmlUtils::phpize($call->getAttribute('returns-clone'))); + $definition->addMethodCall( + $call->getAttribute('method'), + $this->getArgumentsAsPhp($call, 'argument', $file), + XmlUtils::phpize($call->getAttribute('returns-clone')) ?: false + ); } $tags = $this->getChildren($service, 'tag'); diff --git a/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php index 34ba50ddcf0d..578b34d09ec7 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php @@ -72,7 +72,7 @@ public static function getTestFilterData() $inner[] = new MockSplFileInfo([ 'name' => 'unreadable-file.txt', - 'contents' => false, + 'contents' => '', 'type' => 'file', 'mode' => 'r+', ] ); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php index 57146e1ecfa2..5f61b34ac19c 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php @@ -20,7 +20,7 @@ class CountryTypeTest extends BaseTypeTestCase protected function setUp(): void { - IntlTestHelper::requireIntl($this, false); + IntlTestHelper::requireIntl($this); parent::setUp(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php index 51aaf6b372af..ff6c5c17fb3d 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php @@ -20,7 +20,7 @@ class CurrencyTypeTest extends BaseTypeTestCase protected function setUp(): void { - IntlTestHelper::requireIntl($this, false); + IntlTestHelper::requireIntl($this); parent::setUp(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php index 1e143b342fcf..8144f535e9a0 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php @@ -21,7 +21,7 @@ class IntegerTypeTest extends BaseTypeTestCase protected function setUp(): void { - IntlTestHelper::requireIntl($this, false); + IntlTestHelper::requireIntl($this); $this->previousLocale = \Locale::getDefault(); parent::setUp(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php index e214e0afd434..405696ae0085 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php @@ -21,7 +21,7 @@ class LanguageTypeTest extends BaseTypeTestCase protected function setUp(): void { - IntlTestHelper::requireIntl($this, false); + IntlTestHelper::requireIntl($this); parent::setUp(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php index 8486b6656bd6..6acd181d10d4 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php @@ -20,7 +20,7 @@ class LocaleTypeTest extends BaseTypeTestCase protected function setUp(): void { - IntlTestHelper::requireIntl($this, false); + IntlTestHelper::requireIntl($this); parent::setUp(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php index 9966b40438aa..bd68c5a7f303 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php @@ -143,7 +143,7 @@ public function testIntlTimeZoneInputWithBcAndIntl() public function testTimezonesAreSelectableWithIntl() { - IntlTestHelper::requireIntl($this, false); + IntlTestHelper::requireIntl($this); $choices = $this->factory->create(static::TESTED_TYPE, null, ['intl' => true]) ->createView()->vars['choices']; diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php index fe700c927f1c..995930e68bfc 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php @@ -104,13 +104,13 @@ public static function provideSessionOptions(): \Generator yield 'set_cookiesecure_auto_by_symfony_false_by_php' => [ 'phpSessionOptions' => ['secure' => false], - 'sessionOptions' => ['cookie_path' => '/test/', 'cookie_httponly' => 'auto', 'cookie_secure' => 'auto', 'cookie_samesite' => Cookie::SAMESITE_LAX], + 'sessionOptions' => ['cookie_path' => '/test/', 'cookie_httponly' => true, 'cookie_secure' => 'auto', 'cookie_samesite' => Cookie::SAMESITE_LAX], 'expectedSessionOptions' => ['cookie_path' => '/test/', 'cookie_domain' => '', 'cookie_secure' => false, 'cookie_httponly' => true, 'cookie_samesite' => Cookie::SAMESITE_LAX], ]; yield 'set_cookiesecure_auto_by_symfony_true_by_php' => [ 'phpSessionOptions' => ['secure' => true], - 'sessionOptions' => ['cookie_path' => '/test/', 'cookie_httponly' => 'auto', 'cookie_secure' => 'auto', 'cookie_samesite' => Cookie::SAMESITE_LAX], + 'sessionOptions' => ['cookie_path' => '/test/', 'cookie_httponly' => true, 'cookie_secure' => 'auto', 'cookie_samesite' => Cookie::SAMESITE_LAX], 'expectedSessionOptions' => ['cookie_path' => '/test/', 'cookie_domain' => '', 'cookie_secure' => true, 'cookie_httponly' => true, 'cookie_samesite' => Cookie::SAMESITE_LAX], ]; diff --git a/src/Symfony/Component/Mime/Tests/EmailTest.php b/src/Symfony/Component/Mime/Tests/EmailTest.php index 3aa86c5f9462..480c9b3e6fd3 100644 --- a/src/Symfony/Component/Mime/Tests/EmailTest.php +++ b/src/Symfony/Component/Mime/Tests/EmailTest.php @@ -477,7 +477,7 @@ private function generateSomeParts(): array public function testAttachments() { // inline part - $contents = file_get_contents($name = __DIR__.'/Fixtures/mimetypes/test', 'r'); + $contents = file_get_contents($name = __DIR__.'/Fixtures/mimetypes/test'); $att = new DataPart($file = fopen($name, 'r'), 'test'); $inline = (new DataPart($contents, 'test'))->asInline(); $e = new Email(); @@ -618,7 +618,7 @@ public function testHtmlBodyAcceptedTypes() $email->html(null); $this->assertNull($email->getHtmlBody()); - $contents = file_get_contents(__DIR__.'/Fixtures/mimetypes/test', 'r'); + $contents = file_get_contents(__DIR__.'/Fixtures/mimetypes/test'); $email->html($contents); $this->assertSame($contents, $email->getHtmlBody()); } @@ -641,7 +641,7 @@ public function testTextBodyAcceptedTypes() $email->text(null); $this->assertNull($email->getTextBody()); - $contents = file_get_contents(__DIR__.'/Fixtures/mimetypes/test', 'r'); + $contents = file_get_contents(__DIR__.'/Fixtures/mimetypes/test'); $email->text($contents); $this->assertSame($contents, $email->getTextBody()); } diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php b/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php index 5dc6e4ff1565..431a7f4bf654 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php @@ -128,7 +128,7 @@ public function disableMagicSet(): static */ public function isMagicCallEnabled(): bool { - return (bool) ($this->magicMethods & PropertyAccessor::MAGIC_CALL); + return $this->magicMethods & PropertyAccessor::MAGIC_CALL; } /** diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php index df985137c784..3b257026fdba 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php @@ -121,7 +121,7 @@ public static function getInvalidIsbn() public function testNullIsValid() { - $constraint = new Isbn(true); + $constraint = new Isbn(); $this->validator->validate(null, $constraint); @@ -130,7 +130,7 @@ public function testNullIsValid() public function testEmptyStringIsValid() { - $constraint = new Isbn(true); + $constraint = new Isbn(); $this->validator->validate('', $constraint); @@ -140,7 +140,7 @@ public function testEmptyStringIsValid() public function testExpectsStringCompatibleType() { $this->expectException(UnexpectedValueException::class); - $constraint = new Isbn(true); + $constraint = new Isbn(); $this->validator->validate(new \stdClass(), $constraint); } diff --git a/src/Symfony/Component/Workflow/Dumper/GraphvizDumper.php b/src/Symfony/Component/Workflow/Dumper/GraphvizDumper.php index 36a5be9caf42..652e8863d281 100644 --- a/src/Symfony/Component/Workflow/Dumper/GraphvizDumper.php +++ b/src/Symfony/Component/Workflow/Dumper/GraphvizDumper.php @@ -141,7 +141,7 @@ protected function findTransitions(Definition $definition, bool $withMetadata): /** * @internal */ - protected function addPlaces(array $places, float $withMetadata): string + protected function addPlaces(array $places, bool $withMetadata): string { $code = ''; @@ -303,7 +303,7 @@ protected function addAttributes(array $attributes): string * * @internal */ - protected function formatLabel(Definition $definition, string $withMetadata, array $options): string + protected function formatLabel(Definition $definition, bool $withMetadata, array $options): string { $currentLabel = $options['label'] ?? ''; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy