We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class EntityConverter extends Converter |
||
| 12 | { |
||
| 13 | private EntityManagerInterface $em; |
||
| 14 | |||
| 15 | public function __construct(?EntityManager $entityManager) |
||
| 16 | { |
||
| 17 | if (null === $entityManager) { |
||
| 18 | throw new ServiceNotFoundException( |
||
| 19 | "Couldn't convert value, because no EntityManager service is found. |
||
| 20 | To use the 'EntityConverter' you need to install Doctrine ORM first. |
||
| 21 | See: 'https://symfony.com/doc/current/doctrine.html'" |
||
| 22 | ); |
||
| 23 | } |
||
| 24 | |||
| 25 | $this->em = $entityManager; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param $value |
||
| 30 | * @param Entity $entityAnnotation |
||
| 31 | * |
||
| 32 | * @return object|null |
||
| 33 | */ |
||
| 34 | function convert($value, $entityAnnotation) |
||
| 37 | } |
||
| 38 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.