1 | <?php |
||
9 | class Composer extends AbstractFile |
||
10 | { |
||
11 | const JSON_FILE_EXTENSION = 'json'; |
||
12 | /** |
||
13 | * Tests purpose: do not run composer update command |
||
14 | * @var bool |
||
15 | */ |
||
16 | protected $runComposerUpdate = true; |
||
17 | /** |
||
18 | * @see \WsdlToPhp\PackageGenerator\File\AbstractFile::writeFile() |
||
19 | * @return int|bool |
||
20 | */ |
||
21 | 20 | protected function writeFile() |
|
53 | /** |
||
54 | * @return Composer |
||
55 | */ |
||
56 | 20 | protected function addAutoloadToComposerJson() |
|
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | 20 | protected function getPsr4Autoload() |
|
81 | /** |
||
82 | * @return array |
||
83 | */ |
||
84 | 20 | protected function getComposerFileContent() |
|
85 | 3 | { |
|
86 | 20 | $content = array(); |
|
87 | 20 | $composerFilePath = $this->getComposerFilePath(); |
|
88 | 20 | if (!empty($composerFilePath)) { |
|
89 | 20 | $content = json_decode(file_get_contents($composerFilePath), true); |
|
90 | 15 | } |
|
91 | 20 | return $content; |
|
92 | } |
||
93 | /** |
||
94 | * @param array $content |
||
95 | * @return Composer |
||
96 | */ |
||
97 | 20 | protected function setComposerFileContent(array $content) |
|
105 | /** |
||
106 | * @param array $content |
||
107 | * @return string |
||
108 | */ |
||
109 | 20 | protected static function encodeToJson($content) |
|
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | 20 | protected function getComposerFilePath() |
|
125 | /** |
||
126 | * @param bool $runComposerUpdate |
||
127 | * @return Composer |
||
128 | */ |
||
129 | 8 | public function setRunComposerUpdate($runComposerUpdate) |
|
134 | /** |
||
135 | * @return bool |
||
136 | */ |
||
137 | 24 | public function getRunComposerUpdate() |
|
141 | /** |
||
142 | * @return string |
||
143 | */ |
||
144 | 8 | public function getFileExtension() |
|
148 | } |
||
149 |