diff --git a/.hooks/pre-commit b/.hooks/pre-commit new file mode 100755 index 0000000..57648d1 --- /dev/null +++ b/.hooks/pre-commit @@ -0,0 +1,51 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# PHP CS Fix. +php-cs-fixer fix + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..33ca565 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +install-hooks: + cp -v .hooks/* .git/hooks/ diff --git a/src/Controllers/Filters/Filter.php b/src/Controllers/Filters/Filter.php index 551e47e..35ad9cf 100644 --- a/src/Controllers/Filters/Filter.php +++ b/src/Controllers/Filters/Filter.php @@ -19,8 +19,6 @@ class Filter } /** - * @param mixed $orderDirection - * * @throws FilterDecodeException * * @return Filter @@ -74,8 +72,6 @@ class Filter } /** - * @param mixed $limit - * * @return Filter */ public function setLimit($limit): self @@ -91,8 +87,6 @@ class Filter } /** - * @param mixed $offset - * * @return Filter */ public function setOffset($offset): self @@ -108,8 +102,6 @@ class Filter } /** - * @param mixed $wheres - * * @return Filter */ public function setWheres($wheres): self @@ -125,8 +117,6 @@ class Filter } /** - * @param mixed $order - * * @return Filter */ public function setOrder($order): self diff --git a/src/Redis/Redis.php b/src/Redis/Redis.php index 6485ad9..2344800 100644 --- a/src/Redis/Redis.php +++ b/src/Redis/Redis.php @@ -6,8 +6,6 @@ use Monolog\Logger; /** * A wrapper around \Redis for my own sanity. - * - * @package Benzine\Redis */ class Redis { @@ -35,7 +33,7 @@ class Redis { $this->runBeforeRedisCommand(); - if(method_exists($this->redis, $name)){ + if (method_exists($this->redis, $name)) { return call_user_func_array([$this->redis, $name], $arguments); } @@ -50,21 +48,16 @@ class Redis } } - /** - * @return \Redis - */ public function getUnderlyingRedis(): \Redis { return $this->redis; } - /** - * @return Logger - */ public function getLogger(): Logger { return $this->logger; } + public function isAvailable(): bool { try { diff --git a/src/Router/Route.php b/src/Router/Route.php index 35a74a3..5d188da 100644 --- a/src/Router/Route.php +++ b/src/Router/Route.php @@ -117,8 +117,6 @@ class Route } /** - * @param mixed $propertyOptions - * * @return Route */ public function setPropertyOptions($propertyOptions) @@ -330,8 +328,6 @@ class Route } /** - * @param mixed $exampleEntity - * * @return Route */ public function setExampleEntity($exampleEntity) @@ -347,8 +343,6 @@ class Route } /** - * @param mixed $exampleEntityFinderFunction - * * @return Route */ public function setExampleEntityFinderFunction($exampleEntityFinderFunction)