Download the PHP package shopsys/coding-standards without Composer

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

Shopsys Coding Standards

Downloads

Shopsys Coding Standards are based on PSR-2.

This project bundles tools along with predefined rulesets for automated checks of Shopsys Coding Standards that we use in many Shopsys projects. The repository also contains few custom rules.

This repository is maintained by monorepo CHANGELOG.md.

Provided tools:

For further information see official documentation of those tools.

Installation

Usage

Create easy-coding-standard.yml config file in your project which includes predefined ruleset. You can also customize the rules and even add your own sniffs and fixers in the config.

In terminal, run following commands:

Custom rules

Rules for PHP-CS-Fixer

Shopsys/missing_button_type

All <button> HTML tags in .html and .html.twig files must have explicit type attribute.

If the type is not specified it will be fixed to type="button"" because the implicit value is submit which makes it behave differently based on the context (<button> inside <form> element submits the form).

Shopsys/orm_join_column_require_nullable

Doctrine annotations @ORM\ManyToOne and @ORM\OneToOne must have nullable option defined explicitly in @ORM\JoinColumn.

If the nullable option is not specified it will be fixed to nullable=false because the implicit value is true but this is the opposite to the implicit value of nullable for @Column annotation. This makes it consistent.

Rules for PHP_CodeSniffer

ForbiddenExitSniff

Function exit() is not allowed.

ForbiddenSuperGlobalSniff

Usage of superglobals ($_COOKIE, $_GET, $_FILES, $_POST, $_REQUEST, $_SERVER) is not allowed.

ObjectIsCreatedByFactorySniff

Instantiation of objects that can be created by their factories is not allowed outside of the factory.

ValidVariableNameSniff

Default \PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidVariableNameSniff does not report method parameters in $_var format as an violation but it should. It also skips checking of private members when PrivateNoUnderscore property is disabled.

This sniff provides the missing functionality and is intended to be used as an addition to the default ValidVariableNameSniff.

Contributing

Thank you for your contributions to Shopsys Coding Standards package. Together we are making Shopsys Platform better.

This repository is READ-ONLY. If you want to report issues and/or send pull requests, please use the main Shopsys repository.

Please, check our Contribution Guide before contributing.

Support

What to do when you are in troubles or need some help? The best way is to join our Slack.

If you want to report issues, please use the main Shopsys repository.


All versions of coding-standards with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-tokenizer Version *
friendsofphp/php-cs-fixer Version ^3.3.1
nette/utils Version ^3.1.3
php-parallel-lint/php-parallel-lint Version ^1.3.1
phpstan/phpstan Version ^1.6.8
slevomat/coding-standard Version ^8.13.1
squizlabs/php_codesniffer Version ^3.6.2
symfony/finder Version ^5.4
symplify/easy-coding-standard Version ^10.3.3
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 shopsys/coding-standards contains the following files

Loading the files please wait ....