Issues (158)

src/DataLoader/DataLoaderInterface.php (2 issues)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource\DataLoader;
6
7
use BEAR\Resource\Types;
8
9
/**
10
 * Interface for data loaders that batch multiple resource requests
11
 *
12
 * Implementations receive query parameters and return database rows.
13
 * The framework handles URI parsing and result distribution.
14
 *
15
 * $queries is passed as an array of associative arrays (not just values)
16
 * to support multiple key parameters:
17
 *
18
 * Single key: app://self/meta{?post_id}
19
 * ```php
20
 * $postIds = array_column($queries, 'post_id');
21
 * ```
22
 *
23
 * Multiple keys: app://self/translation?post_id={post_id}&locale={locale}
24
 * ```php
25
 * foreach ($queries as $q) {
26
 *     // Use both $q['post_id'] and $q['locale']
27
 * }
28
 * ```
29
 *
30
 * @psalm-import-type DataLoaderQueries from Types
31
 * @psalm-import-type DataLoaderRows from Types
32
 */
33
interface DataLoaderInterface
34
{
35
    /**
36
     * @param DataLoaderQueries $queries Query parameters extracted from URIs
0 ignored issues
show
The type BEAR\Resource\DataLoader\DataLoaderQueries was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
37
     *
38
     * @return DataLoaderRows Rows that contain the query key columns for matching
0 ignored issues
show
The type BEAR\Resource\DataLoader\DataLoaderRows was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
39
     */
40
    public function __invoke(array $queries): array;
41
}
42