Download the PHP package lamansky/phpcs without Composer

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

Lamansky PHP Code Standard

Enforces a set of coding style rules on your PHP project using PHP_CodeSniffer.

Highlights

This standard is a superset of PSR-1 and adds, among other things, the following rules:

Installation and Usage

You don’t need to install PHP_CodeSniffer separately. It will be installed when you install this package.

With Composer installed on your computer and initialized for your PHP project, run this command from the terminal in your project’s root directory:

Then, in your project’s directory, add a file called phpcs.xml that contains the following XML code. (Replace YourProject with the name of your project.)

If you use the Atom text editor, install the linter and linter-phpcs packages to get on-the-fly error notices as you code.

Alternatively, you can check for coding errors by running PHP_CodeSniffer from the terminal in your project’s directory:

Customizing the Rules

This ruleset contains a few custom rules, but it mostly imports rules from its dependencies.

If you wish to exclude a rule, you can find its ref ID in the Lamansky/ruleset.xml file and then exclude it in your project’s phpcs.xml file, by putting the ID into the name attribute of an exclude tag like this:

Some of the rules have settings that you can change to tweak how the rule is evaluated. These settings are declared as public variables in the PHP classes that control the various rules. Here’s an example of setting a value for one of these settings:

Custom Rules

Most of the rules are imported from other projects, but there are a few rules that are unique to this project.

Lamansky.Functions.DeclarationSpace

Enforces a space between the function name and parameters list when declaring a function: function abc (...). This is a visual cue that helps distinguish a function declaration from a function invocation when skimming code.

Lamansky.Functions.ReturnType

This rule performs the following three functions:

If you wish to allow functions to omit a return type declaration, but wish to retain the other functionality, set the allowUndeclaredReturnType property to true.

Docblock @return tags are supported for cases in which PHP7’s return type declaration support isn’t sufficiently flexible. If your project only supports PHP8 or above, then you can use union types and the mixed keyword and probably have no need of the docblock fallback. You can disable it by setting the requireNativeDeclaration property to true.

Related


All versions of phpcs with dependencies

PHP Build Version
Package Version
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 lamansky/phpcs contains the following files

Loading the files please wait ...