summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json18
-rw-r--r--php-ocramius-generated-hydrator.spec92
2 files changed, 57 insertions, 53 deletions
diff --git a/composer.json b/composer.json
index 780bdf8..db9e75a 100644
--- a/composer.json
+++ b/composer.json
@@ -4,7 +4,6 @@
"type": "library",
"license": "MIT",
"homepage": "https://github.com/Ocramius/GeneratedHydrator",
- "minimum-stability": "dev",
"keywords": [
"hydrator",
"performance",
@@ -21,14 +20,17 @@
],
"require": {
"php": "~7.0",
- "nikic/php-parser": "~2.0",
- "ocramius/code-generator-utils": "0.4.*",
+ "nikic/php-parser": "~2.0|~3.0",
+ "ocramius/code-generator-utils": "~0.4",
"zendframework/zend-hydrator": "^2.0"
},
"require-dev": {
- "phpunit/phpunit": "~5.0",
- "squizlabs/php_codesniffer": "~2.0",
- "athletic/athletic": "~0.1.6"
+ "phpunit/phpunit": "^5.7.21",
+ "squizlabs/php_codesniffer": "^3.0",
+ "phpbench/phpbench": "^0.13.0",
+ "zendframework/zend-filter": "^2.7",
+ "zendframework/zend-servicemanager": "^3.2",
+ "zendframework/zend-stdlib": "^3.1"
},
"autoload": {
"psr-0": {
@@ -37,14 +39,14 @@
},
"autoload-dev": {
"psr-0": {
- "GeneratedHydratorPerformance\\": "tests",
+ "GeneratedHydratorBenchmark\\": "benchmarks",
"GeneratedHydratorTest\\": "tests",
"GeneratedHydratorTestAsset\\": "tests"
}
},
"extra": {
"branch-alias": {
- "dev-master": "2.1.x-dev"
+ "dev-master": "2.2.x-dev"
}
}
}
diff --git a/php-ocramius-generated-hydrator.spec b/php-ocramius-generated-hydrator.spec
index f351cdf..39c00f2 100644
--- a/php-ocramius-generated-hydrator.spec
+++ b/php-ocramius-generated-hydrator.spec
@@ -1,4 +1,4 @@
-# remirpeo spec file for php-ocramius-generated-hydrator, from
+# remirepo spec file for php-ocramius-generated-hydrator, from:
#
# Fedora spec file for php-ocramius-generated-hydrator
#
@@ -12,21 +12,21 @@
%global github_owner Ocramius
%global github_name GeneratedHydrator
-%global github_version 2.0.0
-%global github_commit 98a731e7d4e393513cb6f4e7f120da853680fb50
+%global github_version 2.1.0
+%global github_commit 7cf05fe50e23e5f1c3bb063744360a23552d6075
%global composer_vendor ocramius
%global composer_project generated-hydrator
# "php": "~7.0"
%global php_min_ver 7.0
-# "nikic/php-parser": "~2.0"
+# "nikic/php-parser": "~2.0|~3.0"
%global php_parser_min_ver 2.0
%global php_parser_max_ver 3
-# "ocramius/code-generator-utils": "0.4.*"
-%global ocramius_cgu_min_ver 0.4.0
-%global ocramius_cgu_max_ver 0.5
-# "zendframework/zend-hydrator": "~2.0"
+# "ocramius/code-generator-utils": "~0.4"
+%global ocramius_cgu_min_ver 0.4
+%global ocramius_cgu_max_ver 1.0
+# "zendframework/zend-hydrator": "^2.0"
%global zf_hydrator_min_ver 2.0
%global zf_hydrator_max_ver 3
@@ -37,7 +37,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 3%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: An object hydrator
Group: Development/Libraries
@@ -45,37 +45,38 @@ License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if %{with_tests}
# composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(nikic/php-parser) < %{php_parser_max_ver}
BuildRequires: php-composer(nikic/php-parser) >= %{php_parser_min_ver}
-BuildRequires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
BuildRequires: php-composer(ocramius/code-generator-utils) < %{ocramius_cgu_max_ver}
+BuildRequires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
BuildRequires: php-composer(phpunit/phpunit) >= 5.0
-BuildRequires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
BuildRequires: php-composer(zendframework/zend-hydrator) < %{zf_hydrator_max_ver}
-# phpcompatinfo (computed from version 2.0.0)
-BuildRequires: php-pcre
+BuildRequires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
+# phpcompatinfo (computed from version 2.1.0)
+BuildRequires: php-date
BuildRequires: php-reflection
BuildRequires: php-spl
# Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
Requires: php-composer(nikic/php-parser) < %{php_parser_max_ver}
Requires: php-composer(nikic/php-parser) >= %{php_parser_min_ver}
-Requires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
Requires: php-composer(ocramius/code-generator-utils) < %{ocramius_cgu_max_ver}
-Requires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
+Requires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
Requires: php-composer(zendframework/zend-hydrator) < %{zf_hydrator_max_ver}
-# phpcompatinfo (computed from version 2.0.0)
+Requires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
+# phpcompatinfo (computed from version 2.1.0)
Requires: php-reflection
Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -98,32 +99,25 @@ cat <<'AUTOLOAD' | tee src/GeneratedHydrator/autoload.php
/**
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
- *
- * @return \Symfony\Component\ClassLoader\ClassLoader
*/
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
+\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydrator\\', __DIR__);
-$fedoraClassLoader->addPrefix('GeneratedHydrator\\', dirname(__DIR__));
-
-// Required dependencies
-require_once '%{phpdir}/CodeGenerationUtils/autoload.php';
-require_once '%{phpdir}/PhpParser2/autoload.php';
-require_once '%{phpdir}/Zend/autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/CodeGenerationUtils/autoload.php',
+ [
+ '%{phpdir}/PhpParser3/autoload.php',
+ '%{phpdir}/PhpParser2/autoload.php',
+ ],
+ '%{phpdir}/Zend/autoload.php',
+]);
return $fedoraClassLoader;
AUTOLOAD
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{phpdir}
cp -rp src/GeneratedHydrator %{buildroot}%{phpdir}/
@@ -134,24 +128,27 @@ cp -rp src/GeneratedHydrator %{buildroot}%{phpdir}/
: Create tests bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
-$fedoraClassLoader = require '%{buildroot}%{phpdir}/GeneratedHydrator/autoload.php';
-$fedoraClassLoader->addPrefix('GeneratedHydratorPerformance\\', __DIR__.'/tests');
-$fedoraClassLoader->addPrefix('GeneratedHydratorTest\\', __DIR__.'/tests');
-$fedoraClassLoader->addPrefix('GeneratedHydratorTestAsset\\', __DIR__.'/tests');
+require '%{buildroot}%{phpdir}/GeneratedHydrator/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydratorTest\\', __DIR__.'/tests/GeneratedHydratorTest');
+\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydratorTestAsset\\', __DIR__.'/tests/GeneratedHydratorTestAsset');
BOOTSTRAP
-%{_bindir}/phpunit --verbose --bootstrap bootstrap.php
+: Upstream tests
+RETURN_CODE=0
+for PHP_EXEC in php php71 php72; do
+ if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC %{_bindir}/phpunit --verbose --bootstrap bootstrap.php \
+ || RETURN_CODE=1
+ fi
+done
+exit $RETURN_CODE
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -160,6 +157,11 @@ rm -rf %{buildroot}
%changelog
+* Sat Aug 05 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.1.0-1
+- Update to 2.1.0 (RHBZ #1473994)
+- Switch autoloader to php-composer(fedora/autoloader)
+- Test with SCLs if available
+
* Mon Jan 23 2017 Remi Collet <remi@fedoraproject.org> - 2.0.0-3
- change BR order, fix FTBFS from Koschei