FoolCode /
SphinxQL-Query-Builder
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Foolz\SphinxQL\Drivers\Mysqli; |
||||
| 4 | |||||
| 5 | use Foolz\SphinxQL\Drivers\MultiResultSetAdapterInterface; |
||||
| 6 | use Foolz\SphinxQL\Drivers\ResultSet; |
||||
| 7 | use Foolz\SphinxQL\Exception\ConnectionException; |
||||
| 8 | |||||
| 9 | class MultiResultSetAdapter implements MultiResultSetAdapterInterface |
||||
| 10 | { |
||||
| 11 | /** |
||||
| 12 | * @var bool |
||||
| 13 | */ |
||||
| 14 | protected $valid = true; |
||||
| 15 | |||||
| 16 | /** |
||||
| 17 | * @var Connection |
||||
| 18 | */ |
||||
| 19 | protected $connection; |
||||
| 20 | |||||
| 21 | /** |
||||
| 22 | * @param Connection $connection |
||||
| 23 | */ |
||||
| 24 | public function __construct(Connection $connection) |
||||
| 25 | { |
||||
| 26 | $this->connection = $connection; |
||||
| 27 | } |
||||
| 28 | |||||
| 29 | /** |
||||
| 30 | * @inheritdoc |
||||
| 31 | * @throws ConnectionException |
||||
| 32 | */ |
||||
| 33 | public function getNext() |
||||
| 34 | { |
||||
| 35 | if ( |
||||
| 36 | !$this->valid() || |
||||
| 37 | !$this->connection->getConnection()->more_results() |
||||
|
0 ignored issues
–
show
|
|||||
| 38 | ) { |
||||
| 39 | $this->valid = false; |
||||
| 40 | } else { |
||||
| 41 | $this->connection->getConnection()->next_result(); |
||||
|
0 ignored issues
–
show
The method
next_result() does not exist on PDO.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||
| 42 | } |
||||
| 43 | } |
||||
| 44 | |||||
| 45 | /** |
||||
| 46 | * @inheritdoc |
||||
| 47 | * @throws ConnectionException |
||||
| 48 | */ |
||||
| 49 | public function current() |
||||
| 50 | { |
||||
| 51 | $adapter = new ResultSetAdapter($this->connection, $this->connection->getConnection()->store_result()); |
||||
|
0 ignored issues
–
show
The method
store_result() does not exist on PDO.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||
| 52 | return new ResultSet($adapter); |
||||
| 53 | } |
||||
| 54 | |||||
| 55 | /** |
||||
| 56 | * @inheritdoc |
||||
| 57 | * @throws ConnectionException |
||||
| 58 | */ |
||||
| 59 | public function valid() |
||||
| 60 | { |
||||
| 61 | return $this->connection->getConnection()->errno == 0 && $this->valid; |
||||
|
0 ignored issues
–
show
|
|||||
| 62 | } |
||||
| 63 | } |
||||
| 64 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.