@@ -39,5 +39,9 @@
"support":{
"source": "https://github.com/dereuromark/cakephp-tools",
"issues": "https://github.com/dereuromark/cakephp-tools/issues"
+ },
+ "scripts": {
+ "cs-check": "phpcs -p --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/vendor/,/tmp/,/logs/,/tests/test_files/ --extensions=php ./",
+ "cs-fix": "phpcbf -f --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/vendor/,/tmp/,/logs/,/tests/test_files --extensions=php ./"
}
@@ -13,7 +13,7 @@ I am looking forward to your contributions. There are several ways to help out:
* Write patches for bugs/features, preferably with testcases included
There are a few guidelines that I need contributors to follow:
-* Coding standards (`./sniff` to check and `./sniff -f` to fix)
+* Coding standards (`composer cs-check` to check and `composer cs-fix` to fix)
* Passing tests (you can enable travis to assert your changes pass) for Windows and Unix (`php phpunit.phar`)
# Additional Resources
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# Make sure this file is executable
-# chmod +x sniff
-if [ `echo "$@" | grep '\-\-fix'` ] || [ `echo "$@" | grep '\-f'` ]; then
- FIX=1
-else
- FIX=0
-fi
-if [ "$FIX" = 1 ]; then
- # Sniff and fix
- vendor/bin/phpcbf --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=cakephp-tools/vendor/,tmp/,logs/,tests/test_files/ --extensions=php -v -f ./
- # Sniff only
- vendor/bin/phpcs --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=cakephp-tools/vendor/,tmp/,logs/,tests/test_files/ --extensions=php -v ./
@@ -288,7 +288,6 @@ class TableTest extends TestCase {
* @return void
*/
public function testValidateDatetime() {
$date = new Time('2010-01-22 11:11:11');
$res = $this->Users->validateDatetime($date);
//debug($res);
@@ -382,7 +381,6 @@ class TableTest extends TestCase {
public function testValidateTime() {
$date = '11:21:11';
$res = $this->Users->validateTime($date);
@@ -253,7 +253,6 @@ class TextHelperTest extends TestCase {
public function testMinimizeUrl() {
$url = 'http://www.test.de';
$this->assertEquals($url, $this->Text->minimizeUrl($url, 20));