projects
/
mdref
/
mdref
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
move formatting from JS to PHP
[mdref/mdref]
/
mdref
/
Repo.php
diff --git
a/mdref/Repo.php
b/mdref/Repo.php
index 869b74e4f7acb28b787face9a490b878a5f683d8..f52a35e5ac06c7d939e4e3ad6d718ee61a2eefdf 100644
(file)
--- a/
mdref/Repo.php
+++ b/
mdref/Repo.php
@@
-43,11
+43,12
@@
class Repo implements IteratorAggregate {
* @throws \InvalidArgumentException
*/
public function __construct(string $path) {
* @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));
}
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));
$this->path = realpath($path);
$this->name = basename($mdref, ".mdref");
$this->edit = trim(file_get_contents($mdref));