summaryrefslogtreecommitdiffstats
path: root/php-PhpOption.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-PhpOption.spec')
-rw-r--r--php-PhpOption.spec56
1 files changed, 31 insertions, 25 deletions
diff --git a/php-PhpOption.spec b/php-PhpOption.spec
index 6641117..20b0c2c 100644
--- a/php-PhpOption.spec
+++ b/php-PhpOption.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-PhpOption
#
-# Copyright (c) 2013-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2013-2019 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,14 +12,14 @@
%global github_owner schmittjoh
%global github_name php-option
-%global github_version 1.5.0
-%global github_commit 94e644f7d2051a5f0fcf77d81605f152eecff0ed
+%global github_version 1.6.0
+%global github_commit f4e7a6a1382183412246f0d361078c29fb85089e
%global composer_vendor phpoption
%global composer_project phpoption
-# "php": ">=5.3.0"
-%global php_min_ver 5.3.0
+# "php": "^5.5.9 || ^7.0"
+%global php_min_ver 5.5.9
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
@@ -28,13 +28,16 @@
Name: php-PhpOption
Version: %{github_version}
-Release: 3%{?dist}
+Release: 1%{?dist}
Summary: Option type for PHP
-Group: Development/Libraries
License: ASL 2.0
URL: https://github.com/%{github_owner}/%{github_name}
-Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+
+# GitHub export does not include tests.
+# Run php-PhpOption-get-source.sh to create full source.
+Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
+Source1: %{name}-get-source.sh
BuildArch: noarch
# Tests
@@ -42,7 +45,7 @@ BuildArch: noarch
BuildRequires: php-composer(phpunit/phpunit)
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
-## phpcompatinfo (computed from version 1.5.0)
+## phpcompatinfo (computed from version 1.6.0)
BuildRequires: php-spl
## Autoloader
BuildRequires: php-composer(fedora/autoloader)
@@ -50,7 +53,7 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 1.5.0)
+# phpcompatinfo (computed from version 1.6.0)
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
@@ -62,25 +65,25 @@ Provides: php-%{composer_vendor} = %{version}-%{release}
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%description
-This package adds an Option type for PHP.
+An Option type for PHP.
The Option type is intended for cases where you sometimes might return a value
-(typically an object), and sometimes you might return no value (typically null)
-depending on arguments, or other runtime factors.
+(typically an object), and sometimes you might return a base value (typically
+null) depending on arguments, or other runtime factors.
-Often times, you forget to handle the case where no value is returned. Not
-intentionally of course, but maybe you did not account for all possible states
-of the system; or maybe you indeed covered all cases, then time goes on, code
-is refactored, some of these your checks might become invalid, or incomplete.
-Suddenly, without noticing, the no value case is not handled anymore. As a
-result, you might sometimes get fatal PHP errors telling you that you called a
-method on a non-object; users might see blank pages, or worse.
+Often times, you forget to handle the case where a base value should be
+returned. Not intentionally of course, but maybe you did not account for all
+possible states of the system; or maybe you indeed covered all cases, then time
+goes on, code is refactored, some of these your checks might become invalid, or
+incomplete. Suddenly, without noticing, the base value case is not handled
+anymore. As a result, you might sometimes get fatal PHP errors telling you that
+you called a method on a non-object; users might see blank pages, or worse.
On one hand, the Option type forces a developer to consciously think about both
-cases (returning a value, or returning no value). That in itself will already
-make your code more robust. On the other hand, the Option type also allows the
-API developer to provide more concise API methods, and empowers the API user in
-how he consumes these methods.
+cases (returning a value, or returning a base value). That in itself will
+already make your code more robust. On the other hand, the Option type also
+allows the API developer to provide more concise API methods, and empowers the
+API user in how he consumes these methods.
Autoloader: %{phpdir}/PhpOption/autoload.php
@@ -113,7 +116,7 @@ cp -rp src/PhpOption %{buildroot}%{phpdir}/
: Upstream tests
RETURN_CODE=0
PHPUNIT=$(which phpunit)
-for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do
+for PHP_EXEC in "" %{?rhel:php56 php70} php71 php72 php73 php74; do
if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
$PHP_EXEC $PHPUNIT --verbose \
--bootstrap %{buildroot}%{phpdir}/PhpOption/autoload.php \
@@ -135,6 +138,9 @@ exit $RETURN_CODE
%changelog
+* Sun Dec 01 2019 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.6.0-1
+- Update to 1.6.0 (RHBZ #1771062)
+
* Thu Sep 07 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.5.0-3
- Bump release for rebuild