OperationFactory
class OperationFactory (View source)
| internal |
Create Scaffold operation objects based on provided metadata.
Properties
| protected Composer | $composer | The Composer service. |
Methods
OperationFactory constructor.
Creates a scaffolding operation object as determined by the metadata.
Creates a 'replace' scaffold op.
Creates an 'append' (or 'prepend') scaffold op.
Checks to see if the specified scaffold file exists and has content.
Gets the file path of a package.
Details
__construct(Composer $composer)
OperationFactory constructor.
OperationInterface
create(PackageInterface $package, OperationData $operation_data)
Creates a scaffolding operation object as determined by the metadata.
protected OperationInterface
createReplaceOp(PackageInterface $package, OperationData $operation_data)
Creates a 'replace' scaffold op.
Replace ops may copy or symlink, depending on settings.
protected OperationInterface
createAppendOp(PackageInterface $package, OperationData $operation_data)
Creates an 'append' (or 'prepend') scaffold op.
protected bool
hasContent(ScaffoldFilePath $file = NULL)
Checks to see if the specified scaffold file exists and has content.
protected string
getPackagePath(PackageInterface $package)
Gets the file path of a package.
Note that if we call getInstallPath on the root package, we get the wrong answer (the installation manager thinks our package is in vendor). We therefore add special checking for this case.