• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 8733069469

18 Apr 2024 05:53AM UTC coverage: 57.183% (-0.04%) from 57.226%
8733069469

push

github

web-flow
chore: deprecate ApiPlatform\Api\FilterInterface (#6315)

* chore: deprecate ApiPlatform\Api\FilterInterface

* filter description optional

* remove property array key in description filter when is set to null

* property is not mandatory

---------

Co-authored-by: soyuka <soyuka@users.noreply.github.com>

2 of 9 new or added lines in 3 files covered. (22.22%)

60 existing lines in 16 files now uncovered.

9935 of 17374 relevant lines covered (57.18%)

48.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Api/FilterInterface.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Api;
15

NEW
16
if (interface_exists(\ApiPlatform\Metadata\FilterInterface::class)) {
×
NEW
17
    trigger_deprecation('api-platform', '3.3', sprintf('%s is deprecated in favor of %s. This class will be removed in 4.0.', FilterInterface::class, \ApiPlatform\Metadata\FilterInterface::class));
×
NEW
18
    class_alias(
×
NEW
19
        \ApiPlatform\Metadata\FilterInterface::class,
×
NEW
20
        __NAMESPACE__.'\FilterInterface'
×
NEW
21
    );
×
22

NEW
23
    if (false) { // @phpstan-ignore-line
×
24
        interface FilterInterface extends \ApiPlatform\Metadata\FilterInterface
25
        {
26
        }
27
    }
28
} else {
29
    /**
30
     * Filters applicable on a resource.
31
     *
32
     * @author Kévin Dunglas <dunglas@gmail.com>
33
     *
34
     * @deprecated
35
     */
36
    interface FilterInterface
37
    {
38
        /**
39
         * Gets the description of this filter for the given resource.
40
         *
41
         * Returns an array with the filter parameter names as keys and array with the following data as values:
42
         *   - property: the property where the filter is applied
43
         *   - type: the type of the filter
44
         *   - required: if this filter is required
45
         *   - strategy (optional): the used strategy
46
         *   - is_collection (optional): if this filter is for collection
47
         *   - swagger (optional): additional parameters for the path operation,
48
         *     e.g. 'swagger' => [
49
         *       'description' => 'My Description',
50
         *       'name' => 'My Name',
51
         *       'type' => 'integer',
52
         *     ]
53
         *   - openapi (optional): additional parameters for the path operation in the version 3 spec,
54
         *     e.g. 'openapi' => [
55
         *       'description' => 'My Description',
56
         *       'name' => 'My Name',
57
         *       'schema' => [
58
         *          'type' => 'integer',
59
         *       ]
60
         *     ]
61
         *   - schema (optional): schema definition,
62
         *     e.g. 'schema' => [
63
         *       'type' => 'string',
64
         *       'enum' => ['value_1', 'value_2'],
65
         *     ]
66
         * The description can contain additional data specific to a filter.
67
         *
68
         * @see \ApiPlatform\OpenApi\Factory\OpenApiFactory::getFiltersParameters
69
         */
70
        public function getDescription(string $resourceClass): array;
71
    }
72
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc