Download the PHP package zvive/fixer without Composer

On this page you can find all versions of the php package zvive/fixer. 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 fixer



phpcsfixer-preset

version license downloads Run Tests Coverage Status



This package allows you to use the same php-cs-fixer formatting rules across all of your projects without copy-and-pasting configuration files. There's also a quick setup script to automatically generate a configuration file for your project structure and preferred formatting preset.

zvive/fixer provides several opinionated php-cs-fixer configuration choices as well as pre-configured Finder classes for common project formats and use cases.

Supported PHP versions: 8.1.

The original concept for this package came from this excellent article on sharing php-cs-fixer configurations across projects written by Tim Mcdonald.

Installation

composer require zvive/fixer --dev


Example .php-cs-fixer.dist.php files

This example uses the Laravel project finder and the Default Ruleset:

Standard PhpCsFixer\Finder options can be chained onto the custom Finder class to customize it to your preferences:

You can also use the standard PhpCsFixer\Finder class along with any of the Rulesets:


Overriding Ruleset Rules

When creating a Ruleset class, you may pass an array of php-cs-fixer rules that will add or override the ruleset's default rules.


Quick Setup

To generate a php-cs-fixer configuration file for your project, run:

Parameter: <type>

Required: yes

Default: no default

Possible values:

Flag: --outfile (or -o)

Required: no

Default: .php-cs-fixer.dist.php

Possible values: any valid filename

Flag: --ruleset (or -r)

Required: no

Default: default

Possible values:

Flag: --force (or -f)

Required: no

Default: false

Possible values: none

Effect: overwrites any existing configuration file

Examples:

Note on the custom type:

The custom type will prompt you to enter the directory names you'd like php-cs-fixer to include and exclude. The generated configuration file implements the PhpCsFixer\Finder class instead of one of the preconfigured finder classes.


Automatic Formatting

If you would like to automatically apply php-cs-fixer formatting using Github Actions, see the automation with Github Actions documentation.


Finder Presets

BasicProjectFinder

LaravelProjectFinder

LaravelPackageFinder

ComposerPackageFinder


Rulesets

Default

LaravelShift

PhpUnit

SpatieRuleset



Usage

Select a Finder preset or create an instance of \PhpCsFixer\Finder and return SharedConfig::create($finder) from the .php-cs-fixer.dist.php file.

Updating Default Rules

Update the rules() method in the Zvive\Fixer\Rulesets\DefaultRuleset class.

Creating Rulesets

Create a class that implements the Zvive\Fixer\Rulesets\Ruleset interface, returning your rules from the rules() method.

Sample Ruleset:

If adding a new Ruleset to this package, the Ruleset must be registered in \Zvive\Fixer\Commands\GenerateConfigCommand@rulesets() to allow the quick setup command to use it.

If creating a new Ruleset package for your own use, follow the above example but use a namespace unique to your package.


Formatting Your Code

To format all files specified in the configuration, run:

vendor/bin/php-cs-fixer fix

To see which files will be formatted without making any changes, run:

vendor/bin/php-cs-fixer fix --dry-run


Testing

This package uses PHPUnit for unit tests. To run the test suite, run:

./vendor/bin/phpunit


Changelog

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


Contributions

Contributions of Rulesets, Finders, bugfixes, suggestions, or improvements are welcomed. Please open an appropriately labeled issue or pull request for any of these.


License

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


All versions of fixer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
illuminate/collections Version ^8.0||^9.0||^10.0
illuminate/support Version ^8.0||^9.0||^10.0
kubawerlos/php-cs-fixer-custom-fixers Version ^3.6
friendsofphp/php-cs-fixer Version ^v3.0
symfony/console Version ^5.0||^6.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 zvive/fixer contains the following files

Loading the files please wait ....