diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..b270598
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,36 @@
+name: CI
+on: [push]
+jobs:
+ Linter:
+ runs-on: ubuntu-latest
+ container: php:8.2
+ steps:
+ - uses: actions/checkout@v3
+ - name: Install composer
+ run: apt-get update -yq && apt-get install git wget procps unzip -y && pecl install -o -f redis && rm -rf /tmp/pear && docker-php-ext-enable redis && wget https://getcomposer.org/composer.phar && php composer.phar install --dev
+ - name: Validate composer.json and composer.lock
+ run: php composer.phar validate --strict
+ - name: Install dependencies
+ run: php composer.phar install --dev --prefer-dist --no-progress
+ - name: Run PHPCS Linter
+ run: php -d memory_limit=256M vendor/bin/phpcs -s --standard=ruleset.xml
+ PHPTest:
+ runs-on: ubuntu-latest
+ container: php:${{ matrix.php_version }}
+ strategy:
+ matrix:
+ php_version: [8.1, 8.2,8.3,8.4]
+ services:
+ redis:
+ image: redis:7.0
+ options: >-
+ --health-cmd "redis-cli ping"
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+ steps:
+ - uses: actions/checkout@v3
+ - name: Install composer
+ run: apt-get update -yq && apt-get install git wget procps unzip -y && pecl install -o -f redis && rm -rf /tmp/pear && docker-php-ext-enable redis && wget https://getcomposer.org/composer.phar && php composer.phar install --dev
+ - name: Run PHP ${{ matrix.php_version }}} Unit Tests
+ run: php vendor/bin/phpunit --verbose --configuration phpunit.xml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b75f7d4..276f6e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,32 @@
+# 2.5.3 (2025-06-08)
+- Update typing of Log() to support all psr\log versions
+
+- # 2.5.2 (2025-06-08)
+- Update typing of Log() to support all psr\log versions
+
+# 2.5.1 (2025-06-08)
+- Update psr/log version requirements
+
+# 2.5.0 (2025-06-08)
+- Update packages
+
+# 2.4.0 (2024-12-11)
+- Update packages (psr/log ^3.0.2)
+
+# 2.3.0 (2024-09-04)
+- Update packages
+
+# 2.2.0 (2023-03-20)
+- Update pacakges
+- Bump requirements to PHP >= 8.1
+
+# 2.1.3 (2023-11-15)
+- Resolved issue with SET EX TTL's using unix-timestamps
+
+# 2.1.2 (2023-03-22)
+- Update composer packages
+- Update git information (GitHub)
+
# 2.1.1 (2023-03-20)
- Changed setex to set with EX values
- Added TTLs to missing keys
diff --git a/README.md b/README.md
index 4c6ceb9..c2d7234 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-php-resque: PHP Resque Worker (and Enqueue)
+php-resque: PHP Background (Resque) Worker
===========================================
Resque is a Redis-backed library for creating background jobs, placing
@@ -42,7 +42,7 @@ On top of the original fork (chrisboulton/php-resque) I have added:
## Requirements ##
-* PHP 7.0+
+* PHP 8.1+
* phpredis
* Redis 2.2+
@@ -53,19 +53,9 @@ Composer package inside your project.
If you're not familiar with Composer, please see .
-1. Add php-resque to your application's composer.json.
+1. Run `composer require idanoo/php-resque`.
-```json
-{
- "require": {
- "idanoo/php-resque": "^2.0"
- }
-}
-```
-
-2. Run `composer install`.
-
-3. If you haven't already, add the Composer autoload to your project's
+2. If you haven't already, add the Composer autoload to your project's
initialization file. (example)
```sh
@@ -84,7 +74,7 @@ Resque::setBackend('redis:6379');
$args = ['name' => 'TestName'];
-Resque::enqueue('default', 'My_Job', $args);
+Resque::enqueue('default', '\App\MyJobClass', $args);
```
### Defining Jobs ###
@@ -92,7 +82,9 @@ Resque::enqueue('default', 'My_Job', $args);
Each job should be in its own class, and include a `perform` method.
```php
-class My_Job
+namespace \App;
+
+class MyJobClass
{
public function perform()
{
@@ -115,7 +107,9 @@ The `tearDown` method, if defined, will be called after the job finishes.
```php
-class My_Job
+namespace App;
+
+class MyJobClass
{
public function setUp()
{
@@ -139,17 +133,17 @@ class My_Job
This method can be used to conveniently remove a job from a queue.
```php
-// Removes job class 'My_Job' of queue 'default'
-Resque::dequeue('default', ['My_Job']);
+// Removes job class '\App\MyJobClass' of queue 'default'
+Resque::dequeue('default', ['\App\MyJobClass']);
-// Removes job class 'My_Job' with Job ID '087df5819a790ac666c9608e2234b21e' of queue 'default'
-Resque::dequeue('default', ['My_Job' => '087df5819a790ac666c9608e2234b21e']);
+// Removes job class '\App\MyJobClass' with Job ID '087df5819a790ac666c9608e2234b21e' of queue 'default'
+Resque::dequeue('default', ['\App\MyJobClass' => '087df5819a790ac666c9608e2234b21e']);
-// Removes job class 'My_Job' with arguments of queue 'default'
-Resque::dequeue('default', ['My_Job' => ['foo' => 1, 'bar' => 2]]);
+// Removes job class '\App\MyJobClass' with arguments of queue 'default'
+Resque::dequeue('default', ['\App\MyJobClass' => ['foo' => 1, 'bar' => 2]]);
// Removes multiple jobs
-Resque::dequeue('default', ['My_Job', 'My_Job2']);
+Resque::dequeue('default', ['\App\MyJobClass', '\App\MyJobClass2']);
```
If no jobs are given, this method will dequeue all jobs matching the provided queue.
@@ -170,7 +164,7 @@ To track the status of a job, pass `true` as the fourth argument to
returned:
```php
-$token = Resque::enqueue('default', 'My_Job', $args, true);
+$token = Resque::enqueue('default', '\App\MyJobClass', $args, true);
echo $token;
```
diff --git a/composer.json b/composer.json
index 60c281f..15199f0 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
},
"description": "Redis backed library for creating background jobs and processing them later. Based on resque for Ruby. Originally forked from chrisboulton/php-resque.",
"keywords": ["job", "background", "redis", "resque", "php"],
- "homepage": "https://gitlab.com/idanoo/php-resque/",
+ "homepage": "https://github.com/idanoo/php-resque",
"license": "MIT",
"authors": [
{
@@ -16,9 +16,9 @@
}
],
"require": {
- "php": ">7.4",
- "psr/log": "^1.1.0",
- "colinmollenhour/credis": "^1.13.0"
+ "php": ">=8.1",
+ "psr/log": "^1.1 || ^2.0 || ^3.0",
+ "colinmollenhour/credis": "^1.14.0"
},
"require-dev": {
"phpunit/phpunit": "^9",
@@ -40,8 +40,8 @@
}
},
"support": {
- "issues": "https://gitlab.com/idanoo/php-resque/issues",
- "source": "https://gitlab.com/idanoo/php-resque"
+ "issues": "https://github.com/idanoo/php-resque/issues",
+ "source": "https://github.com/idanoo/php-resque"
},
"config": {
"allow-plugins": {
diff --git a/composer.lock b/composer.lock
index f3910d0..bb2aed1 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,24 +4,24 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "3f81232ce308e8074ac0beeaec83a3eb",
+ "content-hash": "d8e5313006d5c73b54ee6a410b1ad016",
"packages": [
{
"name": "colinmollenhour/credis",
- "version": "v1.13.1",
+ "version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/colinmollenhour/credis.git",
- "reference": "85df015088e00daf8ce395189de22c8eb45c8d49"
+ "reference": "f4930b426f6b1238b687a1ffe6ee5af7f835b40a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/85df015088e00daf8ce395189de22c8eb45c8d49",
- "reference": "85df015088e00daf8ce395189de22c8eb45c8d49",
+ "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/f4930b426f6b1238b687a1ffe6ee5af7f835b40a",
+ "reference": "f4930b426f6b1238b687a1ffe6ee5af7f835b40a",
"shasum": ""
},
"require": {
- "php": ">=5.6.0"
+ "php": ">=7.4.0"
},
"suggest": {
"ext-redis": "Improved performance for communicating with redis"
@@ -49,36 +49,36 @@
"homepage": "https://github.com/colinmollenhour/credis",
"support": {
"issues": "https://github.com/colinmollenhour/credis/issues",
- "source": "https://github.com/colinmollenhour/credis/tree/v1.13.1"
+ "source": "https://github.com/colinmollenhour/credis/tree/v1.17.0"
},
- "time": "2022-06-20T22:56:59+00:00"
+ "time": "2025-02-10T18:58:46+00:00"
},
{
"name": "psr/log",
- "version": "1.1.4",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Log\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -99,9 +99,9 @@
"psr-3"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/1.1.4"
+ "source": "https://github.com/php-fig/log/tree/3.0.2"
},
- "time": "2021-05-03T11:20:27+00:00"
+ "time": "2024-09-11T13:17:53+00:00"
}
],
"packages-dev": [
@@ -185,30 +185,30 @@
},
{
"name": "doctrine/instantiator",
- "version": "1.4.1",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
- "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc"
+ "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc",
- "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
+ "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
"shasum": ""
},
"require": {
- "php": "^7.1 || ^8.0"
+ "php": "^8.1"
},
"require-dev": {
- "doctrine/coding-standard": "^9",
+ "doctrine/coding-standard": "^11",
"ext-pdo": "*",
"ext-phar": "*",
- "phpbench/phpbench": "^0.16 || ^1",
- "phpstan/phpstan": "^1.4",
- "phpstan/phpstan-phpunit": "^1",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.22"
+ "phpbench/phpbench": "^1.2",
+ "phpstan/phpstan": "^1.9.4",
+ "phpstan/phpstan-phpunit": "^1.3",
+ "phpunit/phpunit": "^9.5.27",
+ "vimeo/psalm": "^5.4"
},
"type": "library",
"autoload": {
@@ -235,7 +235,7 @@
],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
- "source": "https://github.com/doctrine/instantiator/tree/1.4.1"
+ "source": "https://github.com/doctrine/instantiator/tree/2.0.0"
},
"funding": [
{
@@ -251,20 +251,20 @@
"type": "tidelift"
}
],
- "time": "2022-03-03T08:28:38+00:00"
+ "time": "2022-12-30T00:23:10+00:00"
},
{
"name": "myclabs/deep-copy",
- "version": "1.11.0",
+ "version": "1.13.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614"
+ "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614",
- "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c",
+ "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c",
"shasum": ""
},
"require": {
@@ -272,11 +272,12 @@
},
"conflict": {
"doctrine/collections": "<1.6.8",
- "doctrine/common": "<2.13.3 || >=3,<3.2.2"
+ "doctrine/common": "<2.13.3 || >=3 <3.2.2"
},
"require-dev": {
"doctrine/collections": "^1.6.8",
"doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpspec/prophecy": "^1.10",
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
"type": "library",
@@ -302,7 +303,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
- "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0"
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1"
},
"funding": [
{
@@ -310,29 +311,31 @@
"type": "tidelift"
}
],
- "time": "2022-03-03T13:19:32+00:00"
+ "time": "2025-04-29T12:36:36+00:00"
},
{
"name": "nikic/php-parser",
- "version": "v4.15.1",
+ "version": "v5.5.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900"
+ "reference": "ae59794362fe85e051a58ad36b289443f57be7a9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
- "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9",
+ "reference": "ae59794362fe85e051a58ad36b289443f57be7a9",
"shasum": ""
},
"require": {
+ "ext-ctype": "*",
+ "ext-json": "*",
"ext-tokenizer": "*",
- "php": ">=7.0"
+ "php": ">=7.4"
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
- "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
+ "phpunit/phpunit": "^9.0"
},
"bin": [
"bin/php-parse"
@@ -340,7 +343,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.9-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -364,26 +367,27 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0"
},
- "time": "2022-09-04T07:30:47+00:00"
+ "time": "2025-05-31T08:24:38+00:00"
},
{
"name": "phar-io/manifest",
- "version": "2.0.3",
+ "version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/phar-io/manifest.git",
- "reference": "97803eca37d319dfa7826cc2437fc020857acb53"
+ "reference": "54750ef60c58e43759730615a392c31c80e23176"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
- "reference": "97803eca37d319dfa7826cc2437fc020857acb53",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176",
"shasum": ""
},
"require": {
"ext-dom": "*",
+ "ext-libxml": "*",
"ext-phar": "*",
"ext-xmlwriter": "*",
"phar-io/version": "^3.0.1",
@@ -424,9 +428,15 @@
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
"support": {
"issues": "https://github.com/phar-io/manifest/issues",
- "source": "https://github.com/phar-io/manifest/tree/2.0.3"
+ "source": "https://github.com/phar-io/manifest/tree/2.0.4"
},
- "time": "2021-07-20T11:28:43+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-03T12:33:53+00:00"
},
{
"name": "phar-io/version",
@@ -543,44 +553,44 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "9.2.17",
+ "version": "9.2.32",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8"
+ "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8",
- "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5",
+ "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
- "nikic/php-parser": "^4.14",
+ "nikic/php-parser": "^4.19.1 || ^5.1.0",
"php": ">=7.3",
- "phpunit/php-file-iterator": "^3.0.3",
- "phpunit/php-text-template": "^2.0.2",
- "sebastian/code-unit-reverse-lookup": "^2.0.2",
- "sebastian/complexity": "^2.0",
- "sebastian/environment": "^5.1.2",
- "sebastian/lines-of-code": "^1.0.3",
- "sebastian/version": "^3.0.1",
- "theseer/tokenizer": "^1.2.0"
+ "phpunit/php-file-iterator": "^3.0.6",
+ "phpunit/php-text-template": "^2.0.4",
+ "sebastian/code-unit-reverse-lookup": "^2.0.3",
+ "sebastian/complexity": "^2.0.3",
+ "sebastian/environment": "^5.1.5",
+ "sebastian/lines-of-code": "^1.0.4",
+ "sebastian/version": "^3.0.2",
+ "theseer/tokenizer": "^1.2.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^9.6"
},
"suggest": {
- "ext-pcov": "*",
- "ext-xdebug": "*"
+ "ext-pcov": "PHP extension that provides line coverage",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.2-dev"
+ "dev-main": "9.2.x-dev"
}
},
"autoload": {
@@ -608,7 +618,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17"
+ "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32"
},
"funding": [
{
@@ -616,7 +627,7 @@
"type": "github"
}
],
- "time": "2022-08-30T12:24:04+00:00"
+ "time": "2024-08-22T04:23:01+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -861,50 +872,50 @@
},
{
"name": "phpunit/phpunit",
- "version": "9.5.24",
+ "version": "9.6.23",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5"
+ "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5",
- "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95",
+ "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.3.1",
+ "doctrine/instantiator": "^1.5.0 || ^2",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
- "myclabs/deep-copy": "^1.10.1",
- "phar-io/manifest": "^2.0.3",
- "phar-io/version": "^3.0.2",
+ "myclabs/deep-copy": "^1.13.1",
+ "phar-io/manifest": "^2.0.4",
+ "phar-io/version": "^3.2.1",
"php": ">=7.3",
- "phpunit/php-code-coverage": "^9.2.13",
- "phpunit/php-file-iterator": "^3.0.5",
+ "phpunit/php-code-coverage": "^9.2.32",
+ "phpunit/php-file-iterator": "^3.0.6",
"phpunit/php-invoker": "^3.1.1",
- "phpunit/php-text-template": "^2.0.3",
- "phpunit/php-timer": "^5.0.2",
- "sebastian/cli-parser": "^1.0.1",
- "sebastian/code-unit": "^1.0.6",
- "sebastian/comparator": "^4.0.5",
- "sebastian/diff": "^4.0.3",
- "sebastian/environment": "^5.1.3",
- "sebastian/exporter": "^4.0.3",
- "sebastian/global-state": "^5.0.1",
- "sebastian/object-enumerator": "^4.0.3",
- "sebastian/resource-operations": "^3.0.3",
- "sebastian/type": "^3.1",
+ "phpunit/php-text-template": "^2.0.4",
+ "phpunit/php-timer": "^5.0.3",
+ "sebastian/cli-parser": "^1.0.2",
+ "sebastian/code-unit": "^1.0.8",
+ "sebastian/comparator": "^4.0.8",
+ "sebastian/diff": "^4.0.6",
+ "sebastian/environment": "^5.1.5",
+ "sebastian/exporter": "^4.0.6",
+ "sebastian/global-state": "^5.0.7",
+ "sebastian/object-enumerator": "^4.0.4",
+ "sebastian/resource-operations": "^3.0.4",
+ "sebastian/type": "^3.2.1",
"sebastian/version": "^3.0.2"
},
"suggest": {
- "ext-soap": "*",
- "ext-xdebug": "*"
+ "ext-soap": "To be able to generate mocks based on WSDL files",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
},
"bin": [
"phpunit"
@@ -912,7 +923,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.5-dev"
+ "dev-master": "9.6-dev"
}
},
"autoload": {
@@ -943,7 +954,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24"
+ "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23"
},
"funding": [
{
@@ -953,22 +965,34 @@
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
+ },
+ {
+ "url": "https://liberapay.com/sebastianbergmann",
+ "type": "liberapay"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/sebastianbergmann",
+ "type": "thanks_dev"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
+ "type": "tidelift"
}
],
- "time": "2022-08-30T07:42:16+00:00"
+ "time": "2025-05-02T06:40:34+00:00"
},
{
"name": "sebastian/cli-parser",
- "version": "1.0.1",
+ "version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2"
+ "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2",
- "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
+ "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
"shasum": ""
},
"require": {
@@ -1003,7 +1027,7 @@
"homepage": "https://github.com/sebastianbergmann/cli-parser",
"support": {
"issues": "https://github.com/sebastianbergmann/cli-parser/issues",
- "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1"
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2"
},
"funding": [
{
@@ -1011,7 +1035,7 @@
"type": "github"
}
],
- "time": "2020-09-28T06:08:49+00:00"
+ "time": "2024-03-02T06:27:43+00:00"
},
{
"name": "sebastian/code-unit",
@@ -1126,16 +1150,16 @@
},
{
"name": "sebastian/comparator",
- "version": "4.0.6",
+ "version": "4.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "55f4261989e546dc112258c7a75935a81a7ce382"
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382",
- "reference": "55f4261989e546dc112258c7a75935a81a7ce382",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a",
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a",
"shasum": ""
},
"require": {
@@ -1188,7 +1212,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
- "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6"
+ "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8"
},
"funding": [
{
@@ -1196,24 +1220,24 @@
"type": "github"
}
],
- "time": "2020-10-26T15:49:45+00:00"
+ "time": "2022-09-14T12:41:17+00:00"
},
{
"name": "sebastian/complexity",
- "version": "2.0.2",
+ "version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "739b35e53379900cc9ac327b2147867b8b6efd88"
+ "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88",
- "reference": "739b35e53379900cc9ac327b2147867b8b6efd88",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a",
+ "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a",
"shasum": ""
},
"require": {
- "nikic/php-parser": "^4.7",
+ "nikic/php-parser": "^4.18 || ^5.0",
"php": ">=7.3"
},
"require-dev": {
@@ -1245,7 +1269,7 @@
"homepage": "https://github.com/sebastianbergmann/complexity",
"support": {
"issues": "https://github.com/sebastianbergmann/complexity/issues",
- "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2"
+ "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3"
},
"funding": [
{
@@ -1253,20 +1277,20 @@
"type": "github"
}
],
- "time": "2020-10-26T15:52:27+00:00"
+ "time": "2023-12-22T06:19:30+00:00"
},
{
"name": "sebastian/diff",
- "version": "4.0.4",
+ "version": "4.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d"
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d",
- "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
"shasum": ""
},
"require": {
@@ -1311,7 +1335,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
- "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
+ "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
},
"funding": [
{
@@ -1319,20 +1343,20 @@
"type": "github"
}
],
- "time": "2020-10-26T13:10:38+00:00"
+ "time": "2024-03-02T06:30:58+00:00"
},
{
"name": "sebastian/environment",
- "version": "5.1.4",
+ "version": "5.1.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7"
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7",
- "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
"shasum": ""
},
"require": {
@@ -1374,7 +1398,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
- "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4"
+ "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
},
"funding": [
{
@@ -1382,20 +1406,20 @@
"type": "github"
}
],
- "time": "2022-04-03T09:37:03+00:00"
+ "time": "2023-02-03T06:03:51+00:00"
},
{
"name": "sebastian/exporter",
- "version": "4.0.4",
+ "version": "4.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9"
+ "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9",
- "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72",
+ "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72",
"shasum": ""
},
"require": {
@@ -1451,7 +1475,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
- "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4"
+ "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6"
},
"funding": [
{
@@ -1459,20 +1483,20 @@
"type": "github"
}
],
- "time": "2021-11-11T14:18:36+00:00"
+ "time": "2024-03-02T06:33:00+00:00"
},
{
"name": "sebastian/global-state",
- "version": "5.0.5",
+ "version": "5.0.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2"
+ "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2",
- "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9",
+ "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9",
"shasum": ""
},
"require": {
@@ -1515,7 +1539,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
- "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5"
+ "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7"
},
"funding": [
{
@@ -1523,24 +1547,24 @@
"type": "github"
}
],
- "time": "2022-02-14T08:28:10+00:00"
+ "time": "2024-03-02T06:35:11+00:00"
},
{
"name": "sebastian/lines-of-code",
- "version": "1.0.3",
+ "version": "1.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
+ "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
- "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5",
+ "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5",
"shasum": ""
},
"require": {
- "nikic/php-parser": "^4.6",
+ "nikic/php-parser": "^4.18 || ^5.0",
"php": ">=7.3"
},
"require-dev": {
@@ -1572,7 +1596,7 @@
"homepage": "https://github.com/sebastianbergmann/lines-of-code",
"support": {
"issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
- "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3"
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4"
},
"funding": [
{
@@ -1580,7 +1604,7 @@
"type": "github"
}
],
- "time": "2020-11-28T06:42:11+00:00"
+ "time": "2023-12-22T06:20:34+00:00"
},
{
"name": "sebastian/object-enumerator",
@@ -1696,16 +1720,16 @@
},
{
"name": "sebastian/recursion-context",
- "version": "4.0.4",
+ "version": "4.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172"
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172",
- "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
"shasum": ""
},
"require": {
@@ -1744,10 +1768,10 @@
}
],
"description": "Provides functionality to recursively process PHP variables",
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+ "homepage": "https://github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
- "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4"
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5"
},
"funding": [
{
@@ -1755,20 +1779,20 @@
"type": "github"
}
],
- "time": "2020-10-26T13:17:30+00:00"
+ "time": "2023-02-03T06:07:39+00:00"
},
{
"name": "sebastian/resource-operations",
- "version": "3.0.3",
+ "version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/resource-operations.git",
- "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8"
+ "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
- "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
+ "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
"shasum": ""
},
"require": {
@@ -1780,7 +1804,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -1801,8 +1825,7 @@
"description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"support": {
- "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
- "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3"
+ "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4"
},
"funding": [
{
@@ -1810,20 +1833,20 @@
"type": "github"
}
],
- "time": "2020-09-28T06:45:17+00:00"
+ "time": "2024-03-14T16:00:52+00:00"
},
{
"name": "sebastian/type",
- "version": "3.1.0",
+ "version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "fb44e1cc6e557418387ad815780360057e40753e"
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e",
- "reference": "fb44e1cc6e557418387ad815780360057e40753e",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
"shasum": ""
},
"require": {
@@ -1835,7 +1858,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -1858,7 +1881,7 @@
"homepage": "https://github.com/sebastianbergmann/type",
"support": {
"issues": "https://github.com/sebastianbergmann/type/issues",
- "source": "https://github.com/sebastianbergmann/type/tree/3.1.0"
+ "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
},
"funding": [
{
@@ -1866,7 +1889,7 @@
"type": "github"
}
],
- "time": "2022-08-29T06:55:37+00:00"
+ "time": "2023-02-03T06:13:03+00:00"
},
{
"name": "sebastian/version",
@@ -1923,16 +1946,16 @@
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.7.1",
+ "version": "3.13.0",
"source": {
"type": "git",
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619"
+ "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
+ "reference": "65ff2489553b83b4597e89c3b8b721487011d186"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619",
- "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/65ff2489553b83b4597e89c3b8b721487011d186",
+ "reference": "65ff2489553b83b4597e89c3b8b721487011d186",
"shasum": ""
},
"require": {
@@ -1942,11 +1965,11 @@
"php": ">=5.4.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
},
"bin": [
- "bin/phpcs",
- "bin/phpcbf"
+ "bin/phpcbf",
+ "bin/phpcs"
],
"type": "library",
"extra": {
@@ -1961,34 +1984,62 @@
"authors": [
{
"name": "Greg Sherwood",
- "role": "lead"
+ "role": "Former lead"
+ },
+ {
+ "name": "Juliette Reinders Folmer",
+ "role": "Current lead"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
- "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
"keywords": [
"phpcs",
- "standards"
+ "standards",
+ "static analysis"
],
"support": {
- "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
- "source": "https://github.com/squizlabs/PHP_CodeSniffer",
- "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
+ "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues",
+ "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy",
+ "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
+ "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki"
},
- "time": "2022-06-18T07:21:10+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/phpcsstandards",
+ "type": "thanks_dev"
+ }
+ ],
+ "time": "2025-05-11T03:36:00+00:00"
},
{
"name": "theseer/tokenizer",
- "version": "1.2.1",
+ "version": "1.2.3",
"source": {
"type": "git",
"url": "https://github.com/theseer/tokenizer.git",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
"shasum": ""
},
"require": {
@@ -2017,7 +2068,7 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": {
"issues": "https://github.com/theseer/tokenizer/issues",
- "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.3"
},
"funding": [
{
@@ -2025,17 +2076,17 @@
"type": "github"
}
],
- "time": "2021-07-28T10:34:58+00:00"
+ "time": "2024-03-03T12:36:25+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
- "stability-flags": [],
+ "stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": ">7.4"
+ "php": ">=8.1"
},
- "platform-dev": [],
- "plugin-api-version": "2.3.0"
+ "platform-dev": {},
+ "plugin-api-version": "2.6.0"
}
diff --git a/src/Resque/Event.php b/src/Resque/Event.php
index 7886640..f445375 100644
--- a/src/Resque/Event.php
+++ b/src/Resque/Event.php
@@ -22,6 +22,7 @@ class Event
*
* @param string $event Name of event to be raised.
* @param mixed $data Optional, any data that should be passed to each callback.
+ *
* @return true
*/
public static function trigger($event, $data = null)
@@ -49,7 +50,8 @@ class Event
* Listen in on a given event to have a specified callback fired.
*
* @param string $event Name of event to listen on.
- * @param mixed $callback Any callback callable by call_user_func_array.
+ * @param mixed $callback Any callback callable by call_user_func_array
+ *
* @return true
*/
public static function listen($event, $callback)
@@ -67,6 +69,7 @@ class Event
*
* @param string $event Name of event.
* @param mixed $callback The callback as defined when listen() was called.
+ *
* @return true
*/
public static function stopListening($event, $callback)
@@ -85,8 +88,10 @@ class Event
/**
* Call all registered listeners.
+ *
+ * @return void
*/
- public static function clearListeners()
+ public static function clearListeners(): void
{
self::$events = [];
}
diff --git a/src/Resque/Job/Factory.php b/src/Resque/Job/Factory.php
index be04d8e..9ee0b74 100644
--- a/src/Resque/Job/Factory.php
+++ b/src/Resque/Job/Factory.php
@@ -9,6 +9,7 @@ namespace Resque\Job;
* @author Daniel Mason
* @license http://www.opensource.org/licenses/mit-license.php
*/
+
class Factory implements FactoryInterface
{
public ?Job $job;
@@ -16,6 +17,8 @@ class Factory implements FactoryInterface
public array $args;
/**
+ * Create job factory
+ *
* @param $className
* @param array $args
* @param $queue
diff --git a/src/Resque/Job/Status.php b/src/Resque/Job/Status.php
index 0486394..6387c2a 100644
--- a/src/Resque/Job/Status.php
+++ b/src/Resque/Job/Status.php
@@ -62,7 +62,7 @@ class Status
\Resque\Resque::redis()->set(
'job:' . $id . ':status',
json_encode($statusPacket),
- ['ex' => time() + 86400],
+ ['ex' => \Resque\Redis::DEFAULT_REDIS_TTL],
);
}
@@ -106,7 +106,7 @@ class Status
\Resque\Resque::redis()->set(
(string)$this,
json_encode($statusPacket),
- ['ex' => time() + 86400],
+ ['ex' => \Resque\Redis::DEFAULT_REDIS_TTL],
);
}
diff --git a/src/Resque/Log.php b/src/Resque/Log.php
index e446a72..2608d87 100644
--- a/src/Resque/Log.php
+++ b/src/Resque/Log.php
@@ -25,9 +25,10 @@ class Log extends \Psr\Log\AbstractLogger
* @param mixed $level PSR-3 log level constant, or equivalent string
* @param string $message Message to log, may contain a { placeholder }
* @param array $context Variables to replace { placeholder }
+ *
* @return null
*/
- public function log($level, $message, array $context = [])
+ public function log($level, $message, array $context = []): void
{
$logLevels = [
'emergency',
diff --git a/src/Resque/Redis.php b/src/Resque/Redis.php
index f726feb..5537b55 100644
--- a/src/Resque/Redis.php
+++ b/src/Resque/Redis.php
@@ -14,12 +14,14 @@ class Redis
{
/**
* Redis Client
+ *
* @var \Credis_Client
*/
private $driver;
/**
* Redis namespace
+ *
* @var string
*/
private static $defaultNamespace = 'resque:';
@@ -39,6 +41,11 @@ class Redis
*/
public const DEFAULT_DATABASE = 0;
+ /**
+ * Default Redis TTL (2 days)
+ */
+ public const DEFAULT_REDIS_TTL = 172800;
+
/**
* @var array List of all commands in Redis that supply a key as their
* first argument. Used to prefix keys with the Resque namespace.
@@ -90,17 +97,6 @@ class Redis
'rename',
'rpoplpush'
];
- // sinterstore
- // sunion
- // sunionstore
- // sdiff
- // sdiffstore
- // sinter
- // smove
- // mget
- // msetnx
- // mset
- // renamenx
/**
* Set Redis namespace (prefix) default: resque
@@ -114,6 +110,7 @@ class Redis
if (substr($namespace, -1) !== ':' && $namespace != '') {
$namespace .= ':';
}
+
self::$defaultNamespace = $namespace;
}
diff --git a/src/Resque/Resque.php b/src/Resque/Resque.php
index e4872f9..f193e18 100644
--- a/src/Resque/Resque.php
+++ b/src/Resque/Resque.php
@@ -12,7 +12,7 @@ namespace Resque;
class Resque
{
- public const VERSION = '2.1.0';
+ public const VERSION = '2.5.3';
public const DEFAULT_INTERVAL = 5;
diff --git a/src/Resque/Stat.php b/src/Resque/Stat.php
index 45bfe45..6cfa6c1 100644
--- a/src/Resque/Stat.php
+++ b/src/Resque/Stat.php
@@ -38,7 +38,7 @@ class Stat
$set = Resque::redis()->set(
'stat:' . $stat,
$by,
- ['ex' => time() + 86400, 'nx'],
+ ['ex' => Redis::DEFAULT_REDIS_TTL, 'nx'],
);
// If it already exists, return the incrby value
diff --git a/src/Resque/Worker.php b/src/Resque/Worker.php
index 6c19f13..fc08303 100644
--- a/src/Resque/Worker.php
+++ b/src/Resque/Worker.php
@@ -83,6 +83,7 @@ class Worker
/**
* Return all workers known to Resque as instantiated instances.
+ *
* @return array
*/
public static function all(): array
@@ -96,14 +97,17 @@ class Worker
foreach ($workers as $workerId) {
$instances[] = self::find($workerId);
}
+
return $instances;
}
/**
* Given a worker ID, check if it is registered/valid.
*
- * @param string $workerId ID of the worker.
- * @return boolean True if the worker exists, false if not.
+ * @param string $workerId ID of the worker
+ *
+ * @return boolean True if the worker exists, false if not
+ *
* @throws Resque_RedisException
*/
public static function exists($workerId): bool
@@ -114,8 +118,10 @@ class Worker
/**
* Given a worker ID, find it and return an instantiated worker class for it.
*
- * @param string $workerId The ID of the worker.
- * @return bool|Resque_Worker
+ * @param string $workerId The ID of the worker
+ *
+ * @return Resque_Worker|bool
+ *
* @throws Resque_RedisException
*/
public static function find($workerId)
@@ -123,11 +129,13 @@ class Worker
if (false === strpos($workerId, ":") || !self::exists($workerId)) {
return false;
}
+
/** @noinspection PhpUnusedLocalVariableInspection */
list($hostname, $pid, $queues) = explode(':', $workerId, 3);
$queues = explode(',', $queues);
$worker = new self($queues);
$worker->setId($workerId);
+
return $worker;
}
@@ -135,8 +143,10 @@ class Worker
* Set the ID of this worker to a given ID string.
*
* @param string $workerId ID for the worker.
+ *
+ * @return void
*/
- public function setId($workerId)
+ public function setId($workerId): void
{
$this->id = $workerId;
}
@@ -150,9 +160,11 @@ class Worker
* @param int $interval How often to check for new jobs across the queues.
* @param bool $blocking
*
+ * @return void
+ *
* @throws Resque_RedisException
*/
- public function work($interval = Resque::DEFAULT_INTERVAL, $blocking = false)
+ public function work($interval = Resque::DEFAULT_INTERVAL, $blocking = false): void
{
$this->updateProcLine('Starting');
$this->startup();
@@ -251,11 +263,13 @@ class Worker
}
/**
- * Process a single job.
+ * Process a single job
*
- * @param \Resque\Job\Job $job The job to be processed.
+ * @param \Resque\Job\Job $job The job to be processed
+ *
+ * @return void
*/
- public function perform(\Resque\Job\Job $job)
+ public function perform(\Resque\Job\Job $job): void
{
try {
Event::trigger('afterFork', $job);
@@ -273,7 +287,8 @@ class Worker
/**
* @param bool $blocking
* @param int $timeout
- * @return object|boolean Instance of \Resque\Job\Job if a job is found, false if not.
+ *
+ * @return object|boolean - Instance of \Resque\Job\Job if a job is found, false if not
*/
public function reserve($blocking = false, $timeout = null)
{
@@ -304,16 +319,17 @@ class Worker
/**
* Return an array containing all of the queues that this worker should use
- * when searching for jobs.
+ * when searching for jobs
*
* If * is found in the list of queues, every queue will be searched in
* alphabetic order. (@param boolean $fetch If true, and the queue is set to *, will fetch
- * all queue names from redis.
- * @return array Array of associated queues.
- * @see $fetch)
+ * all queue names from redis
*
+ * @param boolean $fetch
+ *
+ * @return array Array of associated queues
*/
- public function queues($fetch = true)
+ public function queues(bool $fetch = true): array
{
if (!in_array('*', $this->queues) || $fetch == false) {
return $this->queues;
@@ -321,13 +337,16 @@ class Worker
$queues = Resque::queues();
sort($queues);
+
return $queues;
}
/**
- * Perform necessary actions to start a worker.
+ * Perform necessary actions to start a worker
+ *
+ * @return void
*/
- private function startup()
+ private function startup(): void
{
$this->registerSigHandlers();
$this->pruneDeadWorkers();
@@ -340,9 +359,11 @@ class Worker
* the name of the currently running process to indicate the current state
* of a worker.
*
- * @param string $status The updated process title.
+ * @param string $status The updated process title
+ *
+ * @return void
*/
- private function updateProcLine($status)
+ private function updateProcLine($status): void
{
$processTitle = 'resque-' . Resque::VERSION . ': ' . $status;
if (function_exists('cli_set_process_title') && PHP_OS !== 'Darwin') {
@@ -359,8 +380,10 @@ class Worker
* INT: Shutdown immediately and stop processing jobs.
* QUIT: Shutdown after the current job finishes processing.
* USR1: Kill the forked child immediately and continue processing jobs.
+ *
+ * @return void
*/
- private function registerSigHandlers()
+ private function registerSigHandlers(): void
{
if (!function_exists('pcntl_signal')) {
return;
@@ -376,9 +399,11 @@ class Worker
}
/**
- * Signal handler callback for USR2, pauses processing of new jobs.
+ * Signal handler callback for USR2, pauses processing of new jobs
+ *
+ * @return void
*/
- public function pauseProcessing()
+ public function pauseProcessing(): void
{
$this->logger->log(\Psr\Log\LogLevel::NOTICE, 'USR2 received; pausing job processing');
$this->paused = true;
@@ -387,8 +412,10 @@ class Worker
/**
* Signal handler callback for CONT, resumes worker allowing it to pick
* up new jobs.
+ *
+ * @return void
*/
- public function unPauseProcessing()
+ public function unPauseProcessing(): void
{
$this->logger->log(\Psr\Log\LogLevel::NOTICE, 'CONT received; resuming job processing');
$this->paused = false;
@@ -397,8 +424,10 @@ class Worker
/**
* Schedule a worker for shutdown. Will finish processing the current job
* and when the timeout interval is reached, the worker will shut down.
+ *
+ * @return void
*/
- public function shutdown()
+ public function shutdown(): void
{
$this->shutdown = true;
$this->logger->log(\Psr\Log\LogLevel::NOTICE, 'Shutting down');
@@ -407,8 +436,10 @@ class Worker
/**
* Force an immediate shutdown of the worker, killing any child jobs
* currently running.
+ *
+ * @return void
*/
- public function shutdownNow()
+ public function shutdownNow(): void
{
$this->shutdown();
$this->killChild();
@@ -417,8 +448,10 @@ class Worker
/**
* Kill a forked child job immediately. The job it is processing will not
* be completed.
+ *
+ * @return void
*/
- public function killChild()
+ public function killChild(): void
{
if (!$this->child) {
$this->logger->log(\Psr\Log\LogLevel::DEBUG, 'No child to kill.');
@@ -447,8 +480,10 @@ class Worker
* This is a form of garbage collection to handle cases where the
* server may have been killed and the Resque workers did not die gracefully
* and therefore leave state information in Redis.
+ *
+ * @return void
*/
- public function pruneDeadWorkers()
+ public function pruneDeadWorkers(): void
{
$workerPids = $this->workerPids();
$workers = self::all();
@@ -474,7 +509,7 @@ class Worker
*
* @return array Array of Resque worker process IDs.
*/
- public function workerPids()
+ public function workerPids(): array
{
$pids = [];
exec('ps -A -o pid,command | grep [r]esque', $cmdOutput);
@@ -486,22 +521,26 @@ class Worker
/**
* Register this worker in Redis.
- * 48 hour TTL so we don't pollute the db on server termination.
+ * 48 hour TTL so we don't pollute the redis db on server termination.
+ *
+ * @return void
*/
- public function registerWorker()
+ public function registerWorker(): void
{
Resque::redis()->sadd('workers', (string)$this);
Resque::redis()->set(
'worker:' . (string)$this . ':started',
date('D M d H:i:s T Y'),
- ['ex' => time() + 86400],
+ ['ex' => Redis::DEFAULT_REDIS_TTL],
);
}
/**
* Unregister this worker in Redis. (shutdown etc)
+ *
+ * @return void
*/
- public function unregisterWorker()
+ public function unregisterWorker(): void
{
if (is_object($this->currentJob)) {
$this->currentJob->fail(new \Resque\Job\DirtyExitException());
@@ -516,12 +555,15 @@ class Worker
}
/**
- * Tell Redis which job we're currently working on.
+ * Tell Redis which job we're currently working on
+ *
+ * @param \Resque\Job\Job $job \Resque\Job\Job instance containing the job we're working on
+ *
+ * @return void
*
- * @param \Resque\Job\Job $job \Resque\Job\Job instance containing the job we're working on.
* @throws Resque_RedisException
*/
- public function workingOn(\Resque\Job\Job $job)
+ public function workingOn(\Resque\Job\Job $job): void
{
$job->worker = $this;
$this->currentJob = $job;
@@ -535,15 +577,17 @@ class Worker
Resque::redis()->set(
'worker:' . $job->worker,
$data,
- ['ex' => time() + 86400],
+ ['ex' => Redis::DEFAULT_REDIS_TTL],
);
}
/**
* Notify Redis that we've finished working on a job, clearing the working
- * state and incrementing the job stats.
+ * state and incrementing the job stats
+ *
+ * @return void
*/
- public function doneWorking()
+ public function doneWorking(): void
{
$this->currentJob = null;
Stat::incr('processed');
@@ -552,28 +596,29 @@ class Worker
}
/**
- * Generate a string representation of this worker.
+ * Generate a string representation of this worker
*
- * @return string String identifier for this worker instance.
+ * @return string String identifier for this worker instance
*/
- public function __toString()
+ public function __toString(): string
{
- return $this->id;
+ return (string) $this->id;
}
/**
- * Return an object describing the job this worker is currently working on.
+ * Return an object describing the job this worker is currently working on
*
- * @return array Array with details of current job.
+ * @return array Array with details of current job
*/
public function job(): array
{
$job = Resque::redis()->get('worker:' . $this);
+
return $job ? json_decode($job, true) : [];
}
/**
- * Get a statistic belonging to this worker.
+ * Get a statistic belonging to this worker
*
* @param string $stat Statistic to fetch.
*
@@ -588,8 +633,10 @@ class Worker
* Inject the logging object into the worker
*
* @param \Psr\Log\LoggerInterface $logger
+ *
+ * @return void
*/
- public function setLogger(\Psr\Log\LoggerInterface $logger)
+ public function setLogger(\Psr\Log\LoggerInterface $logger): void
{
$this->logger = $logger;
}
diff --git a/tests/Resque/Tests/RedisTest.php b/tests/Resque/Tests/RedisTest.php
index 200f208..b834f93 100644
--- a/tests/Resque/Tests/RedisTest.php
+++ b/tests/Resque/Tests/RedisTest.php
@@ -17,7 +17,7 @@ class RedisTest extends TestCase
$this->redis->set(
'testKey',
24,
- ['ex' => time() + 3600],
+ ['ex' => \Resque\Redis::DEFAULT_REDIS_TTL],
);
$val = $this->redis->get("testKey");