/** * Constructor. * * @param JsonFile $composerJson * @param bool $setDefaults */ public function __construct(JsonFile $composerJson, $setDefaults = true) { $this->composerJson = $composerJson; $this->baseDir = $composerJson->getFilesystem()->getAdapter()->getPathPrefix(); if ($setDefaults) { $this->setDefaults(); } }
/** * Constructor. * * @param JsonFile $composerJson * @param array $composerOverrides * @param bool $setDefaults */ public function __construct(JsonFile $composerJson, array $composerOverrides, $setDefaults = true) { parent::__construct($composerOverrides); /** @var Filesystem $extensionFs */ $extensionFs = $composerJson->getFilesystem(); /** @var Local $adapter */ $adapter = $extensionFs->getAdapter(); $this->set('baseDir', $adapter->getPathPrefix()); $this->set('composerJson', $composerJson); }