Skip to content

Commit

Permalink
Leverage str_contains/str_starts_with
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander M. Turek <me@derrabus.de>
  • Loading branch information
derrabus authored and nicolas-grekas committed Jul 21, 2021
1 parent 475c9f0 commit aca70d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Debug/WrappedListener.php
Expand Up @@ -52,7 +52,7 @@ public function __construct($listener, ?string $name, Stopwatch $stopwatch, Even
$this->pretty = $this->name.'::'.$listener[1];
} elseif ($listener instanceof \Closure) {
$r = new \ReflectionFunction($listener);
if (false !== strpos($r->name, '{closure}')) {
if (str_contains($r->name, '{closure}')) {
$this->pretty = $this->name = 'closure';
} elseif ($class = $r->getClosureScopeClass()) {
$this->name = $class->name;
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -17,7 +17,8 @@
],
"require": {
"php": ">=7.1.3",
"symfony/event-dispatcher-contracts": "^1.1"
"symfony/event-dispatcher-contracts": "^1.1",
"symfony/polyfill-php80": "^1.16"
},
"require-dev": {
"symfony/dependency-injection": "^3.4|^4.0|^5.0",
Expand Down

0 comments on commit aca70d9

Please sign in to comment.