Download the PHP package valkyrja/ci-rector without Composer

On this page you can find all versions of the php package valkyrja/ci-rector. 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 ci-rector

Valkyrja Rector

Shared Rector configuration for Valkyrja PHP projects — a reusable rule set, custom Rector rules, and a workflow that enforce consistent automated refactoring across consuming repositories.

PHP Version Require Latest Stable Version License CI Status Scrutinizer Coverage Status Psalm Shepherd Maintainability Rating

Overview

This repository contains two things:

  1. Valkyrja\Rector\Rules — a reusable RectorConfigBuilder factory that wires up all rules used across the Valkyrja monorepo. Drop it into any rector.php config and set your paths on the returned builder.
  2. Custom Rector rules — project-specific refactoring rules that fill gaps in the built-in Rector library.

Installation

Usage

Call Rules::getConfig() from your rector.php configuration file and set the source paths on the returned builder:

getConfig() takes no arguments and returns a RectorConfigBuilder. Chain any additional Rector configuration — paths, skip rules, PHP version sets, etc. — directly on the returned builder before returning it.

Run Rector as normal:

Or in dry-run mode to preview changes without writing them:

Configuration Details

Parallel Execution

withParallel() is enabled, allowing Rector to process files concurrently across multiple worker processes.

Import Names

withImportNames(removeUnusedImports: true) is set, so Rector will:

Rules

Built-in Rules

Rule Description
AddVoidReturnTypeWhereNoReturnRector Adds : void return type to methods that have no return statement
AddOverrideAttributeToOverriddenMethodsRector Adds #[Override] attribute to methods that override a parent
ConvertStaticToSelfRector Converts static:: to self:: inside non-final classes where late static binding is not needed
ExplicitNullableParamTypeRector Converts ?Type param declarations to Type\|null union syntax
NewMethodCallWithoutParenthesesRector Removes unnecessary parentheses from new expressions used directly in method chains (PHP 8.4)
RemoveParentCallWithoutParentRector Removes parent::method() calls when no parent class exists
RemoveUselessAliasInUseStatementRector Removes aliases in use statements where the alias matches the class's own short name
RemoveUselessParamTagRector Removes @param PHPDoc tags whose type is already expressed in the signature
RemoveUselessReturnTagRector Removes @return PHPDoc tags whose type is already expressed in the signature
SeparateMultiUseImportsRector Splits use A, B; into individual use A; use B; statements
StaticToSelfOnFinalClassRector Converts static:: to self:: inside final classes

Custom Rules

RemoveNonConflictingAliasInUseStatementRector

Valkyrja\Rector\CodingStyle\Rector\Stmt\RemoveNonConflictingAliasInUseStatementRector

Removes aliases from use statements when the alias serves no purpose — i.e. when nothing in the file would conflict if the alias were dropped.

The built-in RemoveUselessAliasInUseStatementRector only removes an alias when it is identical to the imported class's short name. This rule goes further: it removes the alias whenever keeping it is unnecessary, checking for conflicts against:

When the alias is removed, all references to it throughout the file — including PHPDoc comments, type declarations, extends, implements, and use (traits) — are rewritten to the unaliased short name.

Before:

After:

An alias is preserved whenever it would cause a naming conflict — for example when two imports share the same short name, or when the short name clashes with the file's own class name.

Workflows

The _workflow-call.yml reusable workflow runs Rector against the calling repository's source. It is designed to be called from other repositories via workflow_call.

Inputs

Input Type Default Description
paths string — Required. YAML filter spec with two keys: ci (CI config files that trigger a base-branch fetch) and files (all files that trigger the check).
post-pr-comment boolean true Post a PR comment on failure and remove it on success. Disable when the calling workflow handles its own reporting.
composer-options string '' Extra flags passed to every composer install step (e.g. --ignore-platform-req=ext-openswoole).
php-version string '8.4' PHP version to use.
ci-directory string '.github/ci/rector' Path to the CI directory containing composer.json and the tool config.
extensions string 'mbstring, intl' PHP extensions to install via shivammathur/setup-php.

Usage

secrets: inherit is required to pass the VALKYRJA_GHA_APP_ID and VALKYRJA_GHA_PRIVATE_KEY org secrets used for PR comments.

Contributing

See CONTRIBUTING.md for the submission process and VOCABULARY.md for the terminology used across Valkyrja.

Security Issues

If you discover a security vulnerability, please follow our disclosure procedure.

License

Licensed under the MIT license. See LICENSE.md.


All versions of ci-rector with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
nette/utils Version ^4.1.5
rector/rector Version ^2.6.7
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 valkyrja/ci-rector contains the following files

Loading the files please wait ...