-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathReplayQueryReflector.php
40 lines (30 loc) · 972 Bytes
/
ReplayQueryReflector.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace staabm\PHPStanDba\QueryReflection;
use PHPStan\Type\Type;
use staabm\PHPStanDba\Error;
final class ReplayQueryReflector implements QueryReflector
{
private ReflectionCache $reflectionCache;
public function __construct(ReflectionCache $cache)
{
$this->reflectionCache = $cache;
}
public function validateQueryString(string $queryString): ?Error
{
if (! $this->reflectionCache->hasValidationError($queryString)) {
return null;
}
return $this->reflectionCache->getValidationError($queryString);
}
public function getResultType(string $queryString, int $fetchType): ?Type
{
if (! $this->reflectionCache->hasResultType($queryString, $fetchType)) {
return null;
}
return $this->reflectionCache->getResultType($queryString, $fetchType);
}
public function setupDbaApi(?DbaApi $dbaApi): void
{
}
}