Download the PHP package nexusphp/cs-config without Composer

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

Nexus CS Config

PHP version build Coverage Status

This library provides a factory for custom rulesets for friendsofphp/php-cs-fixer.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require nexusphp/cs-config

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

composer require --dev nexusphp/cs-config

Configuration

Advanced Configuration

Adding Preformatted License Header

You can create a preformatted license header to all PHP files by using the public forLibrary() method instead of forProjects(). This method accepts two required arguments (the library name and author) and two optional arguments (the email address and starting year of license).

This setting will configure a license header similar to below:

If you opted not to provide any of the optional arguments (i.e., email address, starting license year), these will not be shown on the license header allowing flexibility on the copyright portion.

This will give the following license header:

Overriding Rules in a Ruleset

If you feel that a specific rule in the ruleset is not appropriate for you, you can override it instead of creating a new ruleset:

Specifying Options to PhpCsFixer\Config

The Factory class returns an instance of PhpCsFixer\Config and fully supports all of its properties setup. You can pass an array to the third parameter of Factory::create() containing your desired options.

Options

Key Allowed Types Default
cacheFile string .php-cs-fixer.cache
customFixers FixerInterface[], iterable, \Traversable []
finder iterable, string[], \Traversable default PhpCsFixer\Finder instance
format string txt
hideProgress bool false
indent string ' ' // 4 spaces
lineEnding string "\n"
phpExecutable null, string null
isRiskyAllowed bool false
usingCache bool true
customRules array []

Customization of Ruleset

What is the purpose of a configuration factory if not able to create a custom ruleset for an organization-wide usage, right? Well, you are not constrained to use the default rulesets and putting a long array of overrides. That's pretty nasty.

The way to achieve this is dependent on you but the main idea is creating a new ruleset that extends Nexus\CsConfig\Ruleset\AbstractRuleset. Yup, it's that easy. Then you just need to provide details for its required four (4) protected properties.

Then, in creating your .php-cs-fixer.dist.php, use your own ruleset.

Credits

This project is inspired by and an enhancement of ergebnis/php-cs-fixer-config.

Contributing

Contributions are very much welcome. If you see an improvement or bugfix, open a PR now!


All versions of cs-config with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-tokenizer Version *
friendsofphp/php-cs-fixer Version ^3.60
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 nexusphp/cs-config contains the following files

Loading the files please wait ....