Download the PHP package maarsson/coding-standard without Composer

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

maarsson/coding-standard

Centralized custom coding standards that can be applied across my different projects.

[!NOTE] See also maarsson/dev-tools.

About

This package provides shared code quality rulesets and a sync script that applies them to consumer projects in a predictable and consistent way.

By following the installation steps below, the rulesets are automatically applied after composer install and composer update in your project. This guarantees that all projects use the exact same ruleset versions.

Currently supported:


Requirements


Installation

1. Package installation

Install the package as a development dependency in your project:

composer require --dev maarsson/coding-standard


2. Project configuration (required)

To ensure the coding standards are applied automatically, you must configure Composer scripts in the target project.

2.1. Add a named sync script

In your project’s composer.json add:

2.2. Run the sync script on install and update

Extend your project’s composer.json scripts section to include:

With this setup, the coding standards are applied automatically.


When does it apply?

Once configured, the sync script runs automatically in the following cases:

Automatic execution:

Manual execution:


What does the sync script do?

The sync script copies shared ruleset files from the package into the project root.

Currently applied files:

Overwrite behavior

The sync process uses an always overwrite strategy:

This behavior is intentional and ensures consistency across projects. If you need to customize rules per project, fork this repository or manage overrides outside of this package.


Usage

After the sync script runs, the ruleset files will exist in your project root, but the corresponding tools must also be installed. However if you installed the package via maarsson/dev-tools you don’t need to install these manually. Otherwise run:

Note: *.cache should be added to .gitignore.

Using PHPMD with the installed ruleset

Run the PHPMD check for displaying violations like this:

./vendor/bin/phpmd . ansi phpmd.xml --suffixes=php --cache --cache-file=.phpmd.cache

Using PHPCS with the installed ruleset

Run the PHPCS check for displaying violations like this:

./vendor/bin/phpcs --parallel=4 --standard=phpcs.xml -d memory_limit=1G --cache=.phpcs.cache .

Or run the PHPCBF (comes with the same package) to actually fix violations like this:

./vendor/bin/phpcbf --parallel=4 --standard=phpcs.xml -d memory_limit=1G --cache=.phpcs.cache .

Using PHP-CS-Fixer with the installed ruleset

Run the PHP-CS-Fixer check for displaying violations like this:

./vendor/bin/php-cs-fixer fix --dry-run --diff --config=.php-cs-fixer.php --cache-file=.php-cs-fixer.cache

Or run the PHP-CS-Fixer to actually fix violations like this:

./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --cache-file=.php-cs-fixer.cache

Using Larastan with the installed ruleset

Run the Larastan check for displaying possible bugs like this:

./vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=1G --no-progress


Troubleshooting

Source file not found

This typically means:

Try:

Sync script not executable

Ensure your environment supports running scripts from vendor/bin and that file permissions are preserved.


License

MIT


All versions of coding-standard with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4 <8.6
friendsofphp/php-cs-fixer Version ^3.95
larastan/larastan Version ^3.10
php-parallel-lint/php-parallel-lint Version ^1.4
phpmd/phpmd Version ^3.0
phpro/grumphp Version ^2.25
shipmonk/dead-code-detector Version ^1.4
slevomat/coding-standard Version ^8.31
squizlabs/php_codesniffer Version ^4.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 maarsson/coding-standard contains the following files

Loading the files please wait ...