Download the PHP package lumnd/plato-coding-standard without Composer

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

lumnd/plato-coding-standard

PHP_CodeSniffer rules for PlatoPHP projects. The standard starts from PSR-12, removes the naming and brace conventions PlatoPHP deliberately does not follow, then adds a project sniff that enforces the replacement rules instead of leaving both styles legal.

简体中文

Use it when a PHP project wants:

Excluding a PSR-12 sniff only makes both spellings legal. A tree that excludes Squiz.Classes.ValidClassName does not require snake_case — it stops having an opinion, and the two styles drift apart inside one repository with nothing to say so. This package is both halves: the exclusions, and ProjectConventionsSniff, which rejects the PSR-12 spelling in their place.

It exists because the exclusions were pasted into three repositories and drifted. One copy was missing Squiz.Functions.MultiLineFunctionDeclaration.NewlineBeforeOpenBrace and still errored on wrapped signatures; one carried a bug in the sniff that the others had already fixed; one shipped a standard named after the wrong project. A convention with three copies has no authority.

Requirements

PHP 8.0+
PHP_CodeSniffer ^3.11

Install

This package's type is phpcodesniffer-standard, which is what dealerdirect/phpcodesniffer-composer-installer scans installed packages for. It writes this directory into phpcs's installed_paths, and that is what lets a consumer name the standard instead of spelling out a path into vendor/. The plugin is a hard requirement rather than a suggestion: without it the standard installs but never registers, and the ruleset fails to resolve the name with an error that does not say why.

Composer will not run a plugin a project has not allowed, so the consuming composer.json needs:

Use

A consumer's phpcs.xml keeps what is genuinely its own — which directories to check, which generated output to skip — and refs the standard by name:

Everything else — the PSR-12 base, the exclusions, the 120 column soft limit, Allman braces for functions and closures, ignore_warnings_on_exit — comes with the name.

What it enforces

Code Rule
ClassName Classes, interfaces, traits and enums are lowercase snake_case
FunctionName Functions and methods are lowercase snake_case
MethodVisibilityPrefix private / protected methods start with _; public ones do not
PropertyVisibilityPrefix The same for properties
SpaceAfterOpenParenthesis SpaceBeforeCloseParenthesis One space inside control parentheses: if ( $ready )
ControlBraceLine A control structure's opening brace is on the line after the signature
ContinuationLine else, catch, finally and do-while start on a new line, not } else

All codes are prefixed PlatoPHP.Style.ProjectConventions.

Zero errors is the gate. The 120 column limit is a warning, which PSR-12 requires it to be, and ignore_warnings_on_exit keeps it out of the exit code.

What phpcbf fixes, and what it will not

The whitespace rules are fixable — composer style:fix rewrites if($x){ into the convention, including moving else and catch onto their own lines. Two cases are reported without a fix on purpose, because closing the gap would change more than formatting:

The naming rules are never fixable. Renaming a method means finding its callers, which is not something a formatter should attempt.

Exceptions

Magic methods are exempt from both naming rules. __toString, __callStatic and __debugInfo are camelCase and __construct is public while starting with an underscore — the engine owns those spellings, so they are not a project's to choose. The sniff carries PHP's list and skips it.

A name a third party dictates is not relaxed, it is suppressed where it happens. A class implementing PSR-16 must provide getMultiple(); renaming it would mean not implementing the interface. Mark that class rather than widening the rule for everybody:

ProjectConventionsSniff does the same to itself: PHPCS's loader requires a StudlyCaps class name ending in Sniff, so the file carries a one-line phpcs:ignore for its own ClassName rule.

Tests

Runs the standard over tests/fixtures and asserts what fires, what does not, what phpcbf rewrites, that a second fix run changes nothing, and that the two unfixable cases come back byte-identical. There is no test framework: a coding standard is a dependency of everybody else's test setup, and giving it one of its own buys a version conflict for nothing.

Checks this package against the standard it ships.

License

MIT.


All versions of plato-coding-standard with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
squizlabs/php_codesniffer Version ^3.11
dealerdirect/phpcodesniffer-composer-installer Version ^1.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 lumnd/plato-coding-standard contains the following files

Loading the files please wait ...