Download the PHP package simtel/rector-rules without Composer

On this page you can find all versions of the php package simtel/rector-rules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rector-rules

Rector Rules

Tests Code Quality PHPStan Level

A collection of custom Rector rules for automated PHP code refactoring.

Overview

This package provides custom Rector rules to help modernize and improve PHP codebases through automated refactoring. Currently includes the RenameFindAndGetMethodCallRector and WithConsecutiveToCallbackRector rules.

Requirements

Installation

Clone this repository and install dependencies:

Rules

RenameFindAndGetMethodCallRector

Automatically renames find* methods to get* when they return a non-nullable entity type.

What it does

This rule enforces a naming convention where:

This follows the common convention where:

Before

After

Rules for transformation

The rule will rename a method from find* to get* if:

  1. Method name starts with "find"
  2. Has a return type declaration
  3. Return type is not nullable (?Type)
  4. Return type is not a union type
  5. Return type is not a primitive type (int, string, bool, float, array, object, mixed, void)

WithConsecutiveToCallbackRector

Replaces deprecated PHPUnit willReturnCallback to ensure compatibility with PHPUnit 10+.

What it does

This rule transforms deprecated withConsecutive method calls to use willReturnCallback with conditional assertions based on invocation count. This is necessary because withConsecutive was deprecated in PHPUnit 9.6 and removed in PHPUnit 10.

Before

After

Usage

Manual Configuration

Create a rector.php configuration file:

Running Rector

Execute the refactoring:

Development

Continuous Integration

This project uses GitHub Actions for automated testing and code quality checks:

Local Development Scripts

Running Tests

Code Analysis

Code Formatting

This project uses Laravel Pint for code formatting, configured to follow PSR-12 standards:

The Pint configuration is stored in pint.json and includes:

Project Structure

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add your changes with tests
  4. Ensure all tests pass
  5. Submit a pull request

License

This project is open source. Please check the license file for more details.

Author

Created by Simtel


For more information about Rector, visit https://getrector.org/


All versions of rector-rules with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package simtel/rector-rules contains the following files

Loading the files please wait ...