{"id":15188506,"url":"https://github.com/shsharkar/php-refactor-toolkit","last_synced_at":"2026-03-02T18:45:07.777Z","repository":{"id":252227842,"uuid":"839812910","full_name":"SHSharkar/PHP-Refactor-Toolkit","owner":"SHSharkar","description":"The PHP Refactor Toolkit is a comprehensive script designed to streamline and automate the refactoring of PHP code. It leverages several powerful tools to ensure your code adheres to best practices and modern coding standards.","archived":false,"fork":false,"pushed_at":"2024-08-09T12:47:45.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T21:52:42.191Z","etag":null,"topics":["coding","ecs","fixer","laravel","laravel-framework","optimization","php","php-cs-fixer","rector","refactor","refactoring"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SHSharkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-08T11:27:00.000Z","updated_at":"2024-08-09T12:45:04.000Z","dependencies_parsed_at":"2024-08-08T13:39:50.140Z","dependency_job_id":"2e06c81f-226e-4818-adfd-962c965394df","html_url":"https://github.com/SHSharkar/PHP-Refactor-Toolkit","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"0e6b7ea6f57d724940ea294eeba8611407a7006a"},"previous_names":["shsharkar/php-refactor-toolkit"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SHSharkar%2FPHP-Refactor-Toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SHSharkar%2FPHP-Refactor-Toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SHSharkar%2FPHP-Refactor-Toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SHSharkar%2FPHP-Refactor-Toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SHSharkar","download_url":"https://codeload.github.com/SHSharkar/PHP-Refactor-Toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987721,"owners_count":19889388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coding","ecs","fixer","laravel","laravel-framework","optimization","php","php-cs-fixer","rector","refactor","refactoring"],"created_at":"2024-09-27T19:21:35.201Z","updated_at":"2026-03-02T18:45:07.717Z","avatar_url":"https://github.com/SHSharkar.png","language":"Shell","readme":"# PHP Refactor Toolkit\n\n## Overview\n\nThe PHP Refactor Toolkit is a comprehensive script designed to streamline and automate the refactoring of PHP code. It leverages several powerful tools to ensure your code adheres to best practices and modern coding standards.\n\n## Features\n\n- **RectorPHP:** Automated code refactoring.\n- **Easy Coding Standard (ECS):** Enforces coding standards.\n- **PHP CS Fixer:** Fixes code to follow standards.\n- **Laravel Pint:** Laravel-specific code formatting.\n\n## Prerequisites\n\n- **PHP:** Ensure you have PHP version 8.3 or higher installed. This toolkit is designed for modern coding practices and helps migrate old version syntaxes to new upgraded versions.\n- **Composer:** Ensure Composer is installed for managing PHP dependencies.\n- **Zsh or Bash:** This toolkit can be configured for either Zsh or Bash shell environments.\n\n## Installation\n\n### Automated Installation\n\nYou can install the toolkit using the following command:\n\n```sh\ncurl -sL https://github.com/SHSharkar/PHP-Refactor-Toolkit/raw/main/installer.sh | bash\n```\n\nThis command will:\n\n1. Clone the repository to your home directory.\n2. Copy the necessary configuration files.\n3. Set up the script for global access.\n\n### Manual Installation\n\nIf you prefer to install manually, follow these steps:\n\n1. Clone the repository:\n\n   ```sh\n   git clone https://github.com/SHSharkar/PHP-Refactor-Toolkit ~/php_refactor_toolkit\n   ```\n\n2. Copy the configuration files:\n\n   ```sh\n   cp ~/php_refactor_toolkit/rector.php ~/\n   cp ~/php_refactor_toolkit/.ecs.php ~/\n   cp ~/php_refactor_toolkit/.php-cs-fixer.php ~/\n   cp ~/php_refactor_toolkit/pint.json ~/\n   ```\n\n3. Set up the script:\n\n   ```sh\n   mkdir -p ~/bin\n   cp ~/php_refactor_toolkit/php_refactor_toolkit.sh ~/bin/php_refactor_toolkit\n   chmod +x ~/bin/php_refactor_toolkit\n   ```\n\n4. Add `~/bin` to your `PATH` in your shell configuration file (`.zshrc` or `.bashrc`):\n\n   ```sh\n   echo 'export PATH=$HOME/bin:$PATH' \u003e\u003e ~/.zshrc\n   source ~/.zshrc\n   ```\n\n   For Bash:\n\n   ```sh\n   echo 'export PATH=$HOME/bin:$PATH' \u003e\u003e ~/.bashrc\n   source ~/.bashrc\n   ```\n\n## Usage\n\nOnce installed, you can run the PHP Refactor Toolkit using the following command:\n\n```sh\nphp_refactor_toolkit\n```\n\n### Menu Options\n\nThe toolkit provides a user-friendly menu with the following options:\n\n1. **Refactor a PHP file:** Choose this option to refactor a single PHP file using one of the supported tools.\n2. **Refactor all PHP files in a directory:** This option allows you to refactor all PHP files within a specified directory.\n3. **Quit:** Exit the script.\n\n### Tool Selection\n\nAfter selecting a file or directory, you'll be prompted to choose a refactoring tool:\n\n1. **RectorPHP:** For automated code refactoring.\n2. **Easy Coding Standard (ECS):** To enforce coding standards.\n3. **PHP CS Fixer:** For fixing code style issues.\n4. **Laravel Pint:** For Laravel-specific formatting.\n5. **Apply All:** Apply all the above tools sequentially.\n6. **Back to main menu:** Return to the main menu to select a different option.\n\n### Refactoring Process\n\nThe toolkit will guide you through the refactoring process. If you choose to refactor another file or directory after completing a task, you can either continue with the same tool or return to the main menu to choose a different tool.\n\nVerbose output, including diffs and applied changes, will be displayed to provide insight into what changes were made by each tool.\n\n## Issues and Contributions\n\nWe welcome contributions and encourage you to report any issues or feature requests. Please visit the [GitHub Issues page](https://github.com/SHSharkar/PHP-Refactor-Toolkit/issues) to report any bugs or request new features.\n\nIf you would like to contribute to the project, feel free to fork the repository, make your changes, and submit a pull request. We appreciate all contributions that help improve the PHP Refactor Toolkit.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/SHSharkar/PHP-Refactor-Toolkit/blob/main/LICENSE) file for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshsharkar%2Fphp-refactor-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshsharkar%2Fphp-refactor-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshsharkar%2Fphp-refactor-toolkit/lists"}