Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ notifications:

php:
- nightly
- 8.0
- 7.4
- 8.3

Comment on lines 9 to 12
jobs:
allow_failures:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.4-cli
FROM php:8.3-cli

MAINTAINER devgeniem

Expand All @@ -9,4 +9,4 @@ RUN pip install pywatch

WORKDIR /opt

ENTRYPOINT ["pywatch"]
ENTRYPOINT ["pywatch"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ The plugin is tested locally with [PHPUnit](https://phpunit.de/) and automatical
# Install local composer packages.
composer install
# Build and tag the container.
docker build . -t phptest:7.4
docker build . -t phptest:8.3
# Run the container and watch changes.
docker run --rm -it -v $(pwd):/opt phptest:7.4 "php ./vendor/bin/phpunit" ./tests/*.php
docker run --rm -it -v $(pwd):/opt phptest:8.3 "php ./vendor/bin/phpunit" ./tests/*.php
```

## Contributors
Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
}
},
"require": {
"php": "^8.0",
"psr/log": "^1.1.3",
"psr/container": "^1.1.1"
"php": "^8.3",
"psr/log": "^3.0",
"psr/container": "^2.0"
},
Comment on lines 30 to 34
"require-dev": {
"roave/security-advisories": "dev-latest",
"devgeniem/geniem-rules-codesniffer": "^1",
"brainmaestro/composer-git-hooks": "^v2.8.5",
"brainmaestro/composer-git-hooks": "^3.0",
"phpunit/phpunit": "^9.6",
"10up/wp_mock": "^0.4.2",
"predis/predis": "^2.0",
Expand All @@ -58,6 +58,9 @@
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
},
"platform": {
"php": "8.3.0"
}
}
}
448 changes: 158 additions & 290 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: WordPress Queue is a modular library for managing queued tasks in WordPress.
* Version: 1.0.2
* Requires at least: 5.4
* Requires PHP: 8.0
* Requires PHP: 8.3
* Author: Geniem
* Author URI: https://geniem.com/
* License: MIT
Expand Down
36 changes: 18 additions & 18 deletions src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ public function __construct( ?int $log_level = 0 ) {
/**
* Log a debug message.
*
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function debug( $message, array $context = [] ) {
public function debug( \Stringable|string $message, array $context = [] ) : void {
if ( static::DEBUG >= $this->log_level ) {
$this->log( 'DEBUG', $message, $context );
}
Expand All @@ -110,10 +110,10 @@ public function debug( $message, array $context = [] ) {
/**
* Log an info message.
*
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function info( $message, array $context = [] ) {
public function info( \Stringable|string $message, array $context = [] ) : void {
if ( static::INFO >= $this->log_level ) {
$this->log( 'INFO', $message, $context );
}
Expand All @@ -122,10 +122,10 @@ public function info( $message, array $context = [] ) {
/**
* Log a notice message.
*
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function notice( $message, array $context = [] ) {
public function notice( \Stringable|string $message, array $context = [] ) : void {
if ( static::NOTICE >= $this->log_level ) {
$this->log( 'NOTICE', $message, $context );
}
Expand All @@ -134,10 +134,10 @@ public function notice( $message, array $context = [] ) {
/**
* Log a warning message.
*
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function warning( $message, array $context = [] ) {
public function warning( \Stringable|string $message, array $context = [] ) : void {
if ( static::WARNING >= $this->log_level ) {
$this->log( 'WARNING', $message, $context );
}
Expand All @@ -146,10 +146,10 @@ public function warning( $message, array $context = [] ) {
/**
* Log an error message.
*
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function error( $message, array $context = [] ) {
public function error( \Stringable|string $message, array $context = [] ) : void {
if ( static::ERROR >= $this->log_level ) {
$this->log( 'ERROR', $message, $context );
}
Expand All @@ -158,10 +158,10 @@ public function error( $message, array $context = [] ) {
/**
* Log a critical message.
*
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function critical( $message, array $context = [] ) {
public function critical( \Stringable|string $message, array $context = [] ) : void {
if ( static::CRITICAL >= $this->log_level ) {
$this->log( 'CRITICAL', $message, $context );
}
Expand All @@ -170,10 +170,10 @@ public function critical( $message, array $context = [] ) {
/**
* Log an alert message.
*
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function alert( $message, array $context = [] ) {
public function alert( \Stringable|string $message, array $context = [] ) : void {
if ( static::ALERT >= $this->log_level ) {
$this->log( 'ALERT', $message, $context );
}
Expand All @@ -182,10 +182,10 @@ public function alert( $message, array $context = [] ) {
/**
* Log an emergency message.
*
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function emergency( $message, array $context = [] ) {
public function emergency( \Stringable|string $message, array $context = [] ) : void {
if ( static::EMERGENCY >= $this->log_level ) {
$this->log( 'EMERGENCY', $message, $context );
}
Expand All @@ -195,10 +195,10 @@ public function emergency( $message, array $context = [] ) {
* The actual logging method.
*
* @param mixed $level The log level.
* @param string $message The log message.
* @param \Stringable|string $message The log message.
* @param array $context The error context data.
*/
public function log( $level, $message, array $context = [] ) : void {
public function log( mixed $level, \Stringable|string $message, array $context = [] ) : void {
Comment on lines 197 to +201
$string_context = empty( $context ) ?
'' :
' - Context: ' . addslashes( str_replace( PHP_EOL, '', print_r( $context, true ) ) ); // phpcs:ignore
Expand Down
4 changes: 2 additions & 2 deletions src/QueueContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function replace( QueueInterface $queue ) {
* @return QueueInterface The found queue instance.
* @throws QueueNotFoundException If no queue is found, an exception is thrown.
*/
public function get( $id ) {
public function get( string $id ) : QueueInterface {
if ( ! isset( $this->queues[ $id ] ) ) {
throw new QueueNotFoundException( "No queue found for key: $id" );
}
Expand All @@ -59,7 +59,7 @@ public function get( $id ) {
*
* @return bool
*/
public function has( $id ) {
public function has( string $id ) : bool {
return isset( $this->queues[ $id ] );
}
}
Loading