1 | <?php |
||
19 | class ProcedureLoader implements ProcedureLoaderInterface |
||
20 | { |
||
21 | /** |
||
22 | * Procedure factory. |
||
23 | * |
||
24 | * @var \JonnyW\PhantomJs\Procedure\ProcedureFactoryInterface |
||
25 | * @access protected |
||
26 | */ |
||
27 | protected $procedureFactory; |
||
28 | |||
29 | /** |
||
30 | * File locator. |
||
31 | * |
||
32 | * @var \Symfony\Component\Config\FileLocatorInterface |
||
33 | * @access protected |
||
34 | */ |
||
35 | protected $locator; |
||
36 | |||
37 | /** |
||
38 | * Internal constructor. |
||
39 | * |
||
40 | * @access public |
||
41 | * @param \JonnyW\PhantomJs\Procedure\ProcedureFactoryInterface $procedureFactory |
||
42 | * @param \Symfony\Component\Config\FileLocatorInterface $locator |
||
43 | */ |
||
44 | 9 | public function __construct(ProcedureFactoryInterface $procedureFactory, FileLocatorInterface $locator) |
|
49 | |||
50 | /** |
||
51 | * Load procedure instance by id. |
||
52 | * |
||
53 | * @access public |
||
54 | * @param string $id |
||
55 | * @return \JonnyW\PhantomJs\Procedure\ProcedureInterface |
||
56 | */ |
||
57 | 51 | public function load($id) |
|
66 | |||
67 | /** |
||
68 | * Load procedure template by id. |
||
69 | * |
||
70 | * @access public |
||
71 | * @param string $id |
||
72 | * @param string $extension (default: 'proc') |
||
73 | * @return string |
||
74 | */ |
||
75 | 52 | public function loadTemplate($id, $extension = 'proc') |
|
81 | |||
82 | /** |
||
83 | * Load procedure file content. |
||
84 | * |
||
85 | * @access protected |
||
86 | * @param string $file |
||
87 | * @return string |
||
88 | * @throws \InvalidArgumentException |
||
89 | * @throws \JonnyW\PhantomJs\Exception\NotExistsException |
||
90 | */ |
||
91 | 52 | protected function loadFile($file) |
|
103 | } |
||
104 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.