Download the PHP package stickee/php-cs-fixer-config without Composer

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

stickee PHP CS Fixer config

Provides a PHP CS Fixer config for stickee projects.

Installation

You must commit this new directory and the .php-cs-fixer.dist.php config file.

You must add .php-cs-fixer.cache to your .gitignore file.

Why do we install PHP CS Fixer into its own directory?

Usage

Overrides

You can override any of the rules or add your own by adding them to the $overrideRules array in the .php-cs-fixer.dist.php file.

See here for a detailed description of available rules and their options.

Example

This has already been done for you with the ordered_class_elements rule which has been reset to the PSR12 value of use_traits only.

This has been added to help PR reviewers see only what has been changed when linting your project and not elements that have been re-ordered.

Once you are happy that your project has been linted correctly you may remove this override to use the stickee settings for this rule which are stricter and order more elements.

Pre-Commit Hook

You can use PHP CS Fixer in combination with Husky and Lint Staged to lint only git staged PHP files.

Installation

CI

An example GitHub action file is included at tools/php-cs-fixer/vendor/stickee/php-cs-fixer-config/dist/.github/workflows/php-cs-fixer.yaml.

This will run PHP CS Fixer on PRs and new commits to those PRs.

In theory this is not necessary since developers should be linting their code using the above mentioned pre-commit hook, however it ensures that PRs contain linted code in case a developer skips the pre-commit hook.

Rules

The available RuleSets can be found at tools/php-cs-fixer/vendor/stickee/php-cs-fixer-config/src/RuleSet/.

You can probably [ctrl] + click the class in the .php-cs-fixer.dist.php file to get to it in your editor.

Web description (prettier)

You can use either https://mlocati.github.io/php-cs-fixer-configurator/#version:3.2 or https://cs.symfony.com/doc/rules/index.html to see what the rules are doing.

CLI description (faster)

Alternatively you can run tools/php-cs-fixer/vendor/bin/php-cs-fixer describe <rule-or-set-name>.

Credits

https://github.com/Visual-Craft/php-cs-fixer-config

for inspiration on how to create a custom config for PHP CS Fixer since there's no built-in way to do it.

stickeerehan

for his earlier work on PHP Code Styles so I didn't have to start from scratch.

The "supermarket mobiles" developers

for reviewing the many PRs that finalised the rules that we use.

The members of the #codestyle Slack channel

for caring about code styles.


All versions of php-cs-fixer-config with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
friendsofphp/php-cs-fixer Version 3.45
adamwojs/php-cs-fixer-phpdoc-force-fqcn Version ^2.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 stickee/php-cs-fixer-config contains the following files

Loading the files please wait ....