Download the PHP package thecodingmachine/washingmachine without Composer

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

Latest Stable Version Total Downloads Latest Unstable Version License Scrutinizer Code Quality Build Status Coverage Status

Washing machine

The washing machine is a tool that helps you writing cleaner code by integrating PHPUnit with Gitlab CI.

As a result, when you perform a merge request in Gitlab, the washing machine will add meaningful information about your code quality.

Usage

Enable Gitlab CI for your project

First, you need a Gitlab project with continuous integration enabled (so a project with a .gitlab-ci.yml file).

Create a personal access token

Then, you need a Gitlab API personal access token.

Got it?

Add a secret variable

Now, we need to add this token as a "secret variable" of your project (so the CI script can modify the merge request comments):

Go to your project page in Gitlab

Settings ➔ CI/CD Pipelines ➔ Secret Variables

Configure PHPUnit to dump a "clover" test file

Let's configure PHPUnit. Go to your phpunit.xml.dist file and add:

Note: the "clover.xml" file must be written at the root of your GIT repository, so if your phpunit.xml.dist sits in a subdirectory, the correct path will be something like "../../clover.xml".

Alternatively, washing-machine also knows how to read Crap4J files. Crap4J files contain Crap score, but not code coverage score so you will get slightly less data from Crap4J. The expected file name is "crap4j.xml".

Configure Gitlab CI yml file

Now, we need to install the washingmachine, and get it to run.

.gitlab-ci.yml

Notice that we need to make sure the PHPDbg extension for PHP is installed. Also, make sure that Xdebug is NOT enabled on your Docker instance. Xdebug can also return code coverage data but is less accurate than PHPDbg, leading to wrong CRAP score results.

Supported Gitlab versions

If you seek support for older Gitlab versions, here is a list of supported Gitlab versions by washingmachine version:

Adding extra data in the comment

When the washingmachine adds a comment in your merge-request, you can ask it to add additional text. This text must be stored in a file.

You simply do:

Of course, this file might be the output of a CI tool.

The washingmachine will only display the first 50 lines of the file. If the file is longer, a link to download the file is added at the end of the comment.

You can also add several files by repeating the "-f" option:

Opening an issue

When a merge request is open, the washingmachine will post comments directly in the merge request.

If no merge request exists, the washingmachine can open an issue in your Gitlab project.

To open an issue, use the --open-issue option:

Tip: you typically want to add the --open-issue tag conditionally if a build fails. Also, the --open-issue is ignored if a merge request matches the build.

Adding comments in commits

The washingmachine can add comments directly in the commits (in addition to adding comments in the merge request).

To add comments in commits, use the --add-comments-in-commits option:

Note: this option was enabled by default in 1.x and has to be manually enabled in 2.x. For each comment, a mail is sent to the committer. This can generate a big number of mails on big commits. You have been warned :)


All versions of washingmachine with dependencies

PHP Build Version
Package Version
Requires m4tthumphrey/php-gitlab-api Version ^7.16
symfony/console Version ^3.0
mouf/picotainer Version ^1.0
symfony/filesystem Version ^3.0
czproject/git-php Version ^3.8
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 thecodingmachine/washingmachine contains the following files

Loading the files please wait ....