Skip to content

Commit

Permalink
Reverse logic to make things a tiny bit clear-er
Browse files Browse the repository at this point in the history
  • Loading branch information
jspeedz committed Mar 5, 2019
1 parent f5813f0 commit 957e598
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Pooper/QueryDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class QueryDumper {
* @param string $query The query
* @param array $params The parameters to be inserted into the placeholders in the query
* @param int[] $types The types the parameters are in
* @param bool $output Returns the result instead of dumping if true
* @param bool $return Returns the result instead of dumping if true
*
* @return null|string Depends on $output
* @return null|string Depends on $return
*
* @throws InvalidParameterCountException
*/
public static function dump(string $query, array $params = [], array $types = [], bool $output = false): ?string {
public static function dump(string $query, array $params = [], array $types = [], bool $return = false): ?string {
if(count($params) > 0) {
if(count($types) !== 0 && count($types) !== count($params)) {
throw new InvalidParameterCountException('Param count did not match type count');
Expand Down Expand Up @@ -61,7 +61,7 @@ public static function dump(string $query, array $params = [], array $types = []
}
}

if($output) {
if($return) {
return $query;
}

Expand Down

0 comments on commit 957e598

Please sign in to comment.