1 | <?php |
||
13 | class ComposerLoader |
||
14 | { |
||
15 | /** |
||
16 | * @var object |
||
17 | */ |
||
18 | protected $json; |
||
19 | |||
20 | /** |
||
21 | * @var object |
||
22 | */ |
||
23 | protected $lock; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $basePath; |
||
29 | |||
30 | /** |
||
31 | * @param string $basePath |
||
32 | * @throws Exception |
||
33 | */ |
||
34 | public function __construct($basePath = '') |
||
41 | |||
42 | /** |
||
43 | * Load and build the composer.json and composer.lock files |
||
44 | * |
||
45 | * @return $this |
||
|
|||
46 | * @throws Exception If either file could not be loaded |
||
47 | */ |
||
48 | public function build() |
||
61 | |||
62 | /** |
||
63 | * @param object $json |
||
64 | * @return ComposerLoader |
||
65 | */ |
||
66 | public function setJson($json) |
||
71 | |||
72 | /** |
||
73 | * @return object |
||
74 | */ |
||
75 | public function getJson() |
||
79 | |||
80 | /** |
||
81 | * @param object $lock |
||
82 | * @return ComposerLoader |
||
83 | */ |
||
84 | public function setLock($lock) |
||
89 | |||
90 | /** |
||
91 | * @return object |
||
92 | */ |
||
93 | public function getLock() |
||
97 | |||
98 | /** |
||
99 | * Set the base path, if not specified the default will be `BASE_PATH` |
||
100 | * |
||
101 | * @param string $basePath |
||
102 | * @return $this |
||
103 | */ |
||
104 | public function setBasePath($basePath) |
||
109 | |||
110 | /** |
||
111 | * @return string |
||
112 | */ |
||
113 | public function getBasePath() |
||
117 | } |
||
118 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.