| Conditions | 3 |
| Paths | 3 |
| Total Lines | 28 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function findTranslation(NodeInterface $nodeItem, $locale) |
||
| 11 | { |
||
| 12 | $node = $nodeItem->getNode(); |
||
|
|
|||
| 13 | |||
| 14 | $nodeSource = null; |
||
| 15 | |||
| 16 | // We are checking if the node is the translation provider or translated |
||
| 17 | // from an other node |
||
| 18 | if ($node->getTranslationSource() !== null) { |
||
| 19 | $nodeSource = $node->getTranslationSource(); |
||
| 20 | if($nodeSource->getLocale() == $locale) { |
||
| 21 | return $nodeSource; |
||
| 22 | } |
||
| 23 | } else { |
||
| 24 | $nodeSource = $node; |
||
| 25 | } |
||
| 26 | |||
| 27 | return $this->createQueryBuilder('n') |
||
| 28 | ->addSelect('n') |
||
| 29 | ->andWhere('n.translationSource = :source') |
||
| 30 | ->andWhere('n.locale = :locale') |
||
| 31 | ->setParameters([ |
||
| 32 | 'source' => $nodeSource, |
||
| 33 | 'locale' => $locale |
||
| 34 | ]) |
||
| 35 | ->getQuery() |
||
| 36 | ->getOneOrNullResult(); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.