Download the PHP package loadsys/loadsys_codesniffer without Composer

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

Loadsys Code Sniffer

Latest Version Build Status Total Downloads

This package works with phpcs and checks code against the coding standards used by Loadsys. It is based upon the CakePHP coding standards with some customizations specific to the Loadsys internal standards and preference.

:warning: This code is designed to target Cake 3.x projects, for Cake 2.x projects, use one of the latests 2.x releases of this project.

Notable Style Differences

This ruleset is basically PSR-2 with the following diferences:

Other items that are inherited but worth pointing out anyway:

Installation

Install these code sniffs via composer in your project:

The second command lets phpcs know where to find your the Loadsys and CakePHP sniffs. Ensure that you do not overwrite any existing installed_paths value if you have other custom PHPCS sniff locations.

Usage

Once installed_paths is configured, you can run phpcs using:

Warning when these sniffs are installed with composer, ensure that you have configured the CodeSniffer installed_paths setting set for both the CakePHP Standard and the Loadsys Standard.

A typical option is to supress warnings when running on Travis. To do so, use the -n CLI option.

Contributing

Note: phpunit will fail to run the tests when the root directory contains a dash. (Hence loadsys_codesniffer instead of loadsys-codesniffer).

Releasing Loadsys Code Sniffer

Testing

Tests are run on the coding standard using sample files that are designed to either pass the full sniff suite without generating any errors or warnings, or that are intended to fail and trigger specific sniff errors/warnings.

These sample files live in the snifftests/files/ directory and can be grouped in any manner that makes sense. Our choice is to group tests into two imperative folders, must/ and must_not/. File names start with the topic being tested, such as array_ or braces_ or indent_ and continue with more specificity. For example:

Tests can affirm either that a coding mistake is properly caught by the sniffer, or that valid coding practices are not incorrectly caught by the sniffer.

Reference sniffs

Since we inherit from these rulesets, it's nice to have links to them handy:

Running codesniffs on the Loadsys-defined Sniff classes

vendor/bin/phpcs -ps --standard=snifftests/sniff_class_rules.xml Loadsys/

This custom ruleset relaxes a few of our normal rules to accommodate shortcomings in PHPCS's requirements for Sniff classes themselves (such as not supporting namepspaces or CamelCased class names.) The ruleset will run the entire Loadsys standard with those rules excluded.

Reviewing the rules included in the standard

vendor/bin/phpcs -e --standard=./Loadsys Loadsys

This list can be used to help locate duplicated rules defined directly in the Loadsys/ruleset.xml.

Running tests

Indicating expected sniff failures

All files inside of the snifftests/files/ directory that do not end in pass.php are expected to fail at least one code sniff. The names of the sniffs that are expected to fail must be annotated on the first line of the file, like so:

The test suite will throw an assertion failure for any files lacking *pass.php that also fail to define the expected sniff failures as demonstrated above.

Every attempt should be made to restrict each sample file that is expected to fail to triggering only a single sniff. (A current shortcoming of the testing approach is that we can verify that the named sniffs fail, but can not verify that no other sniffs were also thrown in the process.)

Indicating expected sniff passes

Files suffixed with pass.php will be expected to pass all sniffs. They must not define any expected sniff names as failures on the first line of their contents using the <?php //~ syntax, otherwise a PHPUnit assertion will be thrown and halt the entire test suite.

Positive verification tests are especially important when making modifications to the coding standard's ruleset. This prevents accidentally starting to disallow something that was previously acceptable by having an example of that "acceptable" behavior verified.

Manually reviewing tests/rules

To test a single sample file, run:

To confirm that all test files that should pass do pass, run:

To confirm that all files that should fail, do fail, run:

Every file listed in should throw at least one warning or error each. (Pay attention to any .s in the initial progress indicator since that indicates a fully-passing file that should be failing something!) The errors listed will need to be verified by hand that they correctly match the errors that particular file should be triggering.

License

MIT

Copyright

Loadsys Web Strategies 2016


All versions of loadsys_codesniffer with dependencies

PHP Build Version
Package Version
Requires squizlabs/php_codesniffer Version 2.*
cakephp/cakephp-codesniffer Version ^2.0.4
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 loadsys/loadsys_codesniffer contains the following files

Loading the files please wait ....