diff --git a/src/Symfony/Bridge/Twig/Mime/WrappedTemplatedEmail.php b/src/Symfony/Bridge/Twig/Mime/WrappedTemplatedEmail.php index afde5f933d30a..ff88ecaeb5088 100644 --- a/src/Symfony/Bridge/Twig/Mime/WrappedTemplatedEmail.php +++ b/src/Symfony/Bridge/Twig/Mime/WrappedTemplatedEmail.php @@ -63,7 +63,7 @@ public function attach(string $file, string $name = null, string $contentType = /** * @return $this */ - public function setSubject(string $subject) + public function setSubject(string $subject): self { $this->message->subject($subject); @@ -78,7 +78,7 @@ public function getSubject(): ?string /** * @return $this */ - public function setReturnPath(string $address) + public function setReturnPath(string $address): self { $this->message->returnPath($address); @@ -93,7 +93,7 @@ public function getReturnPath(): string /** * @return $this */ - public function addFrom(string $address, string $name = null) + public function addFrom(string $address, string $name = null): self { $this->message->addFrom($name ? new NamedAddress($address, $name) : new Address($address)); @@ -111,7 +111,7 @@ public function getFrom(): array /** * @return $this */ - public function addReplyTo(string $address) + public function addReplyTo(string $address): self { $this->message->addReplyTo($address); @@ -129,7 +129,7 @@ public function getReplyTo(): array /** * @return $this */ - public function addTo(string $address, string $name = null) + public function addTo(string $address, string $name = null): self { $this->message->addTo($name ? new NamedAddress($address, $name) : new Address($address)); @@ -147,7 +147,7 @@ public function getTo(): array /** * @return $this */ - public function addCc(string $address, string $name = null) + public function addCc(string $address, string $name = null): self { $this->message->addCc($name ? new NamedAddress($address, $name) : new Address($address)); @@ -165,7 +165,7 @@ public function getCc(): array /** * @return $this */ - public function addBcc(string $address, string $name = null) + public function addBcc(string $address, string $name = null): self { $this->message->addBcc($name ? new NamedAddress($address, $name) : new Address($address)); @@ -183,7 +183,7 @@ public function getBcc(): array /** * @return $this */ - public function setPriority(int $priority) + public function setPriority(int $priority): self { $this->message->setPriority($priority); diff --git a/src/Symfony/Component/Cache/CacheItem.php b/src/Symfony/Component/Cache/CacheItem.php index b8ab630f01bf2..0c761fd1fac0c 100644 --- a/src/Symfony/Component/Cache/CacheItem.php +++ b/src/Symfony/Component/Cache/CacheItem.php @@ -67,7 +67,7 @@ public function isHit() * * @return $this */ - public function set($value) + public function set($value): self { $this->value = $value; @@ -79,7 +79,7 @@ public function set($value) * * @return $this */ - public function expiresAt($expiration) + public function expiresAt($expiration): self { if (null === $expiration) { $this->expiry = $this->defaultLifetime > 0 ? microtime(true) + $this->defaultLifetime : null; @@ -97,7 +97,7 @@ public function expiresAt($expiration) * * @return $this */ - public function expiresAfter($time) + public function expiresAfter($time): self { if (null === $time) { $this->expiry = $this->defaultLifetime > 0 ? microtime(true) + $this->defaultLifetime : null; diff --git a/src/Symfony/Component/CssSelector/Parser/TokenStream.php b/src/Symfony/Component/CssSelector/Parser/TokenStream.php index cc7755ff6ada4..f4c2585aa03b2 100644 --- a/src/Symfony/Component/CssSelector/Parser/TokenStream.php +++ b/src/Symfony/Component/CssSelector/Parser/TokenStream.php @@ -56,7 +56,7 @@ class TokenStream * * @return $this */ - public function push(Token $token) + public function push(Token $token): self { $this->tokens[] = $token; @@ -68,7 +68,7 @@ public function push(Token $token) * * @return $this */ - public function freeze() + public function freeze(): self { return $this; } diff --git a/src/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php b/src/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php index 3607022891f95..1a74b90acc6c3 100644 --- a/src/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php +++ b/src/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php @@ -30,40 +30,38 @@ interface ExtensionInterface * * @return callable[] */ - public function getNodeTranslators(); + public function getNodeTranslators(): array; /** * Returns combination translators. * * @return callable[] */ - public function getCombinationTranslators(); + public function getCombinationTranslators(): array; /** * Returns function translators. * * @return callable[] */ - public function getFunctionTranslators(); + public function getFunctionTranslators(): array; /** * Returns pseudo-class translators. * * @return callable[] */ - public function getPseudoClassTranslators(); + public function getPseudoClassTranslators(): array; /** * Returns attribute operation translators. * * @return callable[] */ - public function getAttributeMatchingTranslators(); + public function getAttributeMatchingTranslators(): array; /** * Returns extension name. - * - * @return string */ - public function getName(); + public function getName(): string; } diff --git a/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php b/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php index 9978ed31426cd..3a26a886d7bc4 100644 --- a/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php +++ b/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php @@ -41,7 +41,7 @@ public function __construct(int $flags = 0) /** * @return $this */ - public function setFlag(int $flag, bool $on) + public function setFlag(int $flag, bool $on): self { if ($on && !$this->hasFlag($flag)) { $this->flags += $flag; diff --git a/src/Symfony/Component/DependencyInjection/ChildDefinition.php b/src/Symfony/Component/DependencyInjection/ChildDefinition.php index e58620dcb53ea..7718f725b18bd 100644 --- a/src/Symfony/Component/DependencyInjection/ChildDefinition.php +++ b/src/Symfony/Component/DependencyInjection/ChildDefinition.php @@ -109,7 +109,7 @@ public function replaceArgument($index, $value) /** * @internal */ - public function setAutoconfigured($autoconfigured) + public function setAutoconfigured($autoconfigured): self { throw new BadMethodCallException('A ChildDefinition cannot be autoconfigured.'); } @@ -117,7 +117,7 @@ public function setAutoconfigured($autoconfigured) /** * @internal */ - public function setInstanceofConditionals(array $instanceof) + public function setInstanceofConditionals(array $instanceof): self { throw new BadMethodCallException('A ChildDefinition cannot have instanceof conditionals set on it.'); } diff --git a/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php b/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php index 76e6d35a795d4..264dd8046c819 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php @@ -137,7 +137,7 @@ public function freezeAfterProcessing(Extension $extension, ContainerBuilder $co /** * {@inheritdoc} */ - public function getEnvPlaceholders() + public function getEnvPlaceholders(): array { return null !== $this->processedEnvPlaceholders ? $this->processedEnvPlaceholders : parent::getEnvPlaceholders(); } @@ -167,7 +167,7 @@ public function __construct(ExtensionInterface $extension, ParameterBagInterface /** * {@inheritdoc} */ - public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0) + public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0): self { throw new LogicException(sprintf('You cannot add compiler pass "%s" from extension "%s". Compiler passes must be registered before the container is compiled.', \get_class($pass), $this->extensionClass)); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ScalarFactory.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ScalarFactory.php index 15646a8d0c5d7..72f6f918075aa 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ScalarFactory.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ScalarFactory.php @@ -7,7 +7,7 @@ final class ScalarFactory /** * @return string */ - public static function getSomeValue() + public static function getSomeValue(): string { return 'some value'; } diff --git a/src/Symfony/Component/Form/Util/OptionsResolverWrapper.php b/src/Symfony/Component/Form/Util/OptionsResolverWrapper.php index cd862d9eb98ff..fbf19ab638ae8 100644 --- a/src/Symfony/Component/Form/Util/OptionsResolverWrapper.php +++ b/src/Symfony/Component/Form/Util/OptionsResolverWrapper.php @@ -24,7 +24,10 @@ class OptionsResolverWrapper extends OptionsResolver { private $undefined = []; - public function setNormalizer($option, \Closure $normalizer) + /** + * @return $this + */ + public function setNormalizer($option, \Closure $normalizer): self { try { parent::setNormalizer($option, $normalizer); @@ -35,7 +38,10 @@ public function setNormalizer($option, \Closure $normalizer) return $this; } - public function setAllowedValues($option, $allowedValues) + /** + * @return $this + */ + public function setAllowedValues($option, $allowedValues): self { try { parent::setAllowedValues($option, $allowedValues); @@ -46,7 +52,10 @@ public function setAllowedValues($option, $allowedValues) return $this; } - public function addAllowedValues($option, $allowedValues) + /** + * @return $this + */ + public function addAllowedValues($option, $allowedValues): self { try { parent::addAllowedValues($option, $allowedValues); @@ -57,7 +66,10 @@ public function addAllowedValues($option, $allowedValues) return $this; } - public function setAllowedTypes($option, $allowedTypes) + /** + * @return $this + */ + public function setAllowedTypes($option, $allowedTypes): self { try { parent::setAllowedTypes($option, $allowedTypes); @@ -68,7 +80,10 @@ public function setAllowedTypes($option, $allowedTypes) return $this; } - public function addAllowedTypes($option, $allowedTypes) + /** + * @return $this + */ + public function addAllowedTypes($option, $allowedTypes): self { try { parent::addAllowedTypes($option, $allowedTypes); @@ -84,7 +99,7 @@ public function resolve(array $options = []): array throw new AccessException('Resolve options is not supported.'); } - public function getUndefinedOptions() + public function getUndefinedOptions(): array { return array_keys($this->undefined); } diff --git a/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php b/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php index 19e324dc24957..7dac296c0c7d0 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php +++ b/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php @@ -58,7 +58,7 @@ public function supports(Request $request, ArgumentMetadata $argument) /** * {@inheritdoc} */ - public function resolve(Request $request, ArgumentMetadata $argument) + public function resolve(Request $request, ArgumentMetadata $argument): iterable { if (\is_array($controller = $request->attributes->get('_controller'))) { $controller = $controller[0].'::'.$controller[1]; diff --git a/src/Symfony/Component/HttpKernel/HttpClientKernel.php b/src/Symfony/Component/HttpKernel/HttpClientKernel.php index 4af107d1665e9..c8421a4b10415 100644 --- a/src/Symfony/Component/HttpKernel/HttpClientKernel.php +++ b/src/Symfony/Component/HttpKernel/HttpClientKernel.php @@ -39,7 +39,7 @@ public function __construct(HttpClientInterface $client = null) $this->client = $client ?? HttpClient::create(); } - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response { $headers = $this->getHeaders($request); $body = ''; diff --git a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php index 541187cfecd5c..5797bdc41587a 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php @@ -47,7 +47,7 @@ public function __construct(string $dsn) /** * {@inheritdoc} */ - public function find($ip, $url, $limit, $method, $start = null, $end = null, $statusCode = null) + public function find($ip, $url, $limit, $method, $start = null, $end = null, $statusCode = null): array { $file = $this->getIndexFilename(); @@ -113,7 +113,7 @@ public function purge() /** * {@inheritdoc} */ - public function read($token) + public function read($token): ?Profile { if (!$token || !file_exists($file = $this->getFilename($token))) { return null; @@ -127,7 +127,7 @@ public function read($token) * * @throws \RuntimeException */ - public function write(Profile $profile) + public function write(Profile $profile): bool { $file = $this->getFilename($profile->getToken()); diff --git a/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php b/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php index c97e640b60325..d13ee23220432 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php +++ b/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php @@ -38,7 +38,7 @@ interface ProfilerStorageInterface * * @return array An array of tokens */ - public function find($ip, $url, $limit, $method, $start = null, $end = null); + public function find($ip, $url, $limit, $method, $start = null, $end = null): array; /** * Reads data associated with the given token. @@ -49,14 +49,14 @@ public function find($ip, $url, $limit, $method, $start = null, $end = null); * * @return Profile|null The profile associated with token */ - public function read($token); + public function read($token): ?Profile; /** * Saves a Profile. * * @return bool Write operation successful */ - public function write(Profile $profile); + public function write(Profile $profile): bool; /** * Purges all data from the database. diff --git a/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php index 11345336e53a7..ac5652cdc48a4 100644 --- a/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php @@ -159,10 +159,7 @@ protected function generateDataForMeta(BundleEntryReaderInterface $reader, strin ]; } - /** - * @return array - */ - protected function generateRegionNames(ArrayAccessibleResourceBundle $localeBundle) + protected function generateRegionNames(ArrayAccessibleResourceBundle $localeBundle): array { $unfilteredRegionNames = iterator_to_array($localeBundle['Countries']); $regionNames = []; diff --git a/src/Symfony/Component/Ldap/Security/LdapUser.php b/src/Symfony/Component/Ldap/Security/LdapUser.php index 68c7148ffe21e..c8f39728320d4 100644 --- a/src/Symfony/Component/Ldap/Security/LdapUser.php +++ b/src/Symfony/Component/Ldap/Security/LdapUser.php @@ -49,7 +49,7 @@ public function getEntry(): Entry /** * {@inheritdoc} */ - public function getRoles() + public function getRoles(): array { return $this->roles; } diff --git a/src/Symfony/Component/Mime/Header/Headers.php b/src/Symfony/Component/Mime/Header/Headers.php index dc8cb3476ba3c..1c054e2813c86 100644 --- a/src/Symfony/Component/Mime/Header/Headers.php +++ b/src/Symfony/Component/Mime/Header/Headers.php @@ -64,7 +64,7 @@ public function getMaxLineLength(): int * * @return $this */ - public function addMailboxListHeader(string $name, array $addresses) + public function addMailboxListHeader(string $name, array $addresses): self { return $this->add(new MailboxListHeader($name, Address::createArray($addresses))); } @@ -74,7 +74,7 @@ public function addMailboxListHeader(string $name, array $addresses) * * @return $this */ - public function addMailboxHeader(string $name, $address) + public function addMailboxHeader(string $name, $address): self { return $this->add(new MailboxHeader($name, Address::create($address))); } @@ -84,7 +84,7 @@ public function addMailboxHeader(string $name, $address) * * @return $this */ - public function addIdHeader(string $name, $ids) + public function addIdHeader(string $name, $ids): self { return $this->add(new IdentificationHeader($name, $ids)); } @@ -94,7 +94,7 @@ public function addIdHeader(string $name, $ids) * * @return $this */ - public function addPathHeader(string $name, $path) + public function addPathHeader(string $name, $path): self { return $this->add(new PathHeader($name, $path instanceof Address ? $path : new Address($path))); } @@ -102,7 +102,7 @@ public function addPathHeader(string $name, $path) /** * @return $this */ - public function addDateHeader(string $name, \DateTimeInterface $dateTime) + public function addDateHeader(string $name, \DateTimeInterface $dateTime): self { return $this->add(new DateHeader($name, $dateTime)); } @@ -110,7 +110,7 @@ public function addDateHeader(string $name, \DateTimeInterface $dateTime) /** * @return $this */ - public function addTextHeader(string $name, string $value) + public function addTextHeader(string $name, string $value): self { return $this->add(new UnstructuredHeader($name, $value)); } @@ -118,7 +118,7 @@ public function addTextHeader(string $name, string $value) /** * @return $this */ - public function addParameterizedHeader(string $name, string $value, array $params = []) + public function addParameterizedHeader(string $name, string $value, array $params = []): self { return $this->add(new ParameterizedHeader($name, $value, $params)); } @@ -131,7 +131,7 @@ public function has(string $name): bool /** * @return $this */ - public function add(HeaderInterface $header) + public function add(HeaderInterface $header): self { static $map = [ 'date' => DateHeader::class, diff --git a/src/Symfony/Component/Security/Core/Encoder/NativePasswordEncoder.php b/src/Symfony/Component/Security/Core/Encoder/NativePasswordEncoder.php index e88f6d394c63d..351943764d3bd 100644 --- a/src/Symfony/Component/Security/Core/Encoder/NativePasswordEncoder.php +++ b/src/Symfony/Component/Security/Core/Encoder/NativePasswordEncoder.php @@ -57,7 +57,7 @@ public function __construct(int $opsLimit = null, int $memLimit = null, int $cos /** * {@inheritdoc} */ - public function encodePassword($raw, $salt) + public function encodePassword($raw, $salt): string { if (\strlen($raw) > self::MAX_PASSWORD_LENGTH) { throw new BadCredentialsException('Invalid password.'); diff --git a/src/Symfony/Component/Serializer/Mapping/AttributeMetadata.php b/src/Symfony/Component/Serializer/Mapping/AttributeMetadata.php index a49051113dc13..b466af936d288 100644 --- a/src/Symfony/Component/Serializer/Mapping/AttributeMetadata.php +++ b/src/Symfony/Component/Serializer/Mapping/AttributeMetadata.php @@ -58,7 +58,7 @@ public function __construct(string $name) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return $this->name; } @@ -76,7 +76,7 @@ public function addGroup($group) /** * {@inheritdoc} */ - public function getGroups() + public function getGroups(): array { return $this->groups; } diff --git a/src/Symfony/Component/Serializer/Mapping/AttributeMetadataInterface.php b/src/Symfony/Component/Serializer/Mapping/AttributeMetadataInterface.php index bbbde922a8e9c..1df90b98fb524 100644 --- a/src/Symfony/Component/Serializer/Mapping/AttributeMetadataInterface.php +++ b/src/Symfony/Component/Serializer/Mapping/AttributeMetadataInterface.php @@ -24,10 +24,8 @@ interface AttributeMetadataInterface { /** * Gets the attribute name. - * - * @return string */ - public function getName(); + public function getName(): string; /** * Adds this attribute to the given group. @@ -41,7 +39,7 @@ public function addGroup($group); * * @return string[] */ - public function getGroups(); + public function getGroups(): array; /** * Sets the serialization max depth for this attribute. diff --git a/src/Symfony/Component/Serializer/Mapping/ClassMetadata.php b/src/Symfony/Component/Serializer/Mapping/ClassMetadata.php index 670ebcc1ffb94..65b42ceba7539 100644 --- a/src/Symfony/Component/Serializer/Mapping/ClassMetadata.php +++ b/src/Symfony/Component/Serializer/Mapping/ClassMetadata.php @@ -60,7 +60,7 @@ public function __construct(string $class, ClassDiscriminatorMapping $classDiscr /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return $this->name; } @@ -76,7 +76,7 @@ public function addAttributeMetadata(AttributeMetadataInterface $attributeMetada /** * {@inheritdoc} */ - public function getAttributesMetadata() + public function getAttributesMetadata(): array { return $this->attributesMetadata; } @@ -98,7 +98,7 @@ public function merge(ClassMetadataInterface $classMetadata) /** * {@inheritdoc} */ - public function getReflectionClass() + public function getReflectionClass(): \ReflectionClass { if (!$this->reflClass) { $this->reflClass = new \ReflectionClass($this->getName()); @@ -110,7 +110,7 @@ public function getReflectionClass() /** * {@inheritdoc} */ - public function getClassDiscriminatorMapping() + public function getClassDiscriminatorMapping(): ?ClassDiscriminatorMapping { return $this->classDiscriminatorMapping; } diff --git a/src/Symfony/Component/Serializer/Mapping/ClassMetadataInterface.php b/src/Symfony/Component/Serializer/Mapping/ClassMetadataInterface.php index a8c6d02fe506a..d8c3cc776a9cd 100644 --- a/src/Symfony/Component/Serializer/Mapping/ClassMetadataInterface.php +++ b/src/Symfony/Component/Serializer/Mapping/ClassMetadataInterface.php @@ -29,7 +29,7 @@ interface ClassMetadataInterface * * @return string The name of the backing class */ - public function getName(); + public function getName(): string; /** * Adds an {@link AttributeMetadataInterface}. @@ -41,7 +41,7 @@ public function addAttributeMetadata(AttributeMetadataInterface $attributeMetada * * @return AttributeMetadataInterface[] */ - public function getAttributesMetadata(); + public function getAttributesMetadata(): array; /** * Merges a {@link ClassMetadataInterface} in the current one. @@ -50,15 +50,10 @@ public function merge(self $classMetadata); /** * Returns a {@link \ReflectionClass} instance for this class. - * - * @return \ReflectionClass */ - public function getReflectionClass(); + public function getReflectionClass(): \ReflectionClass; - /** - * @return ClassDiscriminatorMapping|null - */ - public function getClassDiscriminatorMapping(); + public function getClassDiscriminatorMapping(): ?ClassDiscriminatorMapping; public function setClassDiscriminatorMapping(ClassDiscriminatorMapping $mapping = null); }
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: