summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-phpunit-phploc.spec10
-rw-r--r--phploc-php73.patch30
2 files changed, 38 insertions, 2 deletions
diff --git a/php-phpunit-phploc.spec b/php-phpunit-phploc.spec
index 00141e2..6b3af3c 100644
--- a/php-phpunit-phploc.spec
+++ b/php-phpunit-phploc.spec
@@ -22,7 +22,7 @@
Name: php-phpunit-phploc
Version: 4.0.1
-Release: 2%{?dist}
+Release: 4%{?dist}
Summary: A tool for quickly measuring the size of a PHP project
Group: Development/Libraries
@@ -32,6 +32,8 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
# Fix for RPM, use autoload
Patch0: %{gh_project}-rpm.patch
+# For PHP 7.3 (upstream have fixed it with other changes)
+Patch1: %{gh_project}-php73.patch
BuildArch: noarch
BuildRequires: php(language) >= 5.6
@@ -92,6 +94,7 @@ need to get a quick understanding of a project's size.
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1 -b .rpm
+%patch1 -p1
%build
@@ -125,7 +128,7 @@ install -D -p -m 755 phploc %{buildroot}%{_bindir}/phploc
%if %{with_tests}
%check
ret=0
-for cmd in "php %{phpunit}" php70 php71 php72; do
+for cmd in "php %{phpunit}" php70 php71 php72 php73; do
if which $cmd; then
set $cmd
$1 ${2:-%{_bindir}/phpunit6} \
@@ -154,6 +157,9 @@ fi
%changelog
+* Mon Oct 15 2018 Remi Collet <remi@remirepo.net> - 4.0.1-4
+- add patch for PHP 7.3
+
* Tue Feb 6 2018 Remi Collet <remi@remirepo.net> - 4.0.1-2
- use range dependencies on F27+
- undefine __brp_mangle_shebangs
diff --git a/phploc-php73.patch b/phploc-php73.patch
new file mode 100644
index 0000000..cefbac0
--- /dev/null
+++ b/phploc-php73.patch
@@ -0,0 +1,30 @@
+diff -up ./src/Analyser.php.php73 ./src/Analyser.php
+--- ./src/Analyser.php.php73 2017-11-18 18:35:43.000000000 +0100
++++ ./src/Analyser.php 2018-10-15 09:57:34.714427621 +0200
+@@ -89,7 +89,7 @@ class Analyser
+
+ case T_CLASS:
+ if (!$this->isClassDeclaration($tokens, $i)) {
+- continue;
++ break;
+ }
+
+ $className = $this->getClassName($namespace, $tokens, $i);
+@@ -206,7 +206,7 @@ class Analyser
+ case T_INTERFACE:
+ case T_TRAIT:
+ if (!$this->isClassDeclaration($tokens, $i)) {
+- continue;
++ break;
+ }
+
+ $this->collector->currentClassReset();
+@@ -238,7 +238,7 @@ class Analyser
+ $prev = $this->getPreviousNonWhitespaceTokenPos($tokens, $i);
+
+ if ($tokens[$prev][0] === T_USE) {
+- continue;
++ break;
+ }
+
+ $currentBlock = T_FUNCTION;