Skip to content

Commit

Permalink
Merge branch '5.4' into 6.0
Browse files Browse the repository at this point in the history
* 5.4:
  fix test method name
  [DebugClassLoader] Ignore __constructor() when checking return types
  • Loading branch information
xabbuh committed Sep 11, 2021
2 parents f213873 + 64cbfd2 commit 6cbae70
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ public function testLoadChoicesForValuesDoesNotLoadIfEmptyValues()
/**
* @group legacy
*/
public function legacyTestLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader()
public function testLegacyLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader()
{
$this->expectDeprecation('Not defining explicitly the IdReader as value callback when query can be optimized has been deprecated in 5.1. Don\'t pass the IdReader to "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader" or define the choice_value instead.');
$this->expectDeprecation('Since symfony/doctrine-bridge 5.1: Not defining explicitly the IdReader as value callback when query can be optimized is deprecated. Don\'t pass the IdReader to "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader" or define the "choice_value" option instead.');
$loader = new DoctrineChoiceLoader(
$this->om,
$this->class,
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/ErrorHandler/DebugClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,10 @@ private function getOwnInterfaces(string $class, ?string $parent): array

private function setReturnType(string $types, string $class, string $method, string $filename, ?string $parent, \ReflectionType $returnType = null): void
{
if ('__construct' === $method) {
return;
}

if ($nullable = 0 === strpos($types, 'null|')) {
$types = substr($types, 5);
} elseif ($nullable = '|null' === substr($types, -5)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class ReturnType extends ReturnTypeParent implements ReturnTypeInterface, Fixtures\OutsideInterface
{
public function __construct() { }
public function returnTypeGrandParent() { }
public function returnTypeParentInterface() { }
public function returnTypeInterface() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

abstract class ReturnTypeParent extends ReturnTypeGrandParent implements ReturnTypeParentInterface
{
/**
* @return void
*/
public function __construct()
{
}

/**
* No return declared here
*/
Expand Down

0 comments on commit 6cbae70

Please sign in to comment.