move formatting from JS to PHP
[mdref/mdref] / 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));