summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--php-victorjonsson-markdowndocs-php8.patch40
-rw-r--r--php-victorjonsson-markdowndocs.spec29
3 files changed, 64 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..01f0400
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.bz2
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/php-victorjonsson-markdowndocs-php8.patch b/php-victorjonsson-markdowndocs-php8.patch
new file mode 100644
index 0000000..da6e869
--- /dev/null
+++ b/php-victorjonsson-markdowndocs-php8.patch
@@ -0,0 +1,40 @@
+From 3a2849e39198fb58791c8aae3acca33daf891652 Mon Sep 17 00:00:00 2001
+From: Dave Redfern <david.redfern@madagasgar.com>
+Date: Wed, 20 Jan 2021 15:49:56 -0500
+Subject: [PATCH] Support PHP8
+
+---
+ .gitattributes | 6 ++++++
+ .gitignore | 4 ++++
+ composer.json | 7 ++++++-
+ src/PHPDocsMD/Reflector.php | 10 +---------
+ test/ExampleClass.php | 7 ++++---
+ test/MDTableGeneratorTest.php | 7 +++++--
+ test/ReflectorTest.php | 6 ++++--
+ test/UseInspectorTest.php | 9 +++++----
+ 8 files changed, 35 insertions(+), 21 deletions(-)
+ create mode 100644 .gitattributes
+ create mode 100644 .gitignore
+
+diff --git a/src/PHPDocsMD/Reflector.php b/src/PHPDocsMD/Reflector.php
+index a579e5e..598dec5 100644
+--- a/src/PHPDocsMD/Reflector.php
++++ b/src/PHPDocsMD/Reflector.php
+@@ -336,15 +336,7 @@ private function createParameterEntity(\ReflectionParameter $reflection, $docs)
+ */
+ static function getParamType(\ReflectionParameter $refParam)
+ {
+- $export = \ReflectionParameter::export([
+- $refParam->getDeclaringClass()->name,
+- $refParam->getDeclaringFunction()->name
+- ],
+- $refParam->name,
+- true
+- );
+-
+- $export = str_replace(' or NULL', '', $export);
++ $export = str_replace(' or NULL', '', (string)$refParam);
+
+ $type = preg_replace('/.*?([\w\\\]+)\s+\$'.current(explode('=', $refParam->name)).'.*/', '\\1', $export);
+ if( strpos($type, 'Parameter ') !== false ) {
+
diff --git a/php-victorjonsson-markdowndocs.spec b/php-victorjonsson-markdowndocs.spec
index d162a98..03bc6cd 100644
--- a/php-victorjonsson-markdowndocs.spec
+++ b/php-victorjonsson-markdowndocs.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-victorjonsson-markdowndocs
#
-# Copyright (c) 2016 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2016-2021 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,8 +12,8 @@
%global github_owner victorjonsson
%global github_name PHP-Markdown-Documentation-Generator
-%global github_version 1.3.7
-%global github_commit a8244617cdce4804cd94ea508c82e8d7e29a273a
+%global github_version 1.3.8
+%global github_commit c5eb16ff5bd15ee60223883ddacba0ab8797268d
%global composer_vendor victorjonsson
%global composer_project markdowndocs
@@ -34,7 +34,6 @@ Version: %{github_version}
Release: 1%{?github_release}%{?dist}
Summary: Command line tool for generating markdown-formatted class documentation
-Group: Development/Libraries
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
@@ -46,9 +45,10 @@ Patch0: %{name}-pull-request-10.patch
Patch1: %{name}-cli-version.patch
# Modify bin autoloader
Patch2: %{name}-bin.patch
+# For PHP 8
+Patch3: %{name}-php8.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -107,6 +107,9 @@ sed -i 's#__VERSION__#%{version}#' src/PHPDocsMD/Console/CLI.php
%patch2 -p1
sed -i 's#__PHPDIR__#%{phpdir}#' bin/phpdoc-md
+: PHP 8
+%patch3 -p1
+
: Fix rpmlint "wrong-file-end-of-line-encoding" warning
sed -i 's/\r$//' README.md
@@ -130,8 +133,6 @@ AUTOLOAD
%install
-rm -rf %{buildroot}
-
: Library
mkdir -p %{buildroot}%{phpdir}
cp -rp src/PHPDocsMD %{buildroot}%{phpdir}/
@@ -146,11 +147,8 @@ install -pm 0755 bin/phpdoc-md %{buildroot}%{_bindir}/phpdoc-md
BOOTSTRAP=%{buildroot}%{phpdir}/PHPDocsMD/autoload.php
: Upstream tests
-%{_bindir}/phpunit --verbose --bootstrap $BOOTSTRAP
-
-: Upstream tests with SCLs if available
SCL_RETURN_CODE=0
-for SCL in php56 php70 php71; do
+for SCL in php php73 php74 php80; do
if which $SCL; then
$SCL %{_bindir}/phpunit --bootstrap $BOOTSTRAP || SCL_RETURN_CODE=1
fi
@@ -161,11 +159,9 @@ exit $SCL_RETURN_CODE
%endif
-%clean
-rm -rf %{buildroot}
-
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -175,6 +171,11 @@ rm -rf %{buildroot}
%changelog
+* Fri Apr 9 2021 Remi Collet <remi@remirepo.net> - 1.3.8-1
+- update to 1.3.8
+- add patch for PHP 8 from
+ https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator/pull/25
+
* Mon Jan 9 2017 Remi Collet <remi@remirepo.net> - 1.3.7-1
- add backport stuff