Download the PHP package jubeki/laravel-code-style without Composer

On this page you can find all versions of the php package jubeki/laravel-code-style. 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 laravel-code-style

Laravel Code Style

Combine Custom Fixers with the ruleset of Laravel Pint

GitHub Workflow Status Downloads Total Latest released version

Supports Laravel 9.x and 10.x Supports PHP 8.0, 8.1 and 8.2

Introduction

This package provides automatic code style checking and formatting for Laravel applications and packages using the same ruleset as Laravel Pint. This package is built on top of PHP-CS-Fixer and therefor gives you the ability to add custom fixers. (which is one of the shortcomings of Laravel Pint)

Installation

Once the package is installed you should publish the configuration.

Publishing the config will add a .php-cs-fixer.dist.php configuration file to the root of your project. You may customize this file as needed and then commit it to your version control system.

A cache file will be written to .php-cs-fixer.cache in the project root the first time you run the fixer. You should ignore this file so it is not added to your version control system.

Usage

Once the package is installed you can check and fix your code formatting with the on subcommand of vendor/bin/php-cs-fixer.

Automatically fix the code style

To automatically fix the code style of your project you may use the following command:

By default only the file names of every file fixed will be shown. To see a full diff of every change append the --diff flag.

Checking for code style violations

If you would like to check the formatting without actually altering any files you should use the fix command with the --dry-run flag.

In dry-run mode any violations will cause the command to return a non-zero exit code. You can use this command to fail a CI build or git commit hook.

Composer script

To make checking and fixing code style easier for contributors to your project it's recommended to add the commands as a composer script:

More Options

For a complete list of options please consult the PHP-CS-Fixer documentation.

Configuration

The default configuration is published as .php-cs-fixer.dist.php in the project root. You can customize this file to change options such as the paths searched or the fixes applied.

Paths

You can change the paths searched for PHP files by chaining method calls onto the PhpCsFixer\Finder instance being passed to the Jubeki\LaravelCodeStyle\Config::setFinder method.

For example, to search the examples directory you would append ->in('examples'):

The default paths are setup for a Laravel application. If you are writing a package the path helper functions will not available and you will need to change the paths as necessary, i.e. PhpCsFixer\Finder::create()->in(__DIR__).

For a complete list of options refer to the Symfony Finder documentation.

Rules

By default only the Laravel Pint preset is enabled. This preset enforces many different rules which can be found in Jubeki\LaravelCodeStyle\Config

It is possible to override a specific rule from the preset. For example, you could disable the no_unused_imports rule like this:

For a complete list of available rules please refer to the php-cs-fixer documentation.

Releases

A major version bump only occurs should there be a big change to the Laravel Pint project.

Otherwise each rule change according to Laravel Pint is only a minor version bump. (This means there can be rules added, changed or removed).

Changelog

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-code-style with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
friendsofphp/php-cs-fixer Version ^3.47
illuminate/support Version ^9.34 || ^10.0 || ^11.0 || ^12.0
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 jubeki/laravel-code-style contains the following files

Loading the files please wait ....