Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE - Failed tests #923

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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: 2 additions & 1 deletion .github/workflows/testsv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ jobs:
environment: github-ci
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 60
continue-on-error: true
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.0', '8.1', '8.2', '8.3']
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
name: PHP ${{ matrix.php-versions }} quality/tests on ${{ matrix.operating-system }}
env:
extensions: mbstring, intl, pdo_sqlite, json, redis, couchbase-3.2.2
Expand Down
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions lib/Phpfastcache/CacheContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(CacheItemPoolInterface $cacheInstance)
/**
* @throws InvalidArgumentException
*/
public function get(string|\Stringable $cacheKey, callable $callback, DateInterval|int $expiresAfter = null): mixed
public function get(string|\Stringable $cacheKey, callable $callback, DateInterval|int|null $expiresAfter = null): mixed
{
$cacheItem = $this->cacheInstance->getItem((string) $cacheKey);

Expand All @@ -54,7 +54,7 @@ public function get(string|\Stringable $cacheKey, callable $callback, DateInterv
/**
* @throws InvalidArgumentException
*/
public function __invoke(string $cacheKey, callable $callback, DateInterval|int $expiresAfter = null): mixed
public function __invoke(string $cacheKey, callable $callback, DateInterval|int|null $expiresAfter = null): mixed
{
return $this->get($cacheKey, $callback, $expiresAfter);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Cluster/AggregatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function getCluster(int $strategy): ClusterPoolInterface;
*
* @return void
*/
public function aggregateDriverByName(string $driverName, ConfigurationOption $driverConfig = null): void;
public function aggregateDriverByName(string $driverName, ?ConfigurationOption $driverConfig = null): void;

/**
* @param AggregatablePoolInterface $driverPool
Expand Down
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Cluster/ClusterAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function aggregateDriver(AggregatablePoolInterface $driverPool): void
* @throws PhpfastcacheDriverNotFoundException
* @throws PhpfastcacheLogicException
*/
public function aggregateDriverByName(string $driverName, ConfigurationOption $driverConfig = null): void
public function aggregateDriverByName(string $driverName, ?ConfigurationOption $driverConfig = null): void
{
if (isset($this->cluster)) {
throw new PhpfastcacheLogicException('The cluster has been already build, cannot aggregate more pools.');
Expand Down
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Drivers/Redis/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getDatabase(): ?int
* @return static
* @throws PhpfastcacheLogicException
*/
public function setDatabase(int $database = null): static
public function setDatabase(?int $database = null): static
{
return $this->setProperty('database', $database);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Exceptions/PhpfastcacheIOException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PhpfastcacheIOException extends PhpfastcacheCoreException
/**
* @inheritdoc
*/
public function __construct(string $message = "", int $code = 0, \Throwable $previous = null)
public function __construct(string $message = "", int $code = 0, ?\Throwable $previous = null)
{
$lastError = error_get_last();
if ($lastError) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Phpfastcache/Helper/Psr16Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Psr16Adapter implements CacheInterface
* @throws PhpfastcacheDriverException
* @throws PhpfastcacheDriverNotFoundException
*/
public function __construct(string|ExtendedCacheItemPoolInterface $driver, ConfigurationOptionInterface $config = null)
public function __construct(string|ExtendedCacheItemPoolInterface $driver, ?ConfigurationOptionInterface $config = null)
{
if ($driver instanceof ExtendedCacheItemPoolInterface) {
if ($config !== null) {
Expand Down
1 change: 1 addition & 0 deletions tests/cases/GetAllItems.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
require_once __DIR__ . '/../../vendor/autoload.php';

$testHelper = new TestHelper('Testing getAllItems() method');
$testHelper->printText('[<blue>EXTENTION:</blue> (redis) <yellow>v' . \phpversion('redis') . '</yellow>]');

/**
* https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV5%CB%96%5D-Fetching-all-keys
Expand Down
1 change: 1 addition & 0 deletions tests/cases/Redis.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
chdir(__DIR__);
require_once __DIR__ . '/../../vendor/autoload.php';
$testHelper = new TestHelper('Redis bundled client');
$testHelper->printText('[<blue>EXTENTION:</blue> (redis) <yellow>v' . \phpversion('redis') . '</yellow>]');

try {
if (!class_exists(RedisClient::class)) {
Expand Down
1 change: 1 addition & 0 deletions tests/cases/RedisCluster.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
chdir(__DIR__);
require_once __DIR__ . '/../../vendor/autoload.php';
$testHelper = new TestHelper('Redis cluster');
$testHelper->printText('[<blue>EXTENTION:</blue> (redis) <yellow>v' . \phpversion('redis') . '</yellow>]');

try {
$config = new RedisConfig();
Expand Down