| Conditions | 2 |
| Paths | 2 |
| Total Lines | 39 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function createPhar() |
||
| 17 | { |
||
| 18 | $collection = $this->collection(); |
||
| 19 | |||
| 20 | $this->taskComposerInstall() |
||
| 21 | ->noDev() |
||
| 22 | ->optimizeAutoloader() |
||
| 23 | ->printed(false) |
||
| 24 | ->addToCollection($collection); |
||
| 25 | |||
| 26 | $packer = $this->taskPackPhar('package/changelog.phar') |
||
| 27 | ->compress(true) |
||
| 28 | ->stub('package/stub.php'); |
||
| 29 | |||
| 30 | $files = Finder::create() |
||
| 31 | ->ignoreVCS(true) |
||
| 32 | ->files() |
||
| 33 | ->name('*.php') |
||
| 34 | ->path('src') |
||
| 35 | ->path('vendor') |
||
| 36 | ->in(__DIR__); |
||
| 37 | |||
| 38 | foreach ($files as $file) { |
||
| 39 | $packer->addFile($file->getRelativePathname(), $file->getRealPath()); |
||
| 40 | } |
||
| 41 | |||
| 42 | @unlink('package/bin'); |
||
|
|
|||
| 43 | @unlink('package/changelog.phar'); |
||
| 44 | copy('changelog', 'package/bin'); |
||
| 45 | |||
| 46 | $packer->addFile('changelog', 'package/bin') |
||
| 47 | ->addToCollection($collection); |
||
| 48 | |||
| 49 | $this->taskComposerInstall() |
||
| 50 | ->printed(false) |
||
| 51 | ->addToCollection($collection); |
||
| 52 | |||
| 53 | $collection->run(); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
If you suppress an error, we recommend checking for the error condition explicitly: