diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eec5d12..86f4af6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: php-actions/composer@v6 + with: + php_extensions: pcntl - name: PHPUnit Tests uses: php-actions/phpunit@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77f00ec..f0d6d2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,7 @@ jobs: ## box.phar requires php72 php-version: '7.4' tools: composer:v2 + extensions: pcntl - name: Set env run: | diff --git a/composer.json b/composer.json index f5e09b2..2b137f3 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,9 @@ "name": "totten/loco", "description": "Loco is the YAML-based \"local-compose\" process manager", "require": { + "ext-json": "*", + "ext-posix": "*", + "ext-pcntl": "*", "marcj/topsort": "^1.1", "symfony/yaml": "~4.4", "symfony/finder": "~4.4", diff --git a/composer.lock b/composer.lock index 5f063f7..e39beeb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ceefe675648adc9385bec252f90ed359", + "content-hash": "5cc8ab8769b53e698e298f78ab2e7bb8", "packages": [ { "name": "civicrm/composer-downloads-plugin", @@ -1544,10 +1544,14 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "ext-json": "*", + "ext-posix": "*", + "ext-pcntl": "*" + }, "platform-dev": [], "platform-overrides": { "php": "7.1.4" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/src/Loco.php b/src/Loco.php index 8f41d10..0995d8f 100644 --- a/src/Loco.php +++ b/src/Loco.php @@ -68,7 +68,7 @@ public static function dispatcher() { */ public static function filter($eventName, $data) { $event = new LocoEvent($data); - self::dispatcher()->dispatch($eventName, $event); + self::dispatcher()->dispatch($event, $eventName); return $event->getArguments(); } diff --git a/tests/LocoFacadeTest.php b/tests/LocoFacadeTest.php index 7c40dd0..b5d3eb2 100644 --- a/tests/LocoFacadeTest.php +++ b/tests/LocoFacadeTest.php @@ -22,7 +22,7 @@ public function testDispatcher() { Loco::dispatcher()->addListener('my-test', function() use (&$called) { $called = TRUE; }); - Loco::dispatcher()->dispatch('my-test', new LocoEvent()); + Loco::dispatcher()->dispatch(new LocoEvent(), 'my-test'); $this->assertEquals(TRUE, $called); }