Download the PHP package vicimus/standard without Composer

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

Vicimus Standard

This is a phpcs implementation of the Vicimus Coding Standard. Combined with the PSR2 coding standard, the Vicimus Coding Standard fills in some holes that PSR2 does not cover (mainly PHP 7 related things, but a few others).

It's worth noting that many of these rules/sniffs are from existing phpcs code standard sniffs, and thus many of the rule descriptions are directly taken from their documentation.

Rules/Sniffs

The following rules expand upon PSR2s coding standards.

Arrays

Disallow Long Array Syntax

Ensures that all array definitions use the short syntax [] instead of long array().

Trailing Array Comma

Commas after last element in an array make adding a new element easier and result in a cleaner versioning diff.

This sniff enforces trailing commas in multi-line arrays and requires short array syntax [].

Classes

Class Constant Visibility

In PHP 7.1 it's possible to declare visibility of class constants. In a similar vein to optional declaration of visibility for properties and methods which is actually required in sane coding standards, this sniff also requires to declare visibility for all class constants.

Doc Comment

Ensures doc blocks follow basic formatting. This checks to make sure there is proper spacing, line breaks, etc. on all docblock content.

Function Call Argument Spacing

Ensures proper spacing between function arugments.

Lowercase Constants

Kind of redunant but included, ensures constants are not lowercase.

Unused Private Elements

Checks for unused methods, unused or write-only properties in a class and unused private constants. Reported unused elements are safe to remove.

This is very useful during refactoring to clean up dead code and injected dependencies.

Uppercase Constants

Ensures constants are declared in uppercase.

Formatting

Disallow Tab Indents

Ensures all indenting is done with spaces not tabs

Doc Comment Alignment

Ensures all doc comments use proper alignment and spacing between params and return values, with type, name and descriptions.

Function Comments

Ensures all methods are commented with accurate doc blocks.

Inline Doc Comment Declaration

Reports invalid format of inline phpDocs with @var.

Line Length Limits

Enforces a soft character limit of 80 characters, and will throw an error if it exceeds 120.

Type Hints

Declare Strict Types

Enforces having declare(strict_types = 1) at the top of each PHP file. Should follow this example:

For more information on this declaration, read the section in the manual.

Long Type Hints

Enforces using shorthand scalar typehint variants in phpDocs: int instead of integer and bool instead of boolean. This is for consistency with native scalar typehints which also allow shorthand variants only.

Nullable Type For Null Default Value

Checks whether the nullablity ? symbol is present before each nullable and optional parameter (which are marked as = null):

Parameter Type Hint Spacing

Return Type Hint Spacing

Enforces consistent formatting of return typehints, like this:

Scalar Type Hint Missing

Ensures that all method parameters that are scalar values (string, bool, int) are using the scalar type hints when possible.

Type Hint Declaration

Type Hint Missing

Ensures that all method parameters are using type hints when possible.

Exceptions

Dead Catch

This sniffs finds unreachable catch blocks:

Reference Throwable Only

In PHP 7.0, a Throwable interface was added that allows catching and handling errors in more cases than Exception previously allowed. So if the catch statement contained Exception on PHP 5.x, it means it should probably be rewritten to reference Throwable on PHP 7.x.

Control Structures

Assignment In Condition

Disallows assignments in if, elseif and do-while loop conditions:

Assignment in while loop condition is specifically allowed because it's commonly used.

Disallow Equal Operators

Disallows using loose == and != comparison operators. Use === and !== instead, they are much more secure and predictable.

Namespaces

AlphabeticallySortedUses

Checks whether uses at the top of a file are alphabetically sorted. Follows natural sorting and takes edge cases with special symbols into consideration. The following code snippet is an example of correctly sorted uses:

Disallow Group Use

Group use declarations are ugly, make diffs ugly and this sniffs prohibits them. An example of what not to do can be found in the official RFC.

Multiple Uses Per Line

Prohibits multiple uses separated by commas:

Reference Used Names Only

Enforces to use all referenced names. What this means is, instead of using fully qualified class names, you must use them at the top of the documentat always, and then refer to them by the short names.

Unused Uses

Looks for unused imports from other namespaces.

Use Does Not Start With Backslash

Disallows leading backslash in use statement:

Use From Same Namespace

Prohibits uses from the same namespace:

Because you are already in the Foo namespace, the use statement is redundant and adds to visual debt.


All versions of standard with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
squizlabs/php_codesniffer Version ^3.5.0
slevomat/coding-standard Version ^8.0
escapestudios/symfony2-coding-standard Version ~3
phpmd/phpmd Version ^2.6
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 vicimus/standard contains the following files

Loading the files please wait ....