| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function __construct(TranslatorInterface $translator, string $cacheDir, string $logsDir, string $rootDir = null) |
||
| 27 | { |
||
| 28 | parent::__construct($translator->trans('sylius.installer.filesystem.header', [])); |
||
| 29 | |||
| 30 | if (func_num_args() >= 4) { |
||
| 31 | @trigger_error('Passing root directory to "%s" constructor as a second argument is deprecated since 1.2 and this argument will be removed in 2.0.', E_USER_DEPRECATED); |
||
| 32 | |||
| 33 | [$rootDir, $cacheDir, $logsDir] = [$cacheDir, $logsDir, $rootDir]; |
||
| 34 | } |
||
| 35 | |||
| 36 | $this |
||
| 37 | ->add(new Requirement( |
||
| 38 | $translator->trans('sylius.installer.filesystem.cache.header', []), |
||
| 39 | is_writable($cacheDir), |
||
| 40 | true, |
||
| 41 | $translator->trans('sylius.installer.filesystem.cache.help', ['%path%' => $cacheDir]) |
||
| 42 | )) |
||
| 43 | ->add(new Requirement( |
||
| 44 | $translator->trans('sylius.installer.filesystem.logs.header', []), |
||
| 45 | is_writable($logsDir), |
||
| 46 | true, |
||
| 47 | $translator->trans('sylius.installer.filesystem.logs.help', ['%path%' => $logsDir]) |
||
| 48 | )) |
||
| 49 | ; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.