-
-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
I ran into a PHPStan error on the following code: https://phpstan.org/r/0a244b72-7cea-4746-8d69-26b17871fd62
After installing this package, I was still getting the same error, but noticed the cache file also wasn't being generated, so I figured something must not be getting recognized. After poking around a little bit, I changed my fetchData
method to use the connection to immediately fetch:
private function fetchData(AccessTokenEntityInterface $accessTokenEntity): array
{
$data = $this->connection->fetchAssociative(
<<<SQL
SELECT
u.id,
u.name,
u.email,
u.timezone,
u.language,
u.company_id
FROM user u
WHERE u.email = :email
SQL,
[
'email' => '[email protected]', // in actual code, this is calling a method on $accessTokenEntity
]
);
if (! $data) {
throw new UserNotFoundException();
}
return $data;
}
Now I did notice the cache file got generated, but I'm still getting the original error.
<?php return array (
'schemaVersion' => 'v9-put-null-when-valid',
'schemaHash' => '56eb246db59f605bc0f4aa5c9242e8bb',
'records' =>
array (
'SELECT
u.id,
u.name,
u.email,
u.timezone,
u.language,
u.company_id
FROM user u
WHERE u.email = \'1970-01-01\'' =>
array (
'error' => NULL,
),
),
'runtimeConfig' =>
array (
'errorMode' => 'default',
'debugMode' => false,
'stringifyTypes' => false,
),
);
I'm guessing this package does not get triggered when fetching from the Statement result?
Secondly, am I doing something wrong that my DB isn't getting properly analyzed? I find it a little strange that a date is being used as the example email.
noemi-salaun
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested