Code-checker: "./../PHPCSAliases.php" does not exist

Re: Code-checker: "./../PHPCSAliases.php" does not exist

by Craig Jamieson -
Number of replies: 0

I ran into the same issues today, but I've got it up and running again.  It looks like phpcs has a fair number of changes in the 3.x version , so you have to make sure your phpcs version is a 2.x version.  I would check that first and see what you're on.

I used composer to install an 2.x version (composer global require "squizlabs/php_codesniffer=2.*")

After that, you only need to grab the missing file (PHPCSAliases.php), which you can grab from the PHPCompatibility repo here: https://github.com/PHPCompatibility/PHPCompatibility/blob/master/PHPCSAliases.php

The current one seems to be working well for me so I didn't check for a specific branch.  Throw that in the "Standards" folder in your phpcs install (where you moved the "moodle" and "PHPCompatibility" folders).

There is a note in the readme_moodle.txt file about backporting a fix, although I haven't done that yet.  There are a couple of cases that should fail, but they currently do not.  You can read more at: https://github.com/squizlabs/PHP_CodeSniffer/issues/2009  This is fixed in the 3.3 version, which the moodle plugin will eventually be updated to work with.

A lot of the code included with the plugin is code from other vendors.  They simply follow a different standard, which is why you see the errors.  It would be very cumbersome to maintain if the code were re-written for the moodle phpcs standard.

Average of ratings: Useful (6)