Skip to content

Commit

Permalink
minor #36902 [Intl] Fix call to ReflectionProperty::getValue() for st…
Browse files Browse the repository at this point in the history
…atic properties (derrabus)

This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Fix call to ReflectionProperty::getValue() for static properties

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

When we call `ReflectionProperty::getValue()` for a static property, we don't need to pass any arguments. The code that was fixed here raised a `TypeError` on php 8 because the argument has to be an object now.

Commits
-------

d404589 [Intl] Fix call to ReflectionProperty::getValue() for static properties.
  • Loading branch information
fabpot committed May 22, 2020
2 parents 77a826c + d404589 commit 14ffc02
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ public function testGetSymbol()

$r = new \ReflectionProperty('Symfony\Component\Intl\NumberFormatter\NumberFormatter', 'enSymbols');
$r->setAccessible(true);
$expected = $r->getValue('Symfony\Component\Intl\NumberFormatter\NumberFormatter');
$expected = $r->getValue();

for ($i = 0; $i <= 17; ++$i) {
$this->assertSame($expected[1][$i], $decimalFormatter->getSymbol($i));
Expand All @@ -619,7 +619,7 @@ public function testGetTextAttribute()

$r = new \ReflectionProperty('Symfony\Component\Intl\NumberFormatter\NumberFormatter', 'enTextAttributes');
$r->setAccessible(true);
$expected = $r->getValue('Symfony\Component\Intl\NumberFormatter\NumberFormatter');
$expected = $r->getValue();

for ($i = 0; $i <= 5; ++$i) {
$this->assertSame($expected[1][$i], $decimalFormatter->getTextAttribute($i));
Expand Down

0 comments on commit 14ffc02

Please sign in to comment.