Completed
Pull Request — 2.x (#124)
by Christian
02:37
created

PersonalTranslatable::getTranslation()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 10
loc 10
rs 9.2
cc 4
eloc 5
nc 3
nop 2
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 27 and the first side effect is on line 14.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[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 Sonata\TranslationBundle\Traits\Gedmo;
13
14
@trigger_error(
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
15
    'The '.__NAMESPACE__.'\PersonalTranslatable class is deprecated since version 2.x and will be removed in 3.0.'.
16
    'Use the '.__NAMESPACE__.'\PersonalTranslatableTrait class instead.',
17
    E_USER_DEPRECATED
18
);
19
20
/**
21
 * If you don't want to use trait, you can extend AbstractPersonalTranslatable instead.
22
 *
23
 * @author Nicolas Bastien <[email protected]>
24
 *
25
 * @deprecated since version 2.x and will be removed in 3.0
26
 */
27
trait PersonalTranslatable
28
{
29
    use PersonalTranslatableTrait;
30
}
31