Skip to content

Commit

Permalink
renamed properties and updated composer
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingmedia committed Mar 29, 2016
1 parent 0b855e1 commit b33106b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -21,7 +21,6 @@
},
"require-dev": {
"phpunit/phpunit": "4.1.*",
"squizlabs/php_codesniffer": "2.*",
"cakephp/cakephp-codesniffer": "dev-master"
},
"support": {
Expand Down
19 changes: 16 additions & 3 deletions contrib/pre-commit
@@ -1,5 +1,6 @@
#!/bin/sh
FILES=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
PROJECT=`php -r "echo dirname(dirname(realpath('$0')));"`

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

if [ "$FILES" != "" ]
echo "Checking PHP Lint..."
for FILE in $SFILES
do
php -l -d display_errors=0 $PROJECT/$FILE
if [ $? != 0 ]
then
echo "Fix the error before commit."
exit 1
fi
FILES="$FILES $PROJECT/$FILE"
done

if [ "$SFILES" != "" ]
then
echo "Running PHPCS"
./vendor/bin/phpcs --standard=vendor/cakephp/cakephp-codesniffer/CakePHP --ignore=*/config/Migrations/* $SFILES
./vendor/bin/phpcs --standard=vendor/cakephp/cakephp-codesniffer/CakePHP $SFILES
if [ $? != 0 ]
then
echo "PHPCS Errors found; commit aborted."
exit 1
fi
fi
exit $?
exit $?
8 changes: 4 additions & 4 deletions src/View/Helper/OptionsAwareTrait.php
Expand Up @@ -9,7 +9,7 @@ trait OptionsAwareTrait
*
* @var array
*/
public $ButtonStyles = [
public $buttonClasses = [
'default', 'btn-default',
'success', 'btn-success',
'warning', 'btn-warning',
Expand All @@ -23,7 +23,7 @@ trait OptionsAwareTrait
*
* @var array
*/
public $ButtonStyleAliases = [
public $buttonClassAliases = [
'default' => 'btn-default',
'success' => 'btn-success',
'warning' => 'btn-warning',
Expand All @@ -40,12 +40,12 @@ trait OptionsAwareTrait
*/
public function applyButtonStyles(array $data)
{
if ($this->hasAnyClass($this->ButtonStyles, $data)) {
if ($this->hasAnyClass($this->buttonClasses, $data)) {
$data = $this->injectClasses('btn', $data);
} else {
$data = $this->injectClasses('btn btn-default', $data);
}
return $this->renameClasses($this->ButtonStyleAliases, $data);
return $this->renameClasses($this->buttonClassAliases, $data);
}

/**
Expand Down

0 comments on commit b33106b

Please sign in to comment.