Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cleanup more @return annotations #42499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ protected function assertValidMappingConfiguration(array $mappingConfig, string
/**
* Detects what metadata driver to use for the supplied directory.
*
* @return string|null A metadata driver short name, if one can be detected
* @return string|null
*/
protected function detectMetadataDriver(string $dir, ContainerBuilder $container)
{
Expand Down Expand Up @@ -379,7 +379,7 @@ protected function loadCacheDriver(string $cacheName, string $objectManagerName,
*
* The manager called $autoMappedManager will map all bundles that are not mapped by other managers.
*
* @return array The modified version of $managerConfigs
* @return array
*/
protected function fixManagersAutoMappings(array $managerConfigs, array $bundles)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function process(ContainerBuilder $container)
* Get the service name of the metadata chain driver that the mappings
* should be registered with.
*
* @return string The name of the chain driver service
* @return string
*
* @throws InvalidArgumentException if non of the managerParameters has a
* non-empty value
Expand All @@ -181,7 +181,7 @@ protected function getChainDriverServiceName(ContainerBuilder $container)
* @param ContainerBuilder $container Passed on in case an extending class
* needs access to the container
*
* @return Definition|Reference the metadata driver to add to all chain drivers
* @return Definition|Reference
*/
protected function getDriver(ContainerBuilder $container)
{
Expand Down Expand Up @@ -228,7 +228,7 @@ private function getManagerName(ContainerBuilder $container): string
* This default implementation checks if the class has the enabledParameter
* configured and if so if that parameter is present in the container.
*
* @return bool whether this compiler pass really should register the mappings
* @return bool
*/
protected function enabled(ContainerBuilder $container)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ interface EntityLoaderInterface
/**
* Returns an array of entities that are valid choices in the corresponding choice list.
*
* @return array The entities
* @return array
*/
public function getEntities();

/**
* Returns an array of entities matching the given identifiers.
*
* @return array The entities
* @return array
*/
public function getEntitiesByIds(string $identifier, array $values);
}
10 changes: 1 addition & 9 deletions src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ public function __construct(ObjectManager $om, ClassMetadata $classMetadata)

/**
* Returns whether the class has a single-column ID.
*
* @return bool returns `true` if the class has a single-column ID and
* `false` otherwise
*/
public function isSingleId(): bool
{
Expand All @@ -70,9 +67,6 @@ public function isSingleId(): bool

/**
* Returns whether the class has a single-column integer ID.
*
* @return bool returns `true` if the class has a single-column integer ID
* and `false` otherwise
*/
public function isIntId(): bool
{
Expand All @@ -84,7 +78,7 @@ public function isIntId(): bool
*
* This method assumes that the object has a single-column ID.
*
* @return string The ID value
* @return string
*/
public function getIdValue(object $object = null)
{
Expand All @@ -111,8 +105,6 @@ public function getIdValue(object $object = null)
* Returns the name of the ID field.
*
* This method assumes that the object has a single-column ID.
*
* @return string The name of the ID field
*/
public function getIdField(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CollectionToArrayTransformer implements DataTransformerInterface
/**
* Transforms a collection into an array.
*
* @return mixed An array of entities
* @return mixed
*
* @throws TransformationFailedException
*/
Expand Down Expand Up @@ -52,7 +52,7 @@ public function transform($collection)
*
* @param mixed $array An array of entities
*
* @return Collection A collection of entities
* @return Collection
*/
public function reverseTransform($array)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ public static function createChoiceName(object $choice, $key, string $value): st
* @param object $queryBuilder A query builder, type declaration is not present here as there
* is no common base class for the different implementations
*
* @return array|null Array with important QueryBuilder parts or null if
* they can't be determined
*
* @internal This method is public to be usable as callback. It should not
* be used in user code.
*/
Expand Down
10 changes: 2 additions & 8 deletions src/Symfony/Bridge/Monolog/Tests/Handler/MailerHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ public function testHtmlContent()
$handler->handle($this->getRecord(Logger::WARNING, 'message'));
}

/**
* @return array Record
*/
protected function getRecord($level = Logger::WARNING, $message = 'test', $context = [])
protected function getRecord($level = Logger::WARNING, $message = 'test', $context = []): array
{
return [
'message' => $message,
Expand All @@ -107,10 +104,7 @@ protected function getRecord($level = Logger::WARNING, $message = 'test', $conte
];
}

/**
* @return array
*/
protected function getMultipleRecords()
protected function getMultipleRecords(): array
{
return [
$this->getRecord(Logger::DEBUG, 'debug message 1'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private function getPackage($path)
}

/**
* @return string[] an array of paths
* @return string[]
*/
private static function getVendors()
{
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Bridge/Twig/AppVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getUser()
/**
* Returns the current request.
*
* @return Request|null The HTTP request object
* @return Request|null
*/
public function getRequest()
{
Expand All @@ -105,7 +105,7 @@ public function getRequest()
/**
* Returns the current session.
*
* @return Session|null The session
* @return Session|null
*/
public function getSession()
{
Expand All @@ -120,7 +120,7 @@ public function getSession()
/**
* Returns the current app environment.
*
* @return string The current environment string (e.g 'dev')
* @return string
*/
public function getEnvironment()
{
Expand All @@ -134,7 +134,7 @@ public function getEnvironment()
/**
* Returns the current app debug mode.
*
* @return bool The current debug mode
* @return bool
*/
public function getDebug()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Extension/CodeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function formatFile(string $file, int $line, string $text = null): string
/**
* Returns the link for a given file/line pair.
*
* @return string|false A link or false
* @return string|false
*/
public function getFileLink(string $file, int $line)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function canTransition(object $subject, string $transitionName, string $n
/**
* Returns all enabled transitions.
*
* @return Transition[] All enabled transitions
* @return Transition[]
*/
public function getEnabledTransitions(object $subject, string $name = null): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function renderBlock(FormView $view, $resource, string $blockName, array
*
* @see getResourceForBlock()
*
* @return bool True if the resource could be loaded, false otherwise
* @return bool
*/
protected function loadResourceForBlockName(string $cacheKey, FormView $view, string $blockName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public function warmUp(string $cacheDir)

/**
* Checks whether this warmer is optional or not.
*
* @return bool always true
*/
public function isOptional(): bool
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct(bool $debug)
/**
* Generates the configuration tree builder.
*
* @return TreeBuilder The tree builder
* @return TreeBuilder
*/
public function getConfigTreeBuilder()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function forward(Request $request, bool $catch = false, Response $entr
/**
* Returns an array of options to customize the Cache configuration.
*
* @return array An array of options
* @return array
*/
protected function getOptions()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function tearDown(): void
}

/**
* @return string The Kernel class name
* @return string
*
* @throws \RuntimeException
* @throws \LogicException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function lateCollect()
/**
* Checks if security is enabled.
*
* @return bool true if security is enabled, false otherwise
* @return bool
*/
public function isEnabled()
{
Expand All @@ -243,7 +243,7 @@ public function isEnabled()
/**
* Gets the user.
*
* @return string The user
* @return string
*/
public function getUser()
{
Expand Down Expand Up @@ -274,7 +274,7 @@ public function getInheritedRoles()
* Checks if the data contains information about inherited roles. Still the inherited
* roles can be an empty array.
*
* @return bool true if the profile was contains inherited role information
* @return bool
*/
public function supportsRoleHierarchy()
{
Expand All @@ -284,7 +284,7 @@ public function supportsRoleHierarchy()
/**
* Checks if the user is authenticated or not.
*
* @return bool true if the user is authenticated, false otherwise
* @return bool
*/
public function isAuthenticated()
{
Expand Down Expand Up @@ -318,7 +318,7 @@ public function getImpersonationExitPath()
/**
* Get the class name of the security token.
*
* @return string|Data|null The token
* @return string|Data|null
*/
public function getTokenClass()
{
Expand All @@ -338,7 +338,7 @@ public function getToken()
/**
* Get the logout URL.
*
* @return string|null The logout URL
* @return string|null
*/
public function getLogoutUrl()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(array $factories, array $userProviderFactories)
/**
* Generates the configuration tree builder.
*
* @return TreeBuilder The tree builder
* @return TreeBuilder
*/
public function getConfigTreeBuilder()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ final public function addOption(string $name, $default = null)
* Subclasses must return the id of a service which implements the
* AuthenticationProviderInterface.
*
* @return string never null, the id of the authentication provider
* @return string
*/
abstract protected function createAuthProvider(ContainerBuilder $container, string $id, array $config, string $userProviderId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Configuration implements ConfigurationInterface
/**
* Generates the configuration tree builder.
*
* @return TreeBuilder The tree builder
* @return TreeBuilder
*/
public function getConfigTreeBuilder()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public function openAction(Request $request)
/**
* Gets the Template Manager.
*
* @return TemplateManager The Template Manager
* @return TemplateManager
*/
protected function getTemplateManager()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Configuration implements ConfigurationInterface
/**
* Generates the configuration tree builder.
*
* @return TreeBuilder The tree builder
* @return TreeBuilder
*/
public function getConfigTreeBuilder()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Asset/Context/ContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ interface ContextInterface
/**
* Gets the base path.
*
* @return string The base path
* @return string
*/
public function getBasePath();

/**
* Checks whether the request is secure or not.
*
* @return bool true if the request is secure, false otherwise
* @return bool
*/
public function isSecure();
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public function __construct(string $message, array $alternatives = [], int $code
$this->alternatives = $alternatives;
}

/**
* @return array A list of similar defined names
*/
public function getAlternatives(): array
{
return $this->alternatives;
Expand Down
Loading