1 | <?php |
||
9 | class ComposerJson { |
||
10 | |||
11 | /** |
||
12 | * @param string $location |
||
13 | */ |
||
14 | public function __construct( $location ) { |
||
17 | |||
18 | /** |
||
19 | * Dependencies as specified by composer.json |
||
20 | * |
||
21 | * @return array |
||
22 | */ |
||
23 | public function getRequiredDependencies() { |
||
35 | |||
36 | /** |
||
37 | * Strip a leading "v" from the version name |
||
38 | * |
||
39 | * @param string $version |
||
40 | * @return string |
||
41 | */ |
||
42 | public static function normalizeVersion( $version ) { |
||
50 | |||
51 | } |
||
52 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: