MetadataInterface::getDomain()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Provider;
15
16
use Sonata\CoreBundle\Model\MetadataInterface as CoreMetadataInterface;
17
18
// NEXT_MAJOR: Remove CoreBundle dependency.
19
if (interface_exists(CoreMetadataInterface::class)) {
20
    interface InternalMetadataInterface extends CoreMetadataInterface
21
    {
22
    }
23
} else {
24
    interface InternalMetadataInterface
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type Sonata\MediaBundle\Provi...ternalMetadataInterface has been defined more than once; this definition is ignored, only the first definition in this file (L20-22) is considered.

This check looks for classes that have been defined more than once in the same file.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
25
    {
26
    }
27
}
28
29
interface MetadataInterface extends InternalMetadataInterface
30
{
31
    public function getTitle(): string;
32
33
    public function getDescription(): ?string;
34
35
    public function getImage(): ?string;
36
37
    public function getDomain(): ?string;
38
39
    /**
40
     * @return array<string, mixed>
0 ignored issues
show
Documentation introduced by
The doc-type array<string, could not be parsed: Expected ">" at position 5, but found "end of type". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
41
     */
42
    public function getOptions(): array;
43
44
    /**
45
     * @param string $name    The option key
46
     * @param mixed  $default The default value if option not found
47
     *
48
     * @return mixed
49
     */
50
    public function getOption($name, $default = null);
51
}
52