Dependency
class Dependency (View source)
A value object representing dependency information.
Properties
| protected string | $name | The name of the dependency. |
|
| protected string | $project | The project namespace for the dependency. |
|
| protected Constraint | $constraintString | The constraint string. |
|
| protected Constraint | $constraint | The Constraint object from the constraint string. |
Methods
Dependency constructor.
Gets the dependency's name.
Gets the dependency's project namespace.
Gets constraint string from the dependency.
Gets the Constraint object.
Determines if the provided version is compatible with this dependency.
Creates a new instance of this class from a dependency string.
Prevents unnecessary serialization of constraint objects.
Details
__construct(string $name, string $project, string $constraint)
Dependency constructor.
string
getName()
Gets the dependency's name.
string
getProject()
Gets the dependency's project namespace.
string
getConstraintString()
Gets constraint string from the dependency.
protected Constraint
getConstraint()
Gets the Constraint object.
bool
isCompatible(string $version)
Determines if the provided version is compatible with this dependency.
static Dependency
createFromString(string $dependency)
Creates a new instance of this class from a dependency string.
array
__sleep()
Prevents unnecessary serialization of constraint objects.