Skip to content

Commit

Permalink
Merge pull request #384 from perftools/pdo-exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc authored Dec 20, 2020
2 parents 8b7acff + 9b449b5 commit c8de77c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
13 changes: 13 additions & 0 deletions src/Xhgui/Exception/NotImplementedException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace XHGui\Exception;

use RuntimeException;

class NotImplementedException extends RuntimeException
{
public static function notImplementedPdo(string $method): self
{
throw new self(sprintf('%s not implemented for PDO', $method));
}
}
18 changes: 5 additions & 13 deletions src/Xhgui/Searcher/PdoSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace XHGui\Searcher;

use XHGui\Db\PdoRepository;
use XHGui\Exception\NotImplementedException;
use XHGui\Options\SearchOptions;
use XHGui\Profile;

Expand Down Expand Up @@ -39,12 +40,9 @@ public function latest(): Profile
]);
}

/**
* {@inheritdoc}
*/
public function query($conditions, $limit, $fields = [])
{
// TODO: Implement query() method.
throw NotImplementedException::notImplementedPdo(__METHOD__);
}

/**
Expand All @@ -70,28 +68,22 @@ public function get($id): Profile
]);
}

/**
* {@inheritdoc}
*/
public function getForUrl($url, $options, $conditions = [])
{
// TODO: Implement getForUrl() method.
throw NotImplementedException::notImplementedPdo(__METHOD__);
}

/**
* {@inheritdoc}
*/
public function getPercentileForUrl($percentile, $url, $search = [])
{
// TODO: Implement getPercentileForUrl() method.
throw NotImplementedException::notImplementedPdo(__METHOD__);
}

/**
* {@inheritdoc}
*/
public function getAvgsForUrl($url, $search = [])
{
// TODO: Implement getAvgsForUrl() method.
throw NotImplementedException::notImplementedPdo(__METHOD__);
}

/**
Expand Down

0 comments on commit c8de77c

Please sign in to comment.