Download the PHP package object-calisthenics/phpcs-calisthenics-rules without Composer

On this page you can find all versions of the php package object-calisthenics/phpcs-calisthenics-rules. 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 phpcs-calisthenics-rules

Object Calisthenics rules for PHP_CodeSniffer

DEPRECATED: PHP_CodeSniffer is great for handling spaces and char positions. Yet these rules are about code architecture and structure. In 2020, there is tool that suits this perfectly - PHPStan.

Saying that, object calisthenics were implemented as PHPStan rules in a symplify/phpstan-rules package. Use it instead 👇




Downloads

Object Calisthenics are set of rules in object-oriented code, that focuses of maintainability, readability, testability and comprehensibility. We're pragmatic first - they are easy to use all together or one by one.

Why Should You Use This in Your Project?

Read post by William Durand or check presentation by Guilherme Blanco.

Install

Usage

If you know what you want, jump right to the specific rule:

How to quickly check 1 rule?

In PHP_CodeSniffer

In EasyCodingStandard

then


Implemented Rule Sniffs

1. Only X Level of Indentation per Method

:x:

:+1:

Use Only This Rule?

In PHP_CodeSniffer:

In ECS:

:wrench: Configurable

In PHP_CodeSniffer:

In ECS:


2. Do Not Use "else" Keyword

:x:

:+1:

Use Only This Rule?

In PHP_CodeSniffer:

In ECS:


5. Use Only One Object Operator (->) per Statement

:x:

:+1:

Use Only This Rule?

In PHP_CodeSniffer:

In ECS:

:wrench: Configurable

In PHP_CodeSniffer:

In ECS:


6. Do not Abbreviate

This is related to class, trait, interface, constant, function and variable names.

:x:

:+1:

Use Only This Rule?

In PHP_CodeSniffer:

In ECS:

:wrench: Configurable

In PHP_CodeSniffer:

In ECS:


7. Keep Your Classes Small

:x:

:+1:

:x:

:+1:

:x:

:+1:

:x:

:+1:

Use Only This Rule?

In PHP_CodeSniffer:

In ECS:

:wrench: Configurable

In PHP_CodeSniffer:

In ECS:


9. Do not Use Getters and Setters

This rules is partially related to Domain Driven Design.

:x:

:+1:

Use Only This Rule?

In PHP_CodeSniffer:

In ECS:

:wrench: Configurable

In PHP_CodeSniffer:

In ECS:


Not Implemented Rules - Too Strict, Vague or Annoying

While using in practice, we found these rule to be too strict, vague or even annoying, rather than helping to write cleaner and more pragmatic code. They're also closely related with Domain Driven Design.

3. Wrap Primitive Types and Strings - Since PHP 7, you can use define(strict_types=1) and scalar type hints. For other cases, e.g. email, you can deal with that in your Domain via Value Objects.

4. Use First Class Collections - This rule makes sense, yet is too strict to be useful in practice. Even our code didn't pass it at all.

8. Do Not Use Classes With More Than Two Instance Variables - This depends on individual domain of each project. It doesn't make sense to make a rule for that.


3 Rules for Contributing

We will be happy to merge your feature then.


All versions of phpcs-calisthenics-rules with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
nette/utils Version ^3.1
slevomat/coding-standard Version ^6.3
squizlabs/php_codesniffer Version ^3.5
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 object-calisthenics/phpcs-calisthenics-rules contains the following files

Loading the files please wait ....