Browse Source

Apply new fixer.

dereuromark 9 years ago
parent
commit
972ee86e20

+ 4 - 0
composer.json

@@ -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 ./"
 	}
 }

+ 1 - 1
docs/Contributing.md

@@ -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

+ 0 - 18
sniff

@@ -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 ./
-else
-	# 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 ./
-fi

+ 0 - 2
tests/TestCase/Model/Table/TableTest.php

@@ -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 {
 	 * @return void
 	 */
 	public function testValidateTime() {
-
 		$date = '11:21:11';
 		$res = $this->Users->validateTime($date);
 		//debug($res);

+ 0 - 1
tests/TestCase/View/Helper/TextHelperTest.php

@@ -253,7 +253,6 @@ class TextHelperTest extends TestCase {
 	 * @return void
 	 */
 	public function testMinimizeUrl() {
-
 		$url = 'http://www.test.de';
 		$this->assertEquals($url, $this->Text->minimizeUrl($url, 20));