Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add many missing PHPdoc return types #49349

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
Feb 13, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,114 changes: 2,092 additions & 22 deletions 2,114 .github/expected-missing-return-types.diff

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions 1 .github/patch-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/ReflectionIntersectionTypeFixture.php'):
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/ReflectionUnionTypeWithIntersectionFixture.php'):
case false !== strpos($file, '/src/Symfony/Component/VarExporter/Tests/Fixtures/LazyGhost/ReadOnlyClass.php'):
case false !== strpos($file, '/src/Symfony/Component/VarExporter/Tests/Fixtures/LazyProxy/ReadOnlyClass.php'):
case false !== strpos($file, '/src/Symfony/Component/Cache/Traits/RelayProxy.php'):
continue 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public function getConnections()
return $this->data['connections'];
}

/**
* @return int
*/
public function getQueryCount()
{
return array_sum(array_map('count', $this->data['queries']));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function create(ContainerBuilder $container, string $id, array $config)
;
}

/**
* @return string
*/
public function getKey()
{
return $this->key;
Expand Down
12 changes: 12 additions & 0 deletions 12 src/Symfony/Bridge/PhpUnit/ClassExistsMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,39 @@ public static function withMockedEnums(array $enums)
self::$classes += $enums;
}

/**
* @return bool
*/
public static function class_exists($name, $autoload = true)
{
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \class_exists($name, $autoload);
}

/**
* @return bool
*/
public static function interface_exists($name, $autoload = true)
{
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \interface_exists($name, $autoload);
}

/**
* @return bool
*/
public static function trait_exists($name, $autoload = true)
{
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \trait_exists($name, $autoload);
}

/**
* @return bool
*/
public static function enum_exists($name, $autoload = true)
{
$name = ltrim($name, '\\');
Expand Down
18 changes: 18 additions & 0 deletions 18 src/Symfony/Bridge/PhpUnit/ClockMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class ClockMock
{
private static $now;

/**
* @return bool|null
*/
public static function withClockMock($enable = null)
{
if (null === $enable) {
Expand All @@ -30,6 +33,9 @@ public static function withClockMock($enable = null)
return null;
}

/**
* @return int
*/
public static function time()
{
if (null === self::$now) {
Expand All @@ -39,6 +45,9 @@ public static function time()
return (int) self::$now;
}

/**
* @return int
*/
public static function sleep($s)
{
if (null === self::$now) {
Expand Down Expand Up @@ -72,6 +81,9 @@ public static function microtime($asFloat = false)
return sprintf('%0.6f00 %d', self::$now - (int) self::$now, (int) self::$now);
}

/**
* @return string
*/
public static function date($format, $timestamp = null)
{
if (null === $timestamp) {
Expand All @@ -81,6 +93,9 @@ public static function date($format, $timestamp = null)
return \date($format, $timestamp);
}

/**
* @return string
*/
public static function gmdate($format, $timestamp = null)
{
if (null === $timestamp) {
Expand All @@ -90,6 +105,9 @@ public static function gmdate($format, $timestamp = null)
return \gmdate($format, $timestamp);
}

/**
* @return array|int|float
*/
public static function hrtime($asNumber = false)
{
$ns = (self::$now - (int) self::$now) * 1000000000;
Expand Down
6 changes: 6 additions & 0 deletions 6 src/Symfony/Bridge/PhpUnit/DnsMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public static function withMockedHosts(array $hosts)
self::$hosts = $hosts;
}

/**
* @return bool
*/
public static function checkdnsrr($hostname, $type = 'MX')
{
if (!self::$hosts) {
Expand All @@ -63,6 +66,9 @@ public static function checkdnsrr($hostname, $type = 'MX')
return false;
}

/**
* @return bool
*/
public static function getmxrr($hostname, &$mxhosts, &$weight = null)
{
if (!self::$hosts) {
Expand Down
3 changes: 3 additions & 0 deletions 3 src/Symfony/Bundle/FrameworkBundle/Secrets/AbstractVault.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ protected function validateName(string $name): void
}
}

/**
* @return string
*/
protected function getPrettyPath(string $path)
{
return str_replace(getcwd().\DIRECTORY_SEPARATOR, '', $path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ final class TraceableFirewallListener extends FirewallListener
private array $wrappedListeners = [];
private array $authenticatorsInfo = [];

/**
* @return array
*/
public function getWrappedListeners()
{
return $this->wrappedListeners;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

/**
* AbstractFactory is the base class for all classes inheriting from
Expand Down Expand Up @@ -73,6 +72,9 @@ public function addConfiguration(NodeDefinition $node)
}
}

/**
* @return string
*/
protected function createAuthenticationSuccessHandler(ContainerBuilder $container, string $id, array $config)
{
$successHandlerId = $this->getSuccessHandlerId($id);
Expand All @@ -92,6 +94,9 @@ protected function createAuthenticationSuccessHandler(ContainerBuilder $containe
return $successHandlerId;
}

/**
* @return string
*/
protected function createAuthenticationFailureHandler(ContainerBuilder $container, string $id, array $config)
{
$id = $this->getFailureHandlerId($id);
Expand All @@ -109,11 +114,17 @@ protected function createAuthenticationFailureHandler(ContainerBuilder $containe
return $id;
}

/**
* @return string
*/
protected function getSuccessHandlerId(string $id)
{
return 'security.authentication.success_handler.'.$id.'.'.str_replace('-', '_', $this->getKey());
}

/**
* @return string
*/
protected function getFailureHandlerId(string $id)
{
return 'security.authentication.failure_handler.'.$id.'.'.str_replace('-', '_', $this->getKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public function create(ContainerBuilder $container, string $id, array $config)
$definition->addArgument($users);
}

/**
* @return string
*/
public function getKey()
{
return 'memory';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public function create(ContainerBuilder $container, string $id, array $config)
;
}

/**
* @return string
*/
public function getKey()
{
return 'ldap';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function __construct(iterable $listeners, ExceptionListener $exceptionLis
$this->config = $config;
}

/**
* @return FirewallConfig|null
*/
public function getConfig()
{
return $this->config;
Expand All @@ -51,11 +54,17 @@ public function getListeners(): iterable
return $this->listeners;
}

/**
* @return ExceptionListener|null
*/
public function getExceptionListener()
{
return $this->exceptionListener;
}

/**
* @return LogoutListener|null
*/
public function getLogoutListener()
{
return $this->logoutListener;
Expand Down
3 changes: 3 additions & 0 deletions 3 src/Symfony/Component/Cache/Adapter/ApcuAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public function __construct(string $namespace = '', int $defaultLifetime = 0, st
$this->marshaller = $marshaller;
}

/**
* @return bool
*/
public static function isSupported()
{
return \function_exists('apcu_fetch') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOL);
Expand Down
3 changes: 3 additions & 0 deletions 3 src/Symfony/Component/Cache/Adapter/MemcachedAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public function __construct(\Memcached $client, string $namespace = '', int $def
$this->marshaller = $marshaller ?? new DefaultMarshaller();
}

/**
* @return bool
*/
public static function isSupported()
{
return \extension_loaded('memcached') && version_compare(phpversion('memcached'), '3.1.6', '>=');
Expand Down
6 changes: 6 additions & 0 deletions 6 src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public function __construct(string $namespace = '', int $defaultLifetime = 0, st
};
}

/**
* @return bool
*/
public static function isSupported()
{
self::$startTime ??= $_SERVER['REQUEST_TIME'] ?? time();
Expand Down Expand Up @@ -274,6 +277,9 @@ protected function doDelete(array $ids): bool
return $this->doCommonDelete($ids);
}

/**
* @return bool
*/
protected function doUnlink(string $file)
{
unset(self::$valuesCache[$file]);
Expand Down
6 changes: 6 additions & 0 deletions 6 src/Symfony/Component/Cache/Adapter/TraceableAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ public function delete(string $key): bool
}
}

/**
* @return array
*/
public function getCalls()
{
return $this->calls;
Expand All @@ -226,6 +229,9 @@ public function getPool(): AdapterInterface
return $this->pool;
}

/**
* @return TraceableAdapterEvent
*/
protected function start(string $name)
{
$this->calls[] = $event = new TraceableAdapterEvent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public function dump(ConfigurationInterface $configuration, string $namespace =
return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace);
}

/**
* @return string
*/
public function dumpNode(NodeInterface $node, string $namespace = null)
{
$this->reference = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public function dumpAtPath(ConfigurationInterface $configuration, string $path)
return $this->dumpNode($node);
}

/**
* @return string
*/
public function dumpNode(NodeInterface $node)
{
$this->reference = '';
Expand Down
3 changes: 3 additions & 0 deletions 3 src/Symfony/Component/Config/Definition/EnumNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function __construct(?string $name, NodeInterface $parent = null, array $
$this->values = $values;
}

/**
* @return array
*/
public function getValues()
{
return $this->values;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function __construct(string $message = '', int $code = 0, \Throwable $pre
$this->paths = $paths;
}

/**
* @return array
*/
public function getPaths()
{
return $this->paths;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public function __construct(mixed $resource, string $sourceResource = null, int
parent::__construct($message, $code, $previous);
}

/**
* @return string
*/
protected function varToString(mixed $var)
{
if (\is_object($var)) {
Expand Down
3 changes: 3 additions & 0 deletions 3 src/Symfony/Component/Config/Util/XmlUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ public static function phpize(string|\Stringable $value): mixed
}
}

/**
* @return array
*/
protected static function getXmlErrors(bool $internalErrors)
{
$errors = [];
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.