Skip to content

Commit

Permalink
change fetchPretty argument $rules to accept instance of DataRules di…
Browse files Browse the repository at this point in the history
…rectly
  • Loading branch information
BMTmohammedtaha committed Sep 27, 2023
1 parent 43c0ca4 commit 11794c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Effectra\Database;

use Effectra\Database\Data\DataOptimizer;
use Effectra\Database\Data\DataRules;
use Effectra\Database\Data\DataValidator;
use Effectra\Database\Exception\DatabaseException;
use Effectra\Database\Exception\DataValidatorException;
Expand Down Expand Up @@ -425,10 +426,10 @@ public function fetchObject(): array|null
/**
* Fetch and optimize data using custom rules.
*
* @param callable $rules A callback function to define data optimization rules.
* @param callable|DataRules $rules A callback function to define data optimization rules or instance of DataRules.
* @return array|null The optimized data based on the provided rules.
*/
public function fetchPretty(callable $rules): ?array
public function fetchPretty(callable|DataRules $rules): ?array
{
$data = $this->fetch();
if (is_array($data)) {
Expand Down

0 comments on commit 11794c6

Please sign in to comment.