| Conditions | 5 | 
| Paths | 5 | 
| Total Lines | 20 | 
| Code Lines | 14 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 3 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 15 | private static function installBinaries(CommandEvent $event) | ||
| 16 |     { | ||
| 17 |         if (!is_dir('bin')) { | ||
| 18 |             $event->getIO()->write(sprintf('The "bin" directory was not found in %s.', getcwd())); | ||
| 19 | return; | ||
| 20 | } | ||
| 21 |         foreach (glob('app/Resources/bin/*') as $binary) { | ||
| 22 | $src = '../app/Resources/bin/' . basename($binary); | ||
| 23 | $dst = $dst = 'bin/' . basename($binary); | ||
| 24 | @unlink($dst); | ||
|  | |||
| 25 |             if (@symlink($src, $dst) === false) { | ||
| 26 |                 if (!file_exists($dst)) { | ||
| 27 |                     $event->getIO()->write(sprintf('Failed to symlink %s from %s.', $src, $dst)); | ||
| 28 | return; | ||
| 29 | } | ||
| 30 | continue; | ||
| 31 | } | ||
| 32 |             $event->getIO()->write(sprintf('Installed binary %s.', $dst)); | ||
| 33 | } | ||
| 34 | } | ||
| 35 | |||
| 51 | 
If you suppress an error, we recommend checking for the error condition explicitly: