php-cooper

ImportGlob
in package

FinalYes

One filesystem import's expansion: the `$pattern` it named (braces and wildcards, CASC.md ยง5.1, after `${NAME}` interpolation), the `$root` it was expanded under, and the `$files` it matched then.

It exists because the files a load read cannot show a file added where a glob import looks -- that file was never read. Only the pattern, expanded again, can: Cache does so on every hit, and a caller keeping a loaded config elsewhere (see LoadTrace) can do the same with changed().

Table of Contents

Properties

$files  : array<string|int, mixed>
$pattern  : string
$root  : string

Methods

__construct()  : mixed
changed()  : bool
Whether the pattern now matches a different set of files: one added where it looks, or one removed from there.
expand()  : array<int, string>
What the pattern matches on disk now, by the same expansion the loader uses.

Properties

$files read-only

public array<string|int, mixed> $files

Methods

__construct()

public __construct(string $root, string $pattern, array<int, string> $files) : mixed
Parameters
$root : string

the directory the pattern was expanded under

$pattern : string

the import's path, as the document gave it

$files : array<int, string>

what it matched: absolute, de-duplicated, sorted

changed()

Whether the pattern now matches a different set of files: one added where it looks, or one removed from there.

public changed() : bool
Return values
bool

expand()

What the pattern matches on disk now, by the same expansion the loader uses.

public expand() : array<int, string>
Return values
array<int, string> —

absolute, de-duplicated, sorted

On this page

Search results