ComposerInfo
in package
The main entrypoint for this library.
Table of Contents
Constants
- ALL = 0
- DEVELOPMENT = 2
- PRODUCTION = 1
Properties
- $decodedValue : array<string, mixed>
- $packages : PackagesCollection
- $pathToLockFile : string
Methods
- __construct() : $this
- Creates the instance and sets the path to the lock file.
- getHash() : string|null
- Gets the hash from the lock file
- getMinimumStability() : string|null
- Gets the minimum stability
- getPackages() : PackagesCollection
- Get the list of packages as a collection object.
- checkFile() : void
- Checks the lock file to make sure it exists and is readable.
- getJsonLastErrorMsg() : string
- Reports the last error message from PHP's json library.
- parse() : void
- Parses the lock file into a json object.
Constants
ALL
public
int
ALL
= 0
Constant flag for all packages, see getPackage()
DEVELOPMENT
public
int
DEVELOPMENT
= 2
Constant flag for development packages, see getPackage()
PRODUCTION
public
int
PRODUCTION
= 1
Constant flag for production packages, see getPackage()
Properties
$decodedValue
private
array<string, mixed>
$decodedValue
= []
The parsed lockfile into PHP.
$packages
private
PackagesCollection
$packages
The collection of found projects.
$pathToLockFile
private
string
$pathToLockFile
The path to the lock file.
Methods
__construct()
Creates the instance and sets the path to the lock file.
public
__construct(string $pathToLockFile) : $this
Parameters
- $pathToLockFile : string
-
The path to the composer.lock file
Return values
$thisgetHash()
Gets the hash from the lock file
public
getHash() : string|null
Return values
string|null —The has, or null if it's not found, or not set.
getMinimumStability()
Gets the minimum stability
public
getMinimumStability() : string|null
Return values
string|null —The minimum tability or null if not found.
getPackages()
Get the list of packages as a collection object.
public
getPackages([int $list = self::ALL ]) : PackagesCollection
Parameters
- $list : int = self::ALL
-
What list of packages should we return. self::ALL - Both dev and production. self::PRODUCTION - Just production. se=lf::DEVELOPMENT - Just dev.
Return values
PackagesCollection —of Package
checkFile()
Checks the lock file to make sure it exists and is readable.
private
checkFile() : void
Tags
getJsonLastErrorMsg()
Reports the last error message from PHP's json library.
private
getJsonLastErrorMsg() : string
Return values
string —The error message.
parse()
Parses the lock file into a json object.
private
parse() : void