X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=mdref%2FRepo.php;h=f52a35e5ac06c7d939e4e3ad6d718ee61a2eefdf;hb=a94ecb1009610a763dd74a7eebc4754b6643d832;hp=869b74e4f7acb28b787face9a490b878a5f683d8;hpb=cc51febb88600aa4fcd4881d880f698b450bb3ff;p=mdref%2Fmdref diff --git a/mdref/Repo.php b/mdref/Repo.php index 869b74e..f52a35e 100644 --- a/mdref/Repo.php +++ b/mdref/Repo.php @@ -43,11 +43,12 @@ class Repo implements IteratorAggregate { * @throws \InvalidArgumentException */ public function __construct(string $path) { - if (!($mdref = current(glob("$path/*.mdref")))) { + if (!($glob = glob("$path/*.mdref"))) { throw new InvalidArgumentException( sprintf("Not a reference, could not find '*.mdref': '%s'", $path)); } + $mdref = current($glob); $this->path = realpath($path); $this->name = basename($mdref, ".mdref"); $this->edit = trim(file_get_contents($mdref));