| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | private function isPluginAvailable() |
||
| 45 | { |
||
| 46 | $composer = $this->composerContext->getLocalComposer(); |
||
| 47 | |||
| 48 | $packageResolver = new \Vaimo\ComposerPatches\Composer\Plugin\PackageResolver( |
||
| 49 | array($composer->getPackage()) |
||
| 50 | ); |
||
| 51 | |||
| 52 | $repository = $composer->getRepositoryManager()->getLocalRepository(); |
||
| 53 | |||
| 54 | try { |
||
| 55 | $packageResolver->resolveForNamespace($repository->getCanonicalPackages(), __NAMESPACE__); |
||
| 56 | } catch (\Vaimo\ComposerPatches\Exceptions\PackageResolverException $exception) { |
||
| 57 | return false; |
||
| 58 | } |
||
| 59 | |||
| 60 | return true; |
||
| 61 | } |
||
| 63 |