From a295d9269719e9c7cb3ed87d716e020d19917041 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 13 Sep 2019 21:17:48 +0200 Subject: [PATCH] fix PHP-7.3 compat --- mdref/Repo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)); -- 2.30.2