classArtifactDirectory
final class ArtifactDirectory
Answers which directory a generated artifact is written into.
A build names the file it wants to produce, not the directory that has to exist first, and a checkout may not carry an empty directory at all. Asking the filesystem to create the directory is therefore part of naming it, and a path that can never become a writable directory is a failure the build has to hear about before it has staged anything.
Methods§
public function prepared(string $artifactPath): stringNames the directory an artifact is written into, creating it when the filesystem allows.
The nearest ancestor that already exists decides the answer: if it is not a writable directory then nothing below it can become one, and reporting that ancestor says why rather than only that the attempt failed.
Parameters
$artifactPath | string | Path of the file that is about to be written |
Returns
string Directory that now exists and can be written toThrows
RuntimeException When the path cannot become a writable directoryTest cases 3
Called from 1
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 1
GrammarWriterTestcalls