| @@ 69-81 (lines=13) @@ | ||
| 66 | * @return Object |
|
| 67 | * @throws Exception |
|
| 68 | */ |
|
| 69 | protected function getStructure() |
|
| 70 | { |
|
| 71 | if (!$this->structure) { |
|
| 72 | if (!is_file($this->getComposerPath())) { |
|
| 73 | throw new Exception('composer.lock does not exist'); |
|
| 74 | } |
|
| 75 | $this->structure = json_decode(file_get_contents($this->getComposerPath())); |
|
| 76 | if (!$this->structure) { |
|
| 77 | throw new Exception('composer.lock invalid structure'); |
|
| 78 | } |
|
| 79 | } |
|
| 80 | return $this->structure; |
|
| 81 | } |
|
| 82 | } |
|
| 83 | ||
| @@ 105-117 (lines=13) @@ | ||
| 102 | * Get composer file structure |
|
| 103 | * @return Object |
|
| 104 | */ |
|
| 105 | protected function getStructure() |
|
| 106 | { |
|
| 107 | if (!$this->structure) { |
|
| 108 | if (!is_file($this->getComposerPath())) { |
|
| 109 | throw new \LogicException('composer.json does not exist'); |
|
| 110 | } |
|
| 111 | $this->structure = json_decode(file_get_contents($this->getComposerPath())); |
|
| 112 | if (!$this->structure) { |
|
| 113 | throw new \LogicException('composer.json invalid structure'); |
|
| 114 | } |
|
| 115 | } |
|
| 116 | return $this->structure; |
|
| 117 | } |
|
| 118 | } |
|
| 119 | ||