Skip to content

Repository files navigation

Mockery Rector Extension

Automation PHP Version Packagist Downloads PayPal Sponsors via GitHub

Rector upgrades rules for Mockery

Installation

You can install the package via composer:

composer require ghostwriter/rector-extension --dev

Star ⭐️ this repo if you find it useful

You can also star (🌟) this repo to find it easier later.

Usage

Rector can be configured to use the Mockery Rector rules by adding the following to your rector.php configuration file:

<?php

declare(strict_types=1);

use Mockery\Rector\DeprecatedFuncCallToArgumentMatcherStaticMethodCallRector;
use Mockery\Rector\DeprecatedMockeryStaticMethodCallToArgumentMatcherStaticMethodCallRector;
use Rector\Config\RectorConfig;

return RectorConfig::configure()->withRules([
    DeprecatedFuncCallToArgumentMatcherStaticMethodCallRector::class,
    DeprecatedMockeryStaticMethodCallToArgumentMatcherStaticMethodCallRector::class,
]);

Sets are collections of rules that can be applied together. The MockerySetList provides predefined sets for upgrading Mockery code to newer versions.

<?php

declare(strict_types=1);

use Mockery\Rector\MockerySetList;
use Rector\Config\RectorConfig;

return RectorConfig::configure()->withSets([
    MockerySetList::MOCKERY_16, // v1.6.x
    MockerySetList::MOCKERY_20, // v2.0.x
]);

Preview changes

vendor/bin/rector --dry-run

Run

vendor/bin/rector

Credits

Changelog

Please see CHANGELOG.md for more information on what has changed recently.

License

Please see LICENSE for more information on the license that applies to this project.

Security

Please see SECURITY.md for more information on security disclosure process.

About

Rector upgrades rules for Mockery

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from ghostwriter/wip