Download the PHP package olivertappin/phpcs-diff without Composer

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

Latest Version Build Status Quality Score GitHub issues Total Downloads

Installation

The recommended method of installing this library is via Composer.

Composer

Global Installation

Run the following command from your project root:

composer global require olivertappin/phpcs-diff

Manual Installation

Alternatively, you can manually include a dependency for olivertappin/phpcs-diff in your composer.json file. For example:

And run composer update olivertappin/phpcs-diff.

Git Clone

You can also download the phpcs-diff source and create a symlink to your /usr/bin directory:

git clone https://github.com/olivertappin/phpcs-diff.git
ln -s phpcs-diff/bin/phpcs-diff /usr/bin/phpcs-diff
cd /var/www/project
phpcs-diff master -v

Usage

Basic Usage

Where the current branch you are on is the branch you are comparing with, and develop is the base branch. In this example, phpcs-diff would run the following diff statement behind the scenes:

Please note:

After running phpcs-diff, the executable will return an output similar to the following:

Currently this is the only supported format however, I will look into adding additional formats (much like phpcs) in the near future.

Travis CI Usage

To use this as part of your CI/CD pipeline, create a script with the following:

Which will allow you to run phpcs-diff against the diff of your pull-request.

Here's a sample of how this might look within Travis CI:

Travis CI Example

About

phpcs-diff detects violations of a defined set of coding standards based on a git diff. It uses phpcs from the PHP_CodeSniffer project.

This project helps by achieving the following:

This executable works by only checking the changed lines, compared to the base branch, against all failed violations for those files, so you can be confident that any new or changed code will be compliant.

This will hopefully put you in a position where your codebase will become more compliant to that coding standard over time, and maybe you will find the resource to eventually change everything, and just run phpcs on its own.

Requirements

The latest version of phpcs-diff requires PHP version 5.6.0 or later.

This project also depends on squizlabs/php_codesniffer which is used internally to fetch the failed violations via phpcs.

Finally, the league/climate package is also installed. This is to deal with console output, but this dependency may be removed in a future release.

Contributing

See CONTRIBUTING.md for information.


All versions of phpcs-diff with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
ext-json Version *
ext-gettext Version *
squizlabs/php_codesniffer Version ^3.5.7
league/climate Version ^3.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 olivertappin/phpcs-diff contains the following files

Loading the files please wait ....