1111use Winter \Packager \Package \Constraint ;
1212use Winter \Packager \Package \DetailedPackage ;
1313use Winter \Packager \Package \DetailedVersionedPackage ;
14+ use Winter \Packager \Package \InstalledFile ;
1415use Winter \Packager \Package \LockFile ;
1516use Winter \Packager \Package \Package ;
1617use Winter \Packager \Package \Packagist ;
2728 * @method \Winter\Packager\Commands\Install i(bool $includeDev = true, bool $lockFileOnly = false, bool $ignorePlatformReqs = false, string $installPreference = 'none', bool $ignoreScripts = false, bool $dryRun = false) Install command
2829 * @method \Winter\Packager\Commands\Install install(bool $includeDev = true, bool $lockFileOnly = false, bool $ignorePlatformReqs = false, string $installPreference = 'none', bool $ignoreScripts = false, bool $dryRun = false) Install command
2930 * @method \Winter\Packager\Commands\Remove remove(string $package, bool $dryRun = false, bool $dev = false) Remove command
30- * @method \Winter\Packager\Commands\RequireCommand require(string $package, bool $dryRun = false, bool $dev = false) Require command
31+ * @method \Winter\Packager\Commands\RequireCommand require(string $package, bool $dryRun = false, bool $dev = false, bool $noUpdate = false, bool $noScripts = false ) Require command
3132 * @method \Winter\Packager\Package\Collection search(string $query, ?string $type = null, SearchLimitTo $limitTo = SearchLimitTo::ALL, bool $returnArray = false) Search command
3233 * @method \Winter\Packager\Package\Collection|\Winter\Packager\Package\Package|null show(ShowMode $mode = ShowMode::INSTALLED, ?string $package = null, bool $noDev = false) Show command
3334 * @method \Winter\Packager\Commands\Update update(bool $includeDev = true, bool $lockFileOnly = false, bool $ignorePlatformReqs = false, string $installPreference = 'none', bool $ignoreScripts = false, bool $dryRun = false) Update command
@@ -60,6 +61,11 @@ class Composer
6061 */
6162 protected ?LockFile $ lockFileInstance = null ;
6263
64+ /**
65+ * An instance of the installed file class.
66+ */
67+ protected ?InstalledFile $ installedFileInstance = null ;
68+
6369 /**
6470 * The name of the dependency directory.
6571 */
@@ -303,6 +309,18 @@ public function getLockFile(): LockFile
303309 return $ this ->lockFileInstance ;
304310 }
305311
312+ /**
313+ * Gets an instance of the InstalledFile class to read the Composer lock file.
314+ */
315+ public function getInstalledFile (): InstalledFile
316+ {
317+ if (!isset ($ this ->installedFileInstance )) {
318+ $ this ->installedFileInstance = new InstalledFile ($ this );
319+ }
320+
321+ return $ this ->installedFileInstance ;
322+ }
323+
306324 /**
307325 * Gets the name for the vendor package directory.
308326 *
@@ -324,6 +342,16 @@ public function setVendorDir(string $vendorDir): static
324342 return $ this ;
325343 }
326344
345+ /**
346+ * Gets the directory for the composer vendor directory
347+ */
348+ public function getComposerVendorDir (): string
349+ {
350+ return rtrim ($ this ->getVendorDir (), DIRECTORY_SEPARATOR )
351+ . DIRECTORY_SEPARATOR
352+ . 'composer ' ;
353+ }
354+
327355 /**
328356 * Gets the timeout for a Composer command.
329357 *
0 commit comments