From c0be269c5c4c011047b1a5c43e6d15e931331962 Mon Sep 17 00:00:00 2001 From: "Katie Volz (RIT Student)" Date: Thu, 10 Oct 2019 12:52:15 -0400 Subject: [PATCH 1/2] Don't throw InvalidArgumentException if passed an anonymous class --- src/Fqsen.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Fqsen.php b/src/Fqsen.php index 9fc0c64..2e89ed5 100644 --- a/src/Fqsen.php +++ b/src/Fqsen.php @@ -48,9 +48,13 @@ public function __construct(string $fqsen) ); if ($result === 0) { - throw new InvalidArgumentException( - sprintf('"%s" is not a valid Fqsen.', $fqsen) - ); + if(strpos($fqsen, "class@anonymous") === 0) { + $matches=[null,null,$fqsen]; + } else { + throw new InvalidArgumentException( + sprintf('"%s" is not a valid Fqsen.', $fqsen) + ); + } } $this->fqsen = $fqsen; From 892dd30f6932cb5892f80b5050fb7f8bc8a54d0d Mon Sep 17 00:00:00 2001 From: iggyvolz Date: Thu, 10 Oct 2019 13:00:08 -0400 Subject: [PATCH 2/2] Fixup previous --- src/Fqsen.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fqsen.php b/src/Fqsen.php index 2e89ed5..e3633bd 100644 --- a/src/Fqsen.php +++ b/src/Fqsen.php @@ -48,7 +48,7 @@ public function __construct(string $fqsen) ); if ($result === 0) { - if(strpos($fqsen, "class@anonymous") === 0) { + if(strpos($fqsen, "\\class@anonymous") === 0) { $matches=[null,null,$fqsen]; } else { throw new InvalidArgumentException(