minor #30934 [Serializer] add return type hints for ObjectPropertyListExtractorInterface (dmaicher)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Serializer] add return type hints for ObjectPropertyListExtractorInterface

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

@nicolas-grekas as just discussed here the type-hint + phpdoc cleanup as follow-up for https://github.com/symfony/symfony/pull/30904 😉

cc @joelwurtz

Commits
-------

7628972285 [Serializer] add return type hints for ObjectPropertyListExtractorInterface
This commit is contained in:
Fabien Potencier 2019-04-06 21:25:56 +02:00
commit 9afcc7b833
2 changed files with 2 additions and 3 deletions

View File

@ -30,7 +30,7 @@ class ObjectPropertyListExtractor implements ObjectPropertyListExtractorInterfac
/**
* {@inheritdoc}
*/
public function getProperties($object, array $context = [])
public function getProperties($object, array $context = []): ?array
{
$class = $this->objectClassResolver ? ($this->objectClassResolver)($object) : \get_class($object);

View File

@ -20,9 +20,8 @@ interface ObjectPropertyListExtractorInterface
* Gets the list of properties available for the given object.
*
* @param object $object
* @param array $context
*
* @return string[]|null
*/
public function getProperties($object, array $context = []);
public function getProperties($object, array $context = []): ?array;
}