Skip to content

Commit d3d9d2d

Browse files
committed
Revue de code.
1 parent 4ff3ff2 commit d3d9d2d

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/* friendsofphp/php-cs-fixer: 1.13.* */
44
$finder = PhpCsFixer\Finder::create()
5+
->exclude('build')
56
->in(__DIR__);
67

78
return PhpCsFixer\Config::create()

src/Request.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,17 @@ public function __toString()
147147
* @param string $name Nom de la méthode appelée.
148148
* @param array $arg Pararètre de la méthode.
149149
*
150+
* @throws \BadMethodCallException
150151
* @return $this
151-
* @throws BadMethodCallException
152152
*/
153-
public function __call( $name, $arg )
153+
public function __call($name, $arg)
154154
{
155-
if( method_exists($this->where, $name) ) {
156-
throw new BadMethodCallException("The $name method not exist");
157-
}
158-
if( $this->where === null ) {
155+
if ($this->where === null) {
159156
$this->where = new Where();
160157
}
158+
if (!method_exists($this->where, $name)) {
159+
throw new \BadMethodCallException("The $name method not exist");
160+
}
161161

162162
call_user_func_array([ $this->where, $name ], $arg);
163163

@@ -440,7 +440,7 @@ protected function executeJoins($type, $table, Where $where)
440440
* @param array $data Données à trier.
441441
* @param array $orderBy Clés sur lesquelles le trie s'exécute.
442442
*
443-
* @return array les données triées
443+
* @return void
444444
*/
445445
protected function executeOrderBy(array &$data, array $orderBy)
446446
{

src/WhereHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function where(
8282

8383
return $this;
8484
}
85-
if ($value === null) {
85+
if ($operator !== null && $value === null) {
8686
list($value, $operator) = [ $operator, '=' ];
8787
}
8888

@@ -467,6 +467,8 @@ protected function whereCallback(\Closure $column, $bool = self::EXP_AND, $not =
467467
* @param string $operator
468468
* @param string $value
469469
* @param string $bool
470+
*
471+
* @return void
470472
*/
471473
protected function like($column, $operator, $value, $bool = self::EXP_AND)
472474
{

0 commit comments

Comments
 (0)