8000 [PropertyInfo] ReflectionExtractor: give a chance to other extractors if no properties by dunglas · Pull Request #26236 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PropertyInfo] ReflectionExtractor: give a chance to other extractors if no properties #26236

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 19, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getProperties($class, array $context = array())
$properties[$propertyName] = $propertyName;
}

return array_values($properties);
return $properties ? array_values($properties) : null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function testGetProperties()
),
$this->extractor->getProperties('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy')
);

$this->assertNull($this->extractor->getProperties('Symfony\Component\PropertyInfo\Tests\Fixtures\NoProperties'));
}

/**
Expand Down
21 changes: 21 additions & 0 deletions src/Symfony/Component/PropertyInfo/Tests/Fixtures/NoProperties.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Symfony\Component\PropertyInfo\Tests\Fixtures;

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\PropertyInfo\Tests\Fixtures;

/**
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class NoProperties
{
}
0