1 | <?php namespace Modules\Translation\Repositories\Cache; |
||
7 | class CacheTranslationDecorator extends BaseCacheDecorator implements TranslationRepository |
||
8 | { |
||
9 | public function __construct(TranslationRepository $recipe) |
||
10 | { |
||
11 | parent::__construct(); |
||
12 | $this->entityName = 'translation.translations'; |
||
13 | $this->repository = $recipe; |
||
14 | } |
||
15 | |||
16 | /** |
||
17 | * @param string $key |
||
18 | * @param string $locale |
||
19 | * @return string |
||
20 | */ |
||
21 | public function findByKeyAndLocale($key, $locale = null) |
||
35 | |||
36 | public function allFormatted() |
||
46 | |||
47 | public function saveTranslationForLocaleAndKey($locale, $key, $value) |
||
53 | |||
54 | public function findTranslationByKey($key) |
||
66 | |||
67 | /** |
||
68 | * Update the given translation key with the given data |
||
69 | * @param string $key |
||
70 | * @param array $data |
||
71 | * @return mixed |
||
72 | */ |
||
73 | public function updateFromImport($key, array $data) |
||
79 | |||
80 | /** |
||
81 | * Set the given value on the given TranslationTranslation |
||
82 | * @param TranslationTranslation $translationTranslation |
||
83 | * @param string $value |
||
84 | * @return void |
||
85 | */ |
||
86 | public function updateTranslationToValue(TranslationTranslation $translationTranslation, $value) |
||
92 | |||
93 | /** |
||
94 | * Clean a Cache Key so it is safe for use |
||
95 | * @param string $key Potentially unsafe key |
||
96 | * @return string |
||
97 | */ |
||
98 | protected function cleanKey($key) |
||
102 | } |
||
103 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.