minor #33264 [4.4] Add return types on internal|final|private methods (bis) (nicolas-grekas)
This PR was merged into the 4.4 branch.
Discussion
----------
[4.4] Add return types on internal|final|private methods (bis)
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Found while working on #33259
`: self` is used for final methods only. I'd have preferred using `: object` but that's not possible on PHP 7.1
Commits
-------
23faee406f
[4.4] Add return types on internal|final|private methods (bis)
This commit is contained in:
commit
22319a9935
@ -63,7 +63,7 @@ final class WrappedTemplatedEmail
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setSubject(string $subject)
|
public function setSubject(string $subject): self
|
||||||
{
|
{
|
||||||
$this->message->subject($subject);
|
$this->message->subject($subject);
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ final class WrappedTemplatedEmail
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setReturnPath(string $address)
|
public function setReturnPath(string $address): self
|
||||||
{
|
{
|
||||||
$this->message->returnPath($address);
|
$this->message->returnPath($address);
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ final class WrappedTemplatedEmail
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @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));
|
$this->message->addFrom($name ? new NamedAddress($address, $name) : new Address($address));
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ final class WrappedTemplatedEmail
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function addReplyTo(string $address)
|
public function addReplyTo(string $address): self
|
||||||
{
|
{
|
||||||
$this->message->addReplyTo($address);
|
$this->message->addReplyTo($address);
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ final class WrappedTemplatedEmail
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @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));
|
$this->message->addTo($name ? new NamedAddress($address, $name) : new Address($address));
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ final class WrappedTemplatedEmail
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @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));
|
$this->message->addCc($name ? new NamedAddress($address, $name) : new Address($address));
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ final class WrappedTemplatedEmail
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @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));
|
$this->message->addBcc($name ? new NamedAddress($address, $name) : new Address($address));
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ final class WrappedTemplatedEmail
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setPriority(int $priority)
|
public function setPriority(int $priority): self
|
||||||
{
|
{
|
||||||
$this->message->setPriority($priority);
|
$this->message->setPriority($priority);
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ final class CacheItem implements ItemInterface
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function set($value)
|
public function set($value): self
|
||||||
{
|
{
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ final class CacheItem implements ItemInterface
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function expiresAt($expiration)
|
public function expiresAt($expiration): self
|
||||||
{
|
{
|
||||||
if (null === $expiration) {
|
if (null === $expiration) {
|
||||||
$this->expiry = $this->defaultLifetime > 0 ? microtime(true) + $this->defaultLifetime : null;
|
$this->expiry = $this->defaultLifetime > 0 ? microtime(true) + $this->defaultLifetime : null;
|
||||||
@ -97,7 +97,7 @@ final class CacheItem implements ItemInterface
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function expiresAfter($time)
|
public function expiresAfter($time): self
|
||||||
{
|
{
|
||||||
if (null === $time) {
|
if (null === $time) {
|
||||||
$this->expiry = $this->defaultLifetime > 0 ? microtime(true) + $this->defaultLifetime : null;
|
$this->expiry = $this->defaultLifetime > 0 ? microtime(true) + $this->defaultLifetime : null;
|
||||||
|
@ -56,7 +56,7 @@ class TokenStream
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function push(Token $token)
|
public function push(Token $token): self
|
||||||
{
|
{
|
||||||
$this->tokens[] = $token;
|
$this->tokens[] = $token;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class TokenStream
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function freeze()
|
public function freeze(): self
|
||||||
{
|
{
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -30,40 +30,38 @@ interface ExtensionInterface
|
|||||||
*
|
*
|
||||||
* @return callable[]
|
* @return callable[]
|
||||||
*/
|
*/
|
||||||
public function getNodeTranslators();
|
public function getNodeTranslators(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns combination translators.
|
* Returns combination translators.
|
||||||
*
|
*
|
||||||
* @return callable[]
|
* @return callable[]
|
||||||
*/
|
*/
|
||||||
public function getCombinationTranslators();
|
public function getCombinationTranslators(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns function translators.
|
* Returns function translators.
|
||||||
*
|
*
|
||||||
* @return callable[]
|
* @return callable[]
|
||||||
*/
|
*/
|
||||||
public function getFunctionTranslators();
|
public function getFunctionTranslators(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pseudo-class translators.
|
* Returns pseudo-class translators.
|
||||||
*
|
*
|
||||||
* @return callable[]
|
* @return callable[]
|
||||||
*/
|
*/
|
||||||
public function getPseudoClassTranslators();
|
public function getPseudoClassTranslators(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns attribute operation translators.
|
* Returns attribute operation translators.
|
||||||
*
|
*
|
||||||
* @return callable[]
|
* @return callable[]
|
||||||
*/
|
*/
|
||||||
public function getAttributeMatchingTranslators();
|
public function getAttributeMatchingTranslators(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns extension name.
|
* Returns extension name.
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function getName();
|
public function getName(): string;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ class NodeExtension extends AbstractExtension
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setFlag(int $flag, bool $on)
|
public function setFlag(int $flag, bool $on): self
|
||||||
{
|
{
|
||||||
if ($on && !$this->hasFlag($flag)) {
|
if ($on && !$this->hasFlag($flag)) {
|
||||||
$this->flags += $flag;
|
$this->flags += $flag;
|
||||||
|
@ -109,7 +109,7 @@ class ChildDefinition extends Definition
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
public function setAutoconfigured($autoconfigured)
|
public function setAutoconfigured($autoconfigured): self
|
||||||
{
|
{
|
||||||
throw new BadMethodCallException('A ChildDefinition cannot be autoconfigured.');
|
throw new BadMethodCallException('A ChildDefinition cannot be autoconfigured.');
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ class ChildDefinition extends Definition
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
public function setInstanceofConditionals(array $instanceof)
|
public function setInstanceofConditionals(array $instanceof): self
|
||||||
{
|
{
|
||||||
throw new BadMethodCallException('A ChildDefinition cannot have instanceof conditionals set on it.');
|
throw new BadMethodCallException('A ChildDefinition cannot have instanceof conditionals set on it.');
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ class MergeExtensionConfigurationParameterBag extends EnvPlaceholderParameterBag
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getEnvPlaceholders()
|
public function getEnvPlaceholders(): array
|
||||||
{
|
{
|
||||||
return null !== $this->processedEnvPlaceholders ? $this->processedEnvPlaceholders : parent::getEnvPlaceholders();
|
return null !== $this->processedEnvPlaceholders ? $this->processedEnvPlaceholders : parent::getEnvPlaceholders();
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ class MergeExtensionConfigurationContainerBuilder extends ContainerBuilder
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@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));
|
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));
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class DefaultsConfigurator extends AbstractServiceConfigurator
|
|||||||
*
|
*
|
||||||
* @throws InvalidArgumentException when an invalid tag name or attribute is provided
|
* @throws InvalidArgumentException when an invalid tag name or attribute is provided
|
||||||
*/
|
*/
|
||||||
final public function tag(string $name, array $attributes = [])
|
final public function tag(string $name, array $attributes = []): self
|
||||||
{
|
{
|
||||||
if ('' === $name) {
|
if ('' === $name) {
|
||||||
throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
|
throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
|
||||||
|
@ -32,7 +32,7 @@ class ParametersConfigurator extends AbstractConfigurator
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
final public function set(string $name, $value)
|
final public function set(string $name, $value): self
|
||||||
{
|
{
|
||||||
$this->container->setParameter($name, static::processValue($value, true));
|
$this->container->setParameter($name, static::processValue($value, true));
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ class ParametersConfigurator extends AbstractConfigurator
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
final public function __invoke(string $name, $value)
|
final public function __invoke(string $name, $value): self
|
||||||
{
|
{
|
||||||
return $this->set($name, $value);
|
return $this->set($name, $value);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class ReferenceConfigurator extends AbstractConfigurator
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
final public function ignoreOnInvalid()
|
final public function ignoreOnInvalid(): self
|
||||||
{
|
{
|
||||||
$this->invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
|
$this->invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ class ReferenceConfigurator extends AbstractConfigurator
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
final public function nullOnInvalid()
|
final public function nullOnInvalid(): self
|
||||||
{
|
{
|
||||||
$this->invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
|
$this->invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ class ReferenceConfigurator extends AbstractConfigurator
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
final public function ignoreOnUninitialized()
|
final public function ignoreOnUninitialized(): self
|
||||||
{
|
{
|
||||||
$this->invalidBehavior = ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE;
|
$this->invalidBehavior = ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ final class ScalarFactory
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getSomeValue()
|
public static function getSomeValue(): string
|
||||||
{
|
{
|
||||||
return 'some value';
|
return 'some value';
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,10 @@ class OptionsResolverWrapper extends OptionsResolver
|
|||||||
{
|
{
|
||||||
private $undefined = [];
|
private $undefined = [];
|
||||||
|
|
||||||
public function setNormalizer($option, \Closure $normalizer)
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setNormalizer($option, \Closure $normalizer): self
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
parent::setNormalizer($option, $normalizer);
|
parent::setNormalizer($option, $normalizer);
|
||||||
@ -35,7 +38,10 @@ class OptionsResolverWrapper extends OptionsResolver
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAllowedValues($option, $allowedValues)
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setAllowedValues($option, $allowedValues): self
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
parent::setAllowedValues($option, $allowedValues);
|
parent::setAllowedValues($option, $allowedValues);
|
||||||
@ -46,7 +52,10 @@ class OptionsResolverWrapper extends OptionsResolver
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addAllowedValues($option, $allowedValues)
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function addAllowedValues($option, $allowedValues): self
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
parent::addAllowedValues($option, $allowedValues);
|
parent::addAllowedValues($option, $allowedValues);
|
||||||
@ -57,7 +66,10 @@ class OptionsResolverWrapper extends OptionsResolver
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAllowedTypes($option, $allowedTypes)
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setAllowedTypes($option, $allowedTypes): self
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
parent::setAllowedTypes($option, $allowedTypes);
|
parent::setAllowedTypes($option, $allowedTypes);
|
||||||
@ -68,7 +80,10 @@ class OptionsResolverWrapper extends OptionsResolver
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addAllowedTypes($option, $allowedTypes)
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function addAllowedTypes($option, $allowedTypes): self
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
parent::addAllowedTypes($option, $allowedTypes);
|
parent::addAllowedTypes($option, $allowedTypes);
|
||||||
@ -84,7 +99,7 @@ class OptionsResolverWrapper extends OptionsResolver
|
|||||||
throw new AccessException('Resolve options is not supported.');
|
throw new AccessException('Resolve options is not supported.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUndefinedOptions()
|
public function getUndefinedOptions(): array
|
||||||
{
|
{
|
||||||
return array_keys($this->undefined);
|
return array_keys($this->undefined);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ final class NotTaggedControllerValueResolver implements ArgumentValueResolverInt
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function resolve(Request $request, ArgumentMetadata $argument)
|
public function resolve(Request $request, ArgumentMetadata $argument): iterable
|
||||||
{
|
{
|
||||||
if (\is_array($controller = $request->attributes->get('_controller'))) {
|
if (\is_array($controller = $request->attributes->get('_controller'))) {
|
||||||
$controller = $controller[0].'::'.$controller[1];
|
$controller = $controller[0].'::'.$controller[1];
|
||||||
|
@ -39,7 +39,7 @@ final class HttpClientKernel implements HttpKernelInterface
|
|||||||
$this->client = $client ?? HttpClient::create();
|
$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);
|
$headers = $this->getHeaders($request);
|
||||||
$body = '';
|
$body = '';
|
||||||
|
@ -47,7 +47,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@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();
|
$file = $this->getIndexFilename();
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function read($token)
|
public function read($token): ?Profile
|
||||||
{
|
{
|
||||||
if (!$token || !file_exists($file = $this->getFilename($token))) {
|
if (!$token || !file_exists($file = $this->getFilename($token))) {
|
||||||
return null;
|
return null;
|
||||||
@ -127,7 +127,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
|||||||
*
|
*
|
||||||
* @throws \RuntimeException
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function write(Profile $profile)
|
public function write(Profile $profile): bool
|
||||||
{
|
{
|
||||||
$file = $this->getFilename($profile->getToken());
|
$file = $this->getFilename($profile->getToken());
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ interface ProfilerStorageInterface
|
|||||||
*
|
*
|
||||||
* @return array An array of tokens
|
* @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.
|
* Reads data associated with the given token.
|
||||||
@ -49,14 +49,14 @@ interface ProfilerStorageInterface
|
|||||||
*
|
*
|
||||||
* @return Profile|null The profile associated with token
|
* @return Profile|null The profile associated with token
|
||||||
*/
|
*/
|
||||||
public function read($token);
|
public function read($token): ?Profile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a Profile.
|
* Saves a Profile.
|
||||||
*
|
*
|
||||||
* @return bool Write operation successful
|
* @return bool Write operation successful
|
||||||
*/
|
*/
|
||||||
public function write(Profile $profile);
|
public function write(Profile $profile): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Purges all data from the database.
|
* Purges all data from the database.
|
||||||
|
@ -159,10 +159,7 @@ class RegionDataGenerator extends AbstractDataGenerator
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
protected function generateRegionNames(ArrayAccessibleResourceBundle $localeBundle): array
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
protected function generateRegionNames(ArrayAccessibleResourceBundle $localeBundle)
|
|
||||||
{
|
{
|
||||||
$unfilteredRegionNames = iterator_to_array($localeBundle['Countries']);
|
$unfilteredRegionNames = iterator_to_array($localeBundle['Countries']);
|
||||||
$regionNames = [];
|
$regionNames = [];
|
||||||
|
@ -49,7 +49,7 @@ class LdapUser implements UserInterface, EquatableInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getRoles()
|
public function getRoles(): array
|
||||||
{
|
{
|
||||||
return $this->roles;
|
return $this->roles;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ final class Headers
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @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)));
|
return $this->add(new MailboxListHeader($name, Address::createArray($addresses)));
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ final class Headers
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function addMailboxHeader(string $name, $address)
|
public function addMailboxHeader(string $name, $address): self
|
||||||
{
|
{
|
||||||
return $this->add(new MailboxHeader($name, Address::create($address)));
|
return $this->add(new MailboxHeader($name, Address::create($address)));
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ final class Headers
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function addIdHeader(string $name, $ids)
|
public function addIdHeader(string $name, $ids): self
|
||||||
{
|
{
|
||||||
return $this->add(new IdentificationHeader($name, $ids));
|
return $this->add(new IdentificationHeader($name, $ids));
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ final class Headers
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @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)));
|
return $this->add(new PathHeader($name, $path instanceof Address ? $path : new Address($path)));
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ final class Headers
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function addDateHeader(string $name, \DateTimeInterface $dateTime)
|
public function addDateHeader(string $name, \DateTimeInterface $dateTime): self
|
||||||
{
|
{
|
||||||
return $this->add(new DateHeader($name, $dateTime));
|
return $this->add(new DateHeader($name, $dateTime));
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ final class Headers
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function addTextHeader(string $name, string $value)
|
public function addTextHeader(string $name, string $value): self
|
||||||
{
|
{
|
||||||
return $this->add(new UnstructuredHeader($name, $value));
|
return $this->add(new UnstructuredHeader($name, $value));
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ final class Headers
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @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));
|
return $this->add(new ParameterizedHeader($name, $value, $params));
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ final class Headers
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function add(HeaderInterface $header)
|
public function add(HeaderInterface $header): self
|
||||||
{
|
{
|
||||||
static $map = [
|
static $map = [
|
||||||
'date' => DateHeader::class,
|
'date' => DateHeader::class,
|
||||||
|
@ -60,7 +60,7 @@ class CollectionConfigurator
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
final public function prefix($prefix)
|
final public function prefix($prefix): self
|
||||||
{
|
{
|
||||||
if (\is_array($prefix)) {
|
if (\is_array($prefix)) {
|
||||||
if (null === $this->parentPrefixes) {
|
if (null === $this->parentPrefixes) {
|
||||||
|
@ -41,7 +41,7 @@ class ImportConfigurator
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
final public function prefix($prefix, bool $trailingSlashOnRoot = true)
|
final public function prefix($prefix, bool $trailingSlashOnRoot = true): self
|
||||||
{
|
{
|
||||||
if (!\is_array($prefix)) {
|
if (!\is_array($prefix)) {
|
||||||
$this->route->addPrefix($prefix);
|
$this->route->addPrefix($prefix);
|
||||||
@ -84,7 +84,7 @@ class ImportConfigurator
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
final public function namePrefix(string $namePrefix)
|
final public function namePrefix(string $namePrefix): self
|
||||||
{
|
{
|
||||||
$this->route->addNamePrefix($namePrefix);
|
$this->route->addNamePrefix($namePrefix);
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ final class NativePasswordEncoder implements PasswordEncoderInterface, SelfSalti
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function encodePassword($raw, $salt)
|
public function encodePassword($raw, $salt): string
|
||||||
{
|
{
|
||||||
if (\strlen($raw) > self::MAX_PASSWORD_LENGTH) {
|
if (\strlen($raw) > self::MAX_PASSWORD_LENGTH) {
|
||||||
throw new BadCredentialsException('Invalid password.');
|
throw new BadCredentialsException('Invalid password.');
|
||||||
|
@ -58,7 +58,7 @@ class AttributeMetadata implements AttributeMetadataInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getName()
|
public function getName(): string
|
||||||
{
|
{
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ class AttributeMetadata implements AttributeMetadataInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getGroups()
|
public function getGroups(): array
|
||||||
{
|
{
|
||||||
return $this->groups;
|
return $this->groups;
|
||||||
}
|
}
|
||||||
|
@ -24,10 +24,8 @@ interface AttributeMetadataInterface
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Gets the attribute name.
|
* Gets the attribute name.
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function getName();
|
public function getName(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds this attribute to the given group.
|
* Adds this attribute to the given group.
|
||||||
@ -41,7 +39,7 @@ interface AttributeMetadataInterface
|
|||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
public function getGroups();
|
public function getGroups(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the serialization max depth for this attribute.
|
* Sets the serialization max depth for this attribute.
|
||||||
|
@ -60,7 +60,7 @@ class ClassMetadata implements ClassMetadataInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getName()
|
public function getName(): string
|
||||||
{
|
{
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ class ClassMetadata implements ClassMetadataInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getAttributesMetadata()
|
public function getAttributesMetadata(): array
|
||||||
{
|
{
|
||||||
return $this->attributesMetadata;
|
return $this->attributesMetadata;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ class ClassMetadata implements ClassMetadataInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getReflectionClass()
|
public function getReflectionClass(): \ReflectionClass
|
||||||
{
|
{
|
||||||
if (!$this->reflClass) {
|
if (!$this->reflClass) {
|
||||||
$this->reflClass = new \ReflectionClass($this->getName());
|
$this->reflClass = new \ReflectionClass($this->getName());
|
||||||
@ -110,7 +110,7 @@ class ClassMetadata implements ClassMetadataInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getClassDiscriminatorMapping()
|
public function getClassDiscriminatorMapping(): ?ClassDiscriminatorMapping
|
||||||
{
|
{
|
||||||
return $this->classDiscriminatorMapping;
|
return $this->classDiscriminatorMapping;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ interface ClassMetadataInterface
|
|||||||
*
|
*
|
||||||
* @return string The name of the backing class
|
* @return string The name of the backing class
|
||||||
*/
|
*/
|
||||||
public function getName();
|
public function getName(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an {@link AttributeMetadataInterface}.
|
* Adds an {@link AttributeMetadataInterface}.
|
||||||
@ -41,7 +41,7 @@ interface ClassMetadataInterface
|
|||||||
*
|
*
|
||||||
* @return AttributeMetadataInterface[]
|
* @return AttributeMetadataInterface[]
|
||||||
*/
|
*/
|
||||||
public function getAttributesMetadata();
|
public function getAttributesMetadata(): array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merges a {@link ClassMetadataInterface} in the current one.
|
* Merges a {@link ClassMetadataInterface} in the current one.
|
||||||
@ -50,15 +50,10 @@ interface ClassMetadataInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a {@link \ReflectionClass} instance for this class.
|
* Returns a {@link \ReflectionClass} instance for this class.
|
||||||
*
|
|
||||||
* @return \ReflectionClass
|
|
||||||
*/
|
*/
|
||||||
public function getReflectionClass();
|
public function getReflectionClass(): \ReflectionClass;
|
||||||
|
|
||||||
/**
|
public function getClassDiscriminatorMapping(): ?ClassDiscriminatorMapping;
|
||||||
* @return ClassDiscriminatorMapping|null
|
|
||||||
*/
|
|
||||||
public function getClassDiscriminatorMapping();
|
|
||||||
|
|
||||||
public function setClassDiscriminatorMapping(ClassDiscriminatorMapping $mapping = null);
|
public function setClassDiscriminatorMapping(ClassDiscriminatorMapping $mapping = null);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user