fix PHP-7.3 compat
authorMichael Wallner <mike@php.net>
Fri, 13 Sep 2019 19:17:48 +0000 (21:17 +0200)
committerMichael Wallner <mike@php.net>
Fri, 13 Sep 2019 19:17:48 +0000 (21:17 +0200)
mdref/Repo.php

index 869b74e4f7acb28b787face9a490b878a5f683d8..f52a35e5ac06c7d939e4e3ad6d718ee61a2eefdf 100644 (file)
@@ -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));