pestphp / pestphp/pest

[Bug]: Declaration of Pest\Mutate\Cache\FileStore::get(string $key, mixed $default = null): mixed must be compatible with PsrExt\SimpleCache\CacheInterface::get($key, $default = <default>)

Open Beginner friendly
#1,660 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
11.7k
Forks
538
Avg merge
4d 11h
Merged PRs (30d)
8

Description

What Happened

Unable to run Pest due to incompatible method signature between Pest FileStore and PSR SimpleCache

PHP Fatal error:  Declaration of Pest\Mutate\Cache\FileStore::get(string $key, mixed $default = null): mixed must be compatible with PsrExt\SimpleCache\CacheInterface::get($key, $default = <default>) in /home/jordan/projects/pest/vendor/pestphp/pest-plugin-mutate/src/Cache/FileStore.php on line 27
PHP Stack trace:
PHP   1. {main}() /home/jordan/projects/pest/vendor/bin/pest:0
PHP   2. include() /home/jordan/projects/pest/vendor/bin/pest:119
PHP   3. {closure:/home/jordan/projects/pest/vendor/pestphp/pest/bin/pest:18-192}() /home/jordan/projects/pest/vendor/pestphp/pest/bin/pest:192
PHP   4. Pest\Kernel::boot($testSuite = class Pest\TestSuite { public ?PHPUnit\Framework\TestCase $test = NULL; public Pest\Repositories\TestRepository $tests = class Pest\Repositories\TestRepository { private array $testCases = [...]; private array $uses = [...]; private array $testCaseFilters = [...]; private array $testCaseMethodFilters = [...] }; public Pest\Repositories\BeforeEachRepository $beforeEach = class Pest\Repositories\BeforeEachRepository { private array $state = [...] }; public Pest\Repositories\BeforeAllRepository $beforeAll = class Pest\Repositories\BeforeAllRepository { private array $state = [...] }; public Pest\Repositories\AfterEachRepository $afterEach = class Pest\Repositories\AfterEachRepository { private array $state = [...] }; public Pest\Repositories\AfterAllRepository $afterAll = class Pest\Repositories\AfterAllRepository { private array $state = [...] }; public Pest\Repositories\SnapshotRepository $snapshots = class Pest\Repositories\SnapshotRepository { private readonly string $rootPath = '/home/jordan/projects/pest'; private readonly string $testsPath = '/home/jordan/projects/pest/tests'; private readonly string $snapshotsPath = '.pest/snapshots' }; public string $rootPath = '/home/jordan/projects/pest'; public string $testPath = 'tests' }, $input = class Symfony\Component\Console\Input\ArgvInput { protected Symfony\Component\Console\Input\InputDefinition $definition = class Symfony\Component\Console\Input\InputDefinition { private array $arguments = [...]; private int $requiredCount = 0; private ?Symfony\Component\Console\Input\InputArgument $lastArrayArgument = NULL; private ?Symfony\Component\Console\Input\InputArgument $lastOptionalArgument = NULL; private array $options = [...]; private array $negations = [...]; private array $shortcuts = [...] }; protected $stream = NULL; protected array $options = []; protected array $arguments = []; protected bool $interactive = TRUE; private array $tokens = []; private array $parsed = *uninitialized* }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private array $styles = [...]; private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... }; private bool $decorated = TRUE }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private Symfony\Component\Console\Output\OutputInterface $stderr = class Symfony\Component\Console\Output\StreamOutput { private int ${Symfony\Component\Console\Output\Output}verbosity = 32; private Symfony\Component\Console\Formatter\OutputFormatterInterface ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private array $consoleSectionOutputs = [] }) /home/jordan/projects/pest/vendor/pestphp/pest/bin/pest:182
PHP   5. Pest\Plugins\Actions\CallsBoot::execute() /home/jordan/projects/pest/vendor/pestphp/pest/src/Kernel.php:83
PHP   6. Pest\Mutate\Plugins\Mutate->boot() /home/jordan/projects/pest/vendor/pestphp/pest/src/Plugins/Actions/CallsBoot.php:26
PHP   7. Composer\Autoload\ClassLoader->loadClass($class = 'Pest\\Mutate\\Cache\\FileStore') /home/jordan/projects/pest/vendor/pestphp/pest-plugin-mutate/src/Plugins/Mutate.php:102
PHP   8. {closure:/home/jordan/projects/pest/vendor/composer/ClassLoader.php:575-577}($file = '/home/jordan/projects/pest/vendor/composer/../pestphp/pest-plugin-mutate/src/Cache/FileStore.php') /home/jordan/projects/pest/vendor/composer/ClassLoader.php:427
PHP   9. include() /home/jordan/projects/pest/vendor/composer/ClassLoader.php:576
How to Reproduce
  1. Initialized an empty composer project and required pestphp/pest ^4.0
  2. Created an empty /tests/ directory
  3. Ran vendor/bin/pest

Sample composer.json

{
    "name": "jordan/pest",
    "require-dev": {
        "pestphp/pest": "^4.0"
    },
    "config": {
        "allow-plugins": {
            "pestphp/pest-plugin": true
        }
    }
}
Sample Repository

No response

Pest Version

4.4.5

PHP Version

8.4.15

Operation System

Linux

Notes
OS: Ubuntu 24.04.3 LTS on Windows 10 x86_64

PHP 8.4.15 (cli) (built: Nov 20 2025 17:43:25) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.15, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.15, Copyright (c), by Zend Technologies
    with Xdebug v3.4.7, Copyright (c) 2002-2025, by Derick Rethans

[PHP Modules]
amqp
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
imagick
inotify
intl
json
libxml
lz4
mbstring
mcrypt
memcache
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
psr
random
readline
redis
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
vips
xdebug
xml
xmlreader
xmlwriter
xsl
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect pest-plugin-mutate/src/Cache/FileStore.php at line 27 and compare the get declaration with PsrExt\SimpleCache\CacheInterface::get. Reproduce the failure by running vendor/bin/pest in the empty Composer project described, then verify that it starts without the PHP fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.