Skip to content

Commit b33106b

Browse files
author
thinkingmedia
committed
renamed properties and updated composer
1 parent 0b855e1 commit b33106b

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

composer.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "4.1.*",
24-
"squizlabs/php_codesniffer": "2.*",
2524
"cakephp/cakephp-codesniffer": "dev-master"
2625
},
2726
"support": {

contrib/pre-commit

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22
FILES=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
3+
PROJECT=`php -r "echo dirname(dirname(realpath('$0')));"`
34

45
# Determine if a file list is passed
56
if [ "$#" -eq 1 ]
@@ -12,14 +13,26 @@ then
1213
fi
1314
SFILES=${SFILES:-$FILES}
1415

15-
if [ "$FILES" != "" ]
16+
echo "Checking PHP Lint..."
17+
for FILE in $SFILES
18+
do
19+
php -l -d display_errors=0 $PROJECT/$FILE
20+
if [ $? != 0 ]
21+
then
22+
echo "Fix the error before commit."
23+
exit 1
24+
fi
25+
FILES="$FILES $PROJECT/$FILE"
26+
done
27+
28+
if [ "$SFILES" != "" ]
1629
then
1730
echo "Running PHPCS"
18-
./vendor/bin/phpcs --standard=vendor/cakephp/cakephp-codesniffer/CakePHP --ignore=*/config/Migrations/* $SFILES
31+
./vendor/bin/phpcs --standard=vendor/cakephp/cakephp-codesniffer/CakePHP $SFILES
1932
if [ $? != 0 ]
2033
then
2134
echo "PHPCS Errors found; commit aborted."
2235
exit 1
2336
fi
2437
fi
25-
exit $?
38+
exit $?

src/View/Helper/OptionsAwareTrait.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait OptionsAwareTrait
99
*
1010
* @var array
1111
*/
12-
public $ButtonStyles = [
12+
public $buttonClasses = [
1313
'default', 'btn-default',
1414
'success', 'btn-success',
1515
'warning', 'btn-warning',
@@ -23,7 +23,7 @@ trait OptionsAwareTrait
2323
*
2424
* @var array
2525
*/
26-
public $ButtonStyleAliases = [
26+
public $buttonClassAliases = [
2727
'default' => 'btn-default',
2828
'success' => 'btn-success',
2929
'warning' => 'btn-warning',
@@ -40,12 +40,12 @@ trait OptionsAwareTrait
4040
*/
4141
public function applyButtonStyles(array $data)
4242
{
43-
if ($this->hasAnyClass($this->ButtonStyles, $data)) {
43+
if ($this->hasAnyClass($this->buttonClasses, $data)) {
4444
$data = $this->injectClasses('btn', $data);
4545
} else {
4646
$data = $this->injectClasses('btn btn-default', $data);
4747
}
48-
return $this->renameClasses($this->ButtonStyleAliases, $data);
48+
return $this->renameClasses($this->buttonClassAliases, $data);
4949
}
5050

5151
/**

0 commit comments

Comments
 (0)