nunophp/style

A Laravel package to set up new projects with Nuno Maduro's recommended tools and configurations.

v1.0.0 2025-02-23 15:12 UTC

This package is auto-updated.

Last update: 2025-05-23 15:43:18 UTC


README

Skeleton Php

GitHub Workflow Status (master) Total Downloads Latest Version License

Nunophp Style is a Laravel package that sets up your project with Nuno Maduro’s recommended tools and configurations, including Pest, Pint, PHPStan, and Rector, all streamlined via a single Artisan command.

Requires PHP 8.3+

⚑️ Install the package into your Laravel project using Composer:

composer require nunophp/style --dev

The package’s service provider (Nunophp\Style\StyleServiceProvider) will be auto-discovered by Laravel.

πŸš€ Run the setup command to configure your project with Nuno’s recommended style:

php artisan style:setup

This command will:

  • Prompt to install development tools (Pest, Pint, PHPStan, Rector).
  • Update composer.json with modern testing scripts.
  • Optionally update AppServiceProvider with recommended configurations.
  • Publish configuration files (pint.json, phpstan.neon, rector.php), with overwrite prompts if they exist.

Example Commands After Setup

🧹 Lint your codebase with Pint:

composer lint

βœ… Refactor with Rector:

composer refacto

βš—οΈ Analyze with PHPStan:

composer test:types

βœ… Test with Pest:

composer test:unit

πŸš€ Run the full test suite:

composer test

Output Example

When you run php artisan style:setup, expect a polished interface:

╔════════════════════════════════════╗
β•‘      Starting Nuno Style Setup     β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Do you want to install required development tools? (Pest, Pint, PHPStan, Rector) [yes]:
> no

 πŸ“ Updating composer.json...
 βœ“ composer.json updated with testing scripts.

Do you want to update AppServiceProvider with recommended configurations? This will replace your existing file. [yes]:
> no

 πŸ“¦ Publishing configuration files...
 ↳ Skipped pint.json (not overwritten).
 βœ“ Published phpstan.neon.
 ↳ Skipped rector.php (not overwritten).

╔════════════════════════════════════╗
β•‘    Nuno Style Setup Complete       β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
 πŸŽ‰ Run "composer test" to verify your setup!

Contributing

Contributions are welcome! Please submit pull requests to the GitHub repository.

Nunophp Style was created by Micheal Ataklt under the MIT license.