diff options
author | Remi Collet <remi@remirepo.net> | 2017-11-09 10:24:03 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-11-09 10:24:03 +0100 |
commit | bc326a92dc11f2485e3a73eaf2fbbd4070f67fdb (patch) | |
tree | 7c227c4cff6b217d43294439de0dd83a30136d03 | |
parent | d44e64963089543c103331f3ff7f65174c1aaac5 (diff) |
fix FTBFS from Koschei, add patch for PHP 7.2
-rw-r--r-- | php-kdyby-events-php72.patch | 259 | ||||
-rw-r--r-- | php-kdyby-events.spec | 10 |
2 files changed, 267 insertions, 2 deletions
diff --git a/php-kdyby-events-php72.patch b/php-kdyby-events-php72.patch new file mode 100644 index 0000000..8511297 --- /dev/null +++ b/php-kdyby-events-php72.patch @@ -0,0 +1,259 @@ +Inspired from https://github.com/Kdyby/Events/pull/112 +Adapted for 3.1.0 + + +diff -ru events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/Diagnostics/Panel.php events-ok/src/Events/Diagnostics/Panel.php +--- events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/Diagnostics/Panel.php 2017-05-15 09:03:49.000000000 +0200 ++++ events-ok/src/Events/Diagnostics/Panel.php 2017-11-09 09:34:58.352160330 +0100 +@@ -26,8 +26,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class Panel extends Nette\Object implements Tracy\IBarPanel ++class Panel implements Tracy\IBarPanel + { ++ use \Nette\SmartObject; + + /** + * @var EventManager +diff -ru events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/LifeCycleEvent.php events-ok/src/Events/LifeCycleEvent.php +--- events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/LifeCycleEvent.php 2017-05-15 09:03:49.000000000 +0200 ++++ events-ok/src/Events/LifeCycleEvent.php 2017-11-09 09:34:44.207084241 +0100 +@@ -15,8 +15,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-final class LifeCycleEvent extends Nette\Object ++final class LifeCycleEvent + { ++ use \Nette\SmartObject; + + /** + * Occurs before the application loads presenter +diff -ru events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/SymfonyDispatcher.php events-ok/src/Events/SymfonyDispatcher.php +--- events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/SymfonyDispatcher.php 2017-05-15 09:03:49.000000000 +0200 ++++ events-ok/src/Events/SymfonyDispatcher.php 2017-11-09 09:34:31.340015026 +0100 +@@ -26,8 +26,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class SymfonyDispatcher extends Nette\Object implements EventDispatcherInterface ++class SymfonyDispatcher implements EventDispatcherInterface + { ++ use \Nette\SmartObject; + + /** + * @var EventManager +diff -ru events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/tests/KdybyTests/Events/mocks.php events-ok/tests/KdybyTests/Events/mocks.php +--- events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/tests/KdybyTests/Events/mocks.php 2017-05-15 09:03:49.000000000 +0200 ++++ events-ok/tests/KdybyTests/Events/mocks.php 2017-11-09 09:32:48.112459742 +0100 +@@ -24,8 +24,9 @@ + * @method onMagic(FooMock $foo, $int) + * @method onStartup(FooMock $foo, $int) + */ +-class FooMock extends Nette\Object ++class FooMock + { ++ use \Nette\SmartObject; + + /** + * @var array|callable[]|Event +@@ -71,8 +72,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class LoremListener extends Nette\Object implements Kdyby\Events\Subscriber ++class LoremListener implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -165,8 +167,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class EventListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class EventListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -204,8 +207,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class EventListenerMock2 extends Nette\Object implements Kdyby\Events\Subscriber ++class EventListenerMock2 implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + /** + * @return array +@@ -235,8 +239,9 @@ + /** + * @author Pavol Sivý <pavol@sivy.net> + */ +-class EventListenerConstructorMock extends Nette\Object implements Kdyby\Events\Subscriber ++class EventListenerConstructorMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public function __construct(RouterFactory $routerFactory) + { +@@ -268,8 +273,9 @@ + /** + * @author Pavol Sivý <pavol@sivy.net> + */ +-class EventListenerConstructorMock2 extends Nette\Object implements Kdyby\Events\Subscriber ++class EventListenerConstructorMock2 implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public function __construct(RouterFactory $routerFactory) + { +@@ -299,8 +305,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class MagicEventListenerMock extends Nette\Object implements Kdyby\Events\CallableSubscriber ++class MagicEventListenerMock implements Kdyby\Events\CallableSubscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -329,8 +336,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class NamespacedEventListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class NamespacedEventListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -359,8 +367,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class MethodAliasListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class MethodAliasListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -389,8 +398,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class PriorityMethodAliasListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class PriorityMethodAliasListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -419,8 +429,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class HigherPriorityMethodAliasListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class HigherPriorityMethodAliasListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -449,8 +460,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class MultipleEventMethodsListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class MultipleEventMethodsListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -490,8 +502,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class CustomNamespacedEventListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class CustomNamespacedEventListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -520,8 +533,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class FirstInvalidListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class FirstInvalidListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + /** + * @return array +@@ -540,8 +554,9 @@ + /** + * @author Filip Procházka <filip@prochazka.su> + */ +-class SecondInvalidListenerMock extends Nette\Object implements Kdyby\Events\Subscriber ++class SecondInvalidListenerMock implements Kdyby\Events\Subscriber + { ++ use \Nette\SmartObject; + + /** + * @return array +@@ -557,8 +572,9 @@ + + + +-class ListenerWithoutInterface extends Nette\Object ++class ListenerWithoutInterface + { ++ use \Nette\SmartObject; + + public $calls = []; + +@@ -571,8 +587,9 @@ + + + +-class RouterFactory extends Nette\Object ++class RouterFactory + { ++ use \Nette\SmartObject; + + /** + * @return \KdybyTests\Events\SampleRouter +@@ -610,8 +627,10 @@ + + + +-class ParentClass extends Nette\Object ++class ParentClass + { ++ use \Nette\SmartObject; ++ + public $onCreate = []; + + public function create($arg = NULL) { +@@ -764,8 +783,9 @@ + + + +-class DispatchOrderMock extends Nette\Object ++class DispatchOrderMock + { ++ use \Nette\SmartObject; + + /** + * @globalDispatchFirst diff --git a/php-kdyby-events.spec b/php-kdyby-events.spec index d22e69b..bba9327 100644 --- a/php-kdyby-events.spec +++ b/php-kdyby-events.spec @@ -18,7 +18,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 3.1.0 -%global specrel 1 +%global specrel 2 Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Events for Nette Framework @@ -31,6 +31,8 @@ Source1: makesrc.sh # Autoloader Source2: %{name}-autoload.php +Patch0: %{name}-php72.patch + BuildArch: noarch %if %{with_tests} BuildRequires: php-pcre @@ -99,6 +101,7 @@ To use this library, you just have to add, in your project: %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 cp %{SOURCE2} src/%{ns_project}/autoload.php @@ -138,7 +141,7 @@ php -r 'require "vendor/autoload.php";' : Run test suite in sources tree ret=0 # PHP 7.2: https://github.com/Kdyby/Events/issues/108 -for cmd in php php56 php70 php71; do +for cmd in php php56 php70 php71 php72; do if which $cmd; then $cmd %{_bindir}/nette-tester --colors 0 -p $cmd -C tests/KdybyTests -s || ret=1 fi @@ -158,6 +161,9 @@ exit $ret %changelog +* Thu Nov 9 2017 Remi Collet <remi@remirepo.net> - 3.1.0-2 +- fix FTBFS from Koschei, add patch for PHP 7.2 + * Mon May 15 2017 Remi Collet <remi@remirepo.net> - 3.1.0-1 - Update to 3.1.0 - add dependency on nette/reflection |