8000 [5.0] Add return types on internal|final|private methods by nicolas-grekas · Pull Request #33259 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[5.0] Add return types on internal|final|private methods #33259

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 20, 2019
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
4 changes: 1 addition & 3 deletions src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ protected function send($content, array $records): void

/**
* {@inheritdoc}
*
* @return void
*/
public function reset()
public function reset(): void
{
$this->flushMemorySpool();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function has($id): bool
/**
* {@inheritdoc}
*/
public function get($id, int $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1)
public function get($id, int $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1): ?object
{
return $this->getPrivateContainer()->has($id) ? $this->getPrivateContainer()->get($id) : $this->getPublicContainer()->get($id, $invalidBehavior);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ public function testGetUserWithEmptyContainer()

/**
* @param $token
*
* @return Container
*/
private function getContainerWithTokenStorage($token = null)
private function getContainerWithTokenStorage($token = null): Container
{
$tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage')->getMock();
$tokenStorage
Expand Down
5 changes: 1 addition & 4 deletions src/Symfony/Component/Cache/Adapter/MemcachedAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,7 @@ private function checkResultCode($result)
throw new CacheException(sprintf('MemcachedAdapter client error: %s.', strtolower($this->client->getResultMessage())));
}

/**
* @return \Memcached
*/
private function getClient()
private function getClient(): \Memcached
{
if ($this->client) {
return $this->client;
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/DomCrawler/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ public static function xpathLiteral(string $s)
*
* @return static
*/
private function filterRelativeXPath(string $xpath)
private function filterRelativeXPath(string $xpath): object
{
$prefixes = $this->findNamespacePrefixes($xpath);

Expand Down Expand Up @@ -1140,7 +1140,7 @@ private function findNamespacePrefixes(string $xpath): array
*
* @return static
*/
private function createSubCrawler($nodes)
private function createSubCrawler($nodes): object
{
$crawler = new static($nodes, $this->uri, $this->baseHref);
$crawler->isHtml = $this->isHtml;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function onFinishRequest(FinishRequestEvent $event)
}
}

public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
KernelEvents::REQUEST => ['onKernelRequest', 128],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function onKernelResponse(ResponseEvent $event)
}
}

public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
KernelEvents::REQUEST => ['onKernelRequest', 192],
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Mime/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ private function createDataPart(array $attachment): DataPart
/**
* @return $this
*/
private function setHeaderBody(string $type, string $name, $body)
private function setHeaderBody(string $type, string $name, $body): object
{
$this->getHeaders()->setHeaderBody($type, $name, $body);

Expand Down
4 changes: 1 addition & 3 deletions src/Symfony/Component/Translation/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,8 @@ public function setFallbackLocales(array $locales)
* Gets the fallback locales.
*
* @internal
*
* @return array The fallback locales
*/
public function getFallbackLocales()
public function getFallbackLocales(): array
{
return $this->fallbackLocales;
}
Expand Down
0