Skip to content

Commit

Permalink
lint minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bakeiro committed May 23, 2020
1 parent 717d494 commit 8166b17
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"@solve-lint"
],
"lint": [
"phpcs --encoding=utf-8 -n -s --colors --standard=PSR1,PSR2,PEAR --exclude=PEAR.Commenting.ClassComment,PEAR.Commenting.FileComment --ignore=src/view/*,system/composer/*,system/writable/*,system/tests/* ./ "
"phpcs --encoding=utf-8 -n -s --colors --standard=PSR1,PSR2,PEAR --exclude=PEAR.Commenting.ClassComment,PEAR.Commenting.FileComment,PEAR.Commenting.FunctionComment --ignore=src/view/*,system/composer/*,system/writable/*,system/tests/* ./ "
],
"fix-lint": [
"phpcbf --encoding=utf-8 -n --colors --standard=PSR1,PSR2,PEAR --exclude=PEAR.Commenting.ClassComment,PEAR.Commenting.FileComment --ignore=src/view/*,system/composer/*,system/writable/*,system/tests/* ./"
],
"strict-lint": [
"phpcs --encoding=utf-8 -n -s --colors --standard=PSR1,PSR2,PEAR --exclude=PEAR.Commenting.ClassComment,PEAR.Commenting.FileComment,PEAR.Commenting.FunctionComment --ignore=src/view/*,system/composer/*,system/writable/*,system/tests/* ./ "
"phpcs --encoding=utf-8 -n -s --colors --standard=PSR1,PSR2,PEAR --exclude=PEAR.Commenting.ClassComment,PEAR.Commenting.FileComment --ignore=src/view/*,system/composer/*,system/writable/*,system/tests/* ./ "
],
"test-environment-compatibility": [
"\"./system/composer/vendor/bin/phpunit\" --do-not-cache-result --filter environmentTest ./system/tests/environmentTest.php"
Expand Down
9 changes: 5 additions & 4 deletions src/model/product/productModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
/**
* Sample of how a model class is
*/



class ProductModel
{

/**
* Return all products
*
* @return Array
*/
public function getAllProducts()
{
$prods = Database::query("SELECT * FROM `product`");
Expand Down
6 changes: 2 additions & 4 deletions system/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`

echo $PROJECT
echo $STAGED_FILES_CMD

# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
Expand Down Expand Up @@ -33,7 +30,8 @@ if [ "$FILES" != "" ]
then
echo "Running Code Sniffer..."
echo $FILES
./vendor/bin/phpcbf --standard=PSR1,PSR2,PEAR --exclude=PEAR.Commenting.ClassComment,PEAR.Commenting.FileComment --encoding=utf-8 -n --colors $FILES --ignore=src/view/*,system/composer/*,system/writable/*,system/tests/* ./
composer run-script strict-lint
# ../system/composer/vendor/bin/phpcbf --standard=PSR1,PSR2,PEAR --exclude=PEAR.Commenting.ClassComment,PEAR.Commenting.FileComment --encoding=utf-8 -n --colors $FILES --ignore=src/view/*,system/composer/*,system/writable/*,system/tests/* ./
fi

exit $?

0 comments on commit 8166b17

Please sign in to comment.