costamateus / bracketsmith
A lightweight PHP tool that polishes array formatting โ keeping your brackets neat and consistent.
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/costamateus/bracketsmith
Requires
- php: >=8.1
README
BracketSmith is a lightweight PHP tool for standardizing array spacing โ keeping your square brackets [ ] clean and consistent.
๐ Installations
composer require costamateus/bracketsmith
Or for global use:
composer global require costamateus/bracketsmith
๐ก CLI usage
vendor/bin/bracketsmith --dry-run
Optional parameters:
--dry-runโ only checks, without altering files.--verboseโ shows processed files.--helpโ displays help information.- It is possible to pass specific files or directories:
vendor/bin/bracketsmith app/Models/User.php # Process single file vendor/bin/bracketsmith app/Models/ # Process directory
โ๏ธ Configuration
You can customize which directories and files to process by creating a bracketsmith.json file in your project root.
Example bracketsmith.json:
{
"include": ["app/", "routes/"],
"exclude": ["vendor/", "storage/", "node_modules/"]
}
include: Array of directories/files to process (relative paths or patterns).exclude: Array of patterns to skip (substrings in file paths).
If no config file is found, default include and exclude patterns are used.
Copy bracketsmith.json.example to get started.
๐งช Tests
composer test
๐ License
MIT ยฉ Mateus Costa