Completed
Push — master ( 8bad7f...f84ff2 )
by Olivier
02:14 queued 11s
created

TranslatorInterface

Size/Duplication

Total Lines 3
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 0
cp 0
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
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
namespace Translation\Bundle\Translator;
13
14
use Symfony\Component\Translation\TranslatorBagInterface;
15
use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
16
use Symfony\Contracts\Translation\LocaleAwareInterface;
17
use Symfony\Contracts\Translation\TranslatorInterface as NewTranslatorInterface;
18
19
/*
20
 * This interface is here to allow us to support both sf 3.x with
21
 * LegacyTranslatorInterface & sf 5.x where this interface have been replaced
22
 * by NewLocalAwareInterface.
23
 *
24
 * When sf 3.4 won't be supported anymore, this interface will become useless.
25
 */
26
27 1
if (\interface_exists(NewTranslatorInterface::class)) {
28
    interface TranslatorInterface extends NewTranslatorInterface, LocaleAwareInterface, TranslatorBagInterface
29
    {
30
    }
31
} else {
32
    interface TranslatorInterface extends LegacyTranslatorInterface, TranslatorBagInterface
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type Translation\Bundle\Translator\TranslatorInterface has been defined more than once; this definition is ignored, only the first definition in this file (L28-30) 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...
Deprecated Code introduced by
The interface Symfony\Component\Translation\TranslatorInterface has been deprecated with message: since Symfony 4.2, use Symfony\Contracts\Translation\TranslatorInterface instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
33
    {
34
    }
35
}
36