PHPackages                             zoliszabo/rector-docker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. zoliszabo/rector-docker

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

zoliszabo/rector-docker
=======================

A wrapper Composer library for running Rector via Docker.

1.0.1+rector-2.1.4(9mo ago)03MITShellCI passing

Since Aug 17Pushed 9mo agoCompare

[ Source](https://github.com/zoliszabo/rector-docker-composer)[ Packagist](https://packagist.org/packages/zoliszabo/rector-docker)[ RSS](/packages/zoliszabo-rector-docker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Rector Docker Composer Package
==============================

[](#rector-docker-composer-package)

A wrapper Composer library for running [Rector](https://getrector.com/) via Docker. This package provides a convenient way to use Rector without requiring PHP or Rector to be installed locally on your system.

What is this?
-------------

[](#what-is-this)

This Composer package provides a `rector-docker` command that wraps the [zoliszabo/rector-docker](https://github.com/zoliszabo/rector-docker) Docker image, making it easy to run Rector on your PHP projects through a simple command-line interface.

Key Benefits
------------

[](#key-benefits)

- **No local PHP installation required** - Run Rector regardless of your system's PHP version
- **Always up-to-date** - Uses the latest Rector version from the Docker image
- **Cross-platform compatibility** - Works on any system that supports Docker
- **Intelligent terminal detection** - Automatically handles interactive vs non-interactive environments
- **Simple integration** - Drop-in replacement for the standard `rector` command

Installation
------------

[](#installation)

### Global Installation (Recommended)

[](#global-installation-recommended)

Install the package globally to use the `rector-docker` command from anywhere:

```
composer global require zoliszabo/rector-docker
```

Make sure your global Composer `bin` directory is in your system's `PATH`. You can find the path with:

```
composer global config bin-dir --absolute
```

### Project-specific Installation

[](#project-specific-installation)

You can also install it as a development dependency in your project:

```
composer require --dev zoliszabo/rector-docker
```

Usage
-----

[](#usage)

Once installed, navigate to your project directory and use `rector-docker` exactly like you would use the regular `rector` command.

### Global Installation Usage

[](#global-installation-usage)

```
# Process using default rector.php configuration
rector-docker process

# Process your src directory
rector-docker process src

# Show available rules
rector-docker list-rules

# Generate a rector.php configuration file
rector-docker init

# Dry run to see what would be changed
rector-docker process src --dry-run

# Process with a specific configuration file
rector-docker process src --config custom-rector.php
```

### Project-specific Installation Usage

[](#project-specific-installation-usage)

When installed as a project dependency, prefix commands with `vendor/bin/`:

```
# Process using default rector.php configuration
vendor/bin/rector-docker process

# Process your src directory
vendor/bin/rector-docker process src

# Or use composer exec
composer exec rector-docker process src
```

All arguments and options are passed directly to Rector running inside the Docker container.

How it Works
------------

[](#how-it-works)

The `rector-docker` command:

1. Detects if it's running in an interactive terminal environment
2. Mounts your current working directory to `/app` inside the Docker container
3. Runs the appropriate `docker run` command with the correct flags
4. Forwards all your arguments to Rector inside the container

### Interactive vs Non-Interactive Detection

[](#interactive-vs-non-interactive-detection)

The script automatically detects the environment:

- **Interactive terminals**: Uses `-it` flags for proper terminal interaction
- **CI/Scripts**: Omits `-it` flags to prevent hanging in non-interactive environments

Requirements
------------

[](#requirements)

- Docker installed and running on your system
- Composer for package installation

Docker Image
------------

[](#docker-image)

This package uses the `zoliszabo/rector:latest` Docker image, which contains:

- Latest PHP version
- Latest Rector version
- All necessary dependencies

Related Projects
----------------

[](#related-projects)

- [rector-docker](https://github.com/zoliszabo/rector-docker) - The underlying Docker image
- [Rector](https://getrector.com/) - The PHP refactoring tool

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) file for details.

Contributing
------------

[](#contributing)

Issues and pull requests are welcome!

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance58

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

273d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/191ace8a9eeaa316ba5321d33ad6c61b4881e0becc8d7e7fe9e881683520d13a?d=identicon)[zoliszabo](/maintainers/zoliszabo)

---

Top Contributors

[![zoliszabo](https://avatars.githubusercontent.com/u/9949042?v=4)](https://github.com/zoliszabo "zoliszabo (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![rector-docker-automation[bot]](https://avatars.githubusercontent.com/u/9949042?v=4)](https://github.com/rector-docker-automation[bot] "rector-docker-automation[bot] (1 commits)")

---

Tags

composercomposer-librarydockerphp

### Embed Badge

![Health badge](/badges/zoliszabo-rector-docker/health.svg)

```
[![Health](https://phpackages.com/badges/zoliszabo-rector-docker/health.svg)](https://phpackages.com/packages/zoliszabo-rector-docker)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
