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\Command; |
||
13 | |||
14 | use Symfony\Component\Console\Input\InputInterface; |
||
15 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
||
16 | use Translation\Bundle\Model\Configuration; |
||
17 | |||
18 | trait BundleTrait |
||
19 | { |
||
20 | private function configureBundleDirs(InputInterface $input, Configuration $config): void |
||
21 | { |
||
22 | if ($bundleName = $input->getOption('bundle')) { |
||
23 | if (0 === \strpos($bundleName, '@')) { |
||
24 | if (false === $pos = \strpos($bundleName, '/')) { |
||
25 | $bundleName = \substr($bundleName, 1); |
||
26 | } else { |
||
27 | $bundleName = \substr($bundleName, 1, $pos - 2); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | /** @var Bundle $bundle */ |
||
32 | $bundle = $this->getApplication() |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
33 | ->getKernel() |
||
34 | ->getBundle($bundleName) |
||
35 | ; |
||
36 | |||
37 | $config->reconfigureBundleDirs($bundle->getPath(), $bundle->getPath().'/Resources/translations'); |
||
38 | } |
||
39 | } |
||
40 | } |
||
41 |