michaelcozzolino/php-redefinitions

Provides a GitHub repository template for a PHP package with GitHub Actions workflows using standard PHP development tools.

Installs: 45

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/michaelcozzolino/php-redefinitions

v0.1.0 2024-11-17 10:58 UTC

This package is auto-updated.

Last update: 2025-10-04 23:51:32 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.