DescriptionInterface
last analyzed

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 43
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
get() 0 1 ?
has() 0 1 ?
all() 0 1 ?
set() 0 1 ?
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Description;
6
7
/**
8
 * Descriptive metadata for objects.
9
 */
10
interface DescriptionInterface
11
{
12
    /**
13
     * Return the descriptors value for the given descriptor.
14
     *
15
     * @param string $descriptor
0 ignored issues
show
Documentation introduced by
There is no parameter named $descriptor. Did you maybe mean $descriptorKey?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
16
     *
17
     * @return mixed
18
     */
19
    public function get($descriptorKey): DescriptorInterface;
20
21
    /**
22
     * Return true if the given descriptor has been set.
23
     *
24
     * @param string $descriptor
25
     *
26
     * @return bool
27
     */
28
    public function has($descriptor): bool;
29
30
    /**
31
     * Return all of the descriptors.
32
     *
33
     * @return array
34
     */
35
    public function all(): array;
36
37
    /**
38
     * Set value for descriptors descriptor.
39
     *
40
     * Note that:
41
     *
42
     * - It is possible to overwrite existing descriptors.
43
     *
44
     * - Where possible the descriptor should be the value of one of the constants
45
     *   defined in the Descriptor class.
46
     *
47
     * @param string $key
48
     * @param string $descriptor
49
     * @param int    $priority
50
     */
51
    public function set(string $key, DescriptorInterface $descriptor, int $priority = 0);
52
}
53