Skip to content

[Fwb][EventDispatcher][HttpKernel] Fix getClosureScopeClass usage to describe callables #29172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2018
Merged

[Fwb][EventDispatcher][HttpKernel] Fix getClosureScopeClass usage to describe callables #29172

merged 1 commit into from
Nov 11, 2018

Conversation

ogizanagi
Copy link
Contributor

@ogizanagi ogizanagi commented Nov 11, 2018

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #29054
License MIT
Doc PR N/A

\ReflectionFunctionAbstract::getClosureScopeClass returns a \ReflectionClass instance, not the class name.

Before this patch:

--- Expected
+++ Actual
@@ @@
-'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'
+'Class [ <user> class Symfony\Component\EventDispatcher\Tests\Debug\FooListener ] {
+  @@ [...]/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php 28-33
+
+  - Constants [0] {
+  }
+
+  - Static properties [0] {
+  }
+
+  - Static methods [0] {
+  }
+
+  - Properties [0] {
+  }
+
+  - Methods [1] {
+    Method [ <user> public method listen ] {
+      @@ [...]/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php 30 - 32
+    }
+  }
+}
+::listen'

@nicolas-grekas
Copy link
Member

Good catch, thanks @ogizanagi.

@nicolas-grekas nicolas-grekas merged commit 61e4592 into symfony:3.4 Nov 11, 2018
nicolas-grekas added a commit that referenced this pull request Nov 11, 2018
…ass usage to describe callables (ogizanagi)

This PR was merged into the 3.4 branch.

Discussion
----------

[Fwb][EventDispatcher][HttpKernel] Fix getClosureScopeClass usage to describe callables

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #29054   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

`\ReflectionFunctionAbstract::getClosureScopeClass` returns a `\ReflectionClass` instance, not the class name.

Before this patch:

```diff
--- Expected
+++ Actual
@@ @@
-'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'
+'Class [ <user> class Symfony\Component\EventDispatcher\Tests\Debug\FooListener ] {
+  @@ [...]/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php 28-33
+
+  - Constants [0] {
+  }
+
+  - Static properties [0] {
+  }
+
+  - Static methods [0] {
+  }
+
+  - Properties [0] {
+  }
+
+  - Methods [1] {
+    Method [ <user> public method listen ] {
+      @@ [...]/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php 30 - 32
+    }
+  }
+}
+::listen'
```

Commits
-------

61e4592 [Fwb][EventDispatcher][HttpKernel] Fix getClosureScopeClass usage to describe callables
@ogizanagi ogizanagi deleted the fix_callable_descr branch November 11, 2018 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants