michaelcozzolino / php-redefinitions
Provides a GitHub repository template for a PHP package with GitHub Actions workflows using standard PHP development tools.
Requires
- php: >=8.2
Requires (Dev)
- ergebnis/composer-normalize: ^2.44.0
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^1.12.8
- phpstan/phpstan-deprecation-rules: ^1.2.1
- phpstan/phpstan-strict-rules: ^1.6.1
- vimeo/psalm: ^5.26
This package is auto-updated.
Last update: 2024-12-04 22:08:12 UTC
README
This package provides a set of redefinitions of native php functions so that they can be mocked in unit tests.
Installation
Run
composer require michaelcozzolino/php-redefinitions
Usage
Every redefinition is included in a specific class whose name is {category}Redefinition
where the category
is
the name specified in the title where the related functions are documented in php. E.G:
if we go to https://www.php.net/manual/en/ref.json.php, we see JSON Functions
, so this means that the redefinitions of
these functions will be in a class called JsonRedefinition
, to notice the PascalCase even if the word JSON is
uppercase. So you can find the needed class and inject it in your application.