| Conditions | 5 |
| Paths | 5 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | protected function findVersion() |
||
| 45 | { |
||
| 46 | if (!is_null($this->version)) { |
||
| 47 | return; |
||
| 48 | } |
||
| 49 | |||
| 50 | if ($this->filesystem->exists(base_path('composer.lock'))) { |
||
| 51 | // Get the composer.lock file |
||
| 52 | $file = json_decode( |
||
| 53 | $this->filesystem->get(base_path('composer.lock')) |
||
| 54 | ); |
||
| 55 | |||
| 56 | // Loop through all the packages and get the version of telefonica |
||
| 57 | foreach ($file->packages as $package) { |
||
| 58 | if ($package->name == 'sierratecnologia/telefonica') { |
||
| 59 | $this->version = $package->version; |
||
| 60 | break; |
||
| 61 | } |
||
| 62 | } |
||
| 63 | } |
||
| 64 | } |
||
| 65 | } |
||
| 66 |