Skip to content

Commit

Permalink
Merge pull request #2 from CottaCush/features/base-rework
Browse files Browse the repository at this point in the history
Cleanups
  • Loading branch information
taiwo-ladipo authored Sep 25, 2018
2 parents f9b5eca + 0cbd93c commit eb0ba29
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/generators/sql/SQLGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* Class SQLGenerator
* @package CottaCush\Cricket\Report\Generators
* @package CottaCush\Cricket\Generators\SQL
* @author Taiwo Ladipo <taiwo.ladipo@cottacush.com>
* @author Olawale Lawal <wale@cottacush.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/generators/sql/SQLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/**
* Class SQLQueryBuilder
* @package CottaCush\Cricket\Report\Generators
* @package CottaCush\Cricket\Generators\SQL
* @author Taiwo Ladipo <taiwo.ladipo@cottacush.com>
* @author Olawale Lawal <wale@cottacush.com>
*/
Expand Down
8 changes: 5 additions & 3 deletions src/generators/sql/SQLQueryBuilderParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ class SQLQueryBuilderParser
/**
* @author Olawale Lawal <wale@cottacush.com>
* @param CricketQueryableInterface $report
* @param array $data
* @param array $placeholderValues
* @param null $db
* @param string $function
* @throws \CottaCush\Cricket\Report\Exceptions\SQLReportGenerationException
* @return array
* @throws \CottaCush\Cricket\Exceptions\SQLQueryGenerationException
*/
public function parse(
CricketQueryableInterface $report,
&$data = [],
$placeholderValues = [],
$db = null,
$function = SQLGenerator::QUERY_ALL
Expand All @@ -36,6 +35,7 @@ public function parse(
$this->hasInputPlaceholders = $queryObj->hasInputPlaceholders();

$this->query = $queryObj->getQuery();
$data = [];

if (!$this->hasInputPlaceholders) { // Report has only session placeholders or none
$shouldReplacePlaceholders = true;
Expand All @@ -61,6 +61,8 @@ public function parse(
$data = $generator->generateResult($function);
}
}

return $data;
}

public function arePlaceholdersReplaced()
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/CricketQueryableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/**
* Interface CricketQueryableInterface
* @package CottaCush\Cricket\Interfaces
* @property string type
*/
interface CricketQueryableInterface
{
Expand Down

0 comments on commit eb0ba29

Please sign in to comment.