Skip to content

Commit

Permalink
bug #36896 [Config] Removed implicit cast of ReflectionProperty to st…
Browse files Browse the repository at this point in the history
…ring (derrabus)

This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Removed implicit cast of ReflectionProperty to string

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

PHP 8 does not allow casting `ReflectionProperty` instances to string anymore.

Commits
-------

8adbade [Config] Removed implicit cast of ReflectionProperty to string.
  • Loading branch information
fabpot committed May 22, 2020
2 parents b202696 + 8adbade commit 77a826c
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -139,7 +139,11 @@ private function generateSignature(\ReflectionClass $class)
$defaults = $class->getDefaultProperties();

foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) {
yield $p->getDocComment().$p;
yield $p->getDocComment();
yield $p->isDefault() ? '<default>' : '';
yield $p->isPublic() ? 'public' : 'protected';
yield $p->isStatic() ? 'static' : '';
yield '$'.$p->name;
yield print_r(isset($defaults[$p->name]) && !\is_object($defaults[$p->name]) ? $defaults[$p->name] : null, true);
}
}
Expand Down

0 comments on commit 77a826c

Please sign in to comment.