From: Michael Wallner Date: Fri, 13 Sep 2019 19:17:48 +0000 (+0200) Subject: fix PHP-7.3 compat X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=a295d9269719e9c7cb3ed87d716e020d19917041;p=mdref%2Fmdref fix PHP-7.3 compat --- 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));