final class ArtifactDirectory
Restricted visibility: declared "@visibility parent". Code outside that scope must not name this declaration.

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): string

Names 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

$artifactPathstringPath of the file that is about to be written

Returns

string Directory that now exists and can be written to

Throws

RuntimeException When the path cannot become a writable directory
Test cases 3
Called from 1
Calls 6

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

Relations§

Instantiated in 1
Method calls 1
Type declarations 1