Skip to content

Commit 0877de2

Browse files
minor #47672 Leverage First-class callable syntax (tigitz)
This PR was merged into the 6.2 branch. Discussion ---------- Leverage First-class callable syntax | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | - ### Rationale https://wiki.php.net/rfc/first_class_callable_syntax Mainly: > The advantage is that the new syntax is accessible to static analysis, and respects the scope at the point where the callable is created. I'd argue that it also improves readability and IDE color syntax also helps: ![image](https://user-images.githubusercontent.com/1524501/191912084-7ee933c5-dda1-4176-86f1-cd6511c58aa4.png) I've manually reviewed each changes and discarded some of them where `[Foo::class, 'method']` was intended to be tested with this specific syntax Commits ------- 26d9ce9520 Leverage First-class callable syntax
2 parents fd79318 + ad62a0e commit 0877de2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Loader/IniFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function load(mixed $resource, string $type = null): mixed
3939
if (isset($result['parameters']) && \is_array($result['parameters'])) {
4040
foreach ($result['parameters'] as $key => $value) {
4141
if (\is_array($value)) {
42-
$this->container->setParameter($key, array_map([$this, 'phpize'], $value));
42+
$this->container->setParameter($key, array_map($this->phpize(...), $value));
4343
} else {
4444
$this->container->setParameter($key, $this->phpize($value));
4545
}

0 commit comments

Comments
 (0)