Bug #78697 [Asn->Csd]: ReflectionClass::implementsInterface - inaccurate error message with traits
| From: | krakjoe@php.net | Date: | Mon, 21 Oct 2019 07:25:47 +0000 |
| Subject: | Bug #78697 [Asn->Csd]: ReflectionClass::implementsInterface - inaccurate error message with traits | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223351@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78697&edit=1
ID: 78697
Updated by: krakjoe@php.net
Reported by: villfa@php.net
Summary: ReflectionClass::implementsInterface - inaccurate
error message with traits
-Status: Assigned
+Status: Closed
Type: Bug
Package: Reflection related
PHP Version: Irrelevant
Assigned To: villfa
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of fabien.villepinte@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=bea2ff88c9536ffd157c5fa304bd29a9cee85524
Log: Fix bug #78697: inaccurate error message
Previous Comments:
------------------------------------------------------------------------
[2019-10-19 19:37:43] villfa@php.net
The following pull request has been associated:
Patch Name: Fix bug #78697: inaccurate error message
On GitHub: https://github.com/php/php-src/pull/4834
Patch: https://github.com/php/php-src/pull/4834.patch
------------------------------------------------------------------------
[2019-10-19 19:35:07] villfa@php.net
Description:
------------
When ReflectionClass::implementsInterface receives a trait as a parameter the message of the thrown
exception says that the trait is a class.
Test script:
---------------
<?php
trait T {}
try {
(new ReflectionClass(new stdClass))->implementsInterface(T::class);
} catch (ReflectionException $e) {
echo $e->getMessage();
}
Expected result:
----------------
T is not an interface
Actual result:
--------------
Interface T is a Class
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78697&edit=1