summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-phpdocumentor-reflection-docblock-pr113.patch44
-rw-r--r--php-phpdocumentor-reflection-docblock.spec10
2 files changed, 53 insertions, 1 deletions
diff --git a/php-phpdocumentor-reflection-docblock-pr113.patch b/php-phpdocumentor-reflection-docblock-pr113.patch
new file mode 100644
index 0000000..50b11f8
--- /dev/null
+++ b/php-phpdocumentor-reflection-docblock-pr113.patch
@@ -0,0 +1,44 @@
+From 358daaf824d8f6e1acc56eee40127f4bd4153051 Mon Sep 17 00:00:00 2001
+From: Roberto Espinoza <roberto.espinoza@nature.com>
+Date: Mon, 7 Aug 2017 12:56:26 +0900
+Subject: [PATCH] Check tag body has a value before trying to access it as an
+ string array
+
+---
+ src/DocBlock/StandardTagFactory.php | 2 +-
+ tests/integration/DocblocksWithAnnotationsTest.php | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/DocBlock/StandardTagFactory.php b/src/DocBlock/StandardTagFactory.php
+index 786caef..8efd84e 100644
+--- a/src/DocBlock/StandardTagFactory.php
++++ b/src/DocBlock/StandardTagFactory.php
+@@ -113,7 +113,7 @@ public function create($tagLine, TypeContext $context = null)
+
+ list($tagName, $tagBody) = $this->extractTagParts($tagLine);
+
+- if ($tagBody[0] === '[') {
++ if ($tagBody !== '' && $tagBody[0] === '[') {
+ throw new \InvalidArgumentException(
+ 'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors'
+ );
+diff --git a/tests/integration/DocblocksWithAnnotationsTest.php b/tests/integration/DocblocksWithAnnotationsTest.php
+index 3c40f4f..6db1604 100644
+--- a/tests/integration/DocblocksWithAnnotationsTest.php
++++ b/tests/integration/DocblocksWithAnnotationsTest.php
+@@ -23,6 +23,7 @@ public function testDocblockWithAnnotations()
+ /**
+ * @var \DateTime[]
+ * @Groups({"a", "b"})
++ * @ORM\Entity
+ */
+ DOCCOMMENT;
+
+@@ -30,6 +31,6 @@ public function testDocblockWithAnnotations()
+ $factory = DocBlockFactory::createInstance();
+ $docblock = $factory->create($docComment);
+
+- $this->assertCount(2, $docblock->getTags());
++ $this->assertCount(3, $docblock->getTags());
+ }
+ }
diff --git a/php-phpdocumentor-reflection-docblock.spec b/php-phpdocumentor-reflection-docblock.spec
index 72a96ad..cdcccc9 100644
--- a/php-phpdocumentor-reflection-docblock.spec
+++ b/php-phpdocumentor-reflection-docblock.spec
@@ -16,7 +16,7 @@
Name: php-phpdocumentor-reflection-docblock
Version: 3.2.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: DocBlock parser
Group: Development/Libraries
@@ -28,6 +28,9 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{name}-%{version}-%{gh_commit}.tar.gz
Source1: %{name}-get-source.sh
+# https://github.com/phpDocumentor/ReflectionDocBlock/pull/113
+Patch0: %{name}-pr113.patch
+
BuildArch: noarch
BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
@@ -89,6 +92,7 @@ DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+%patch0 -p1
sed 's#vendor/mockery/mockery/library#%{_datadir}/php#' phpunit.xml.dist \
> phpunit.xml
@@ -162,6 +166,10 @@ exit $RETURN_CODE
%changelog
+* Mon Aug 7 2017 Remi Collet <remi@remirepo.net> - 3.2.1-2
+- add patch to fix BC break, thanks to Koschei, from
+ https://github.com/phpDocumentor/ReflectionDocBlock/pull/113
+
* Sat Aug 05 2017 Shawn Iwinski <shawn@iwin.ski> - 3.2.1-1
- Update to 3.2.1 (RHBZ #1471379)