fix wrapper->fmt calls
[mdref/mdref] / mdref / Entry.php
index 2ca35f52921db291389eb3017cd1be3a1fb36bff..345f3c7b5bcc5bc9a2e1599c2cf6e5010c56d4df 100644 (file)
@@ -218,7 +218,7 @@ class Entry implements IteratorAggregate {
         */
        public function isFunction() : bool {
                $base = end($this->list);
-               return $base{0} === "_" || ctype_lower($base{0});
+               return $base[0] === "_" || ctype_lower($base[0]);
        }
 
        /**
@@ -227,7 +227,7 @@ class Entry implements IteratorAggregate {
         */
        public function isNsClass() : bool {
                $base = end($this->list);
-               return ctype_upper($base{0});
+               return ctype_upper($base[0]);
        }
 
        /**
@@ -265,12 +265,12 @@ class Entry implements IteratorAggregate {
                }
                $parent = end($parts);
 
-               switch ($myself{0}) {
+               switch ($myself[0]) {
                case ":":
                        return "★" . substr($myself, 1);
 
                default:
-                       if (!ctype_lower($myself{0}) || ctype_lower($parent{0})) {
+                       if (!ctype_lower($myself[0]) || ctype_lower($parent[0])) {
                                return $myself;
                        }
                case "_":
@@ -293,7 +293,7 @@ class Entry implements IteratorAggregate {
         * @return bool
         */
        function hasIterator(?string $glob = null, bool $loose = false) : bool {
-               if (strlen($glob)) {
+               if (isset($glob) && strlen($glob)) {
                        return glob($this->getNextDirname() . "/$glob") ||
                                ($loose && glob($this->getNextDirname() . "/*/$glob"));
                } elseif ($this->isRoot()) {