fix wrapper->fmt calls
[mdref/mdref] / mdref / File.php
index 6add1d56b7221df4bba940c0fcbc4f96ad3a57f3..0ca2bd848d4f761da288ee6900187ca649411e2e 100644 (file)
@@ -50,7 +50,7 @@ class File {
         * @return string
         * @throws Exception
         */
-       public function readDescription() : ?string {
+       public function readDescription() : string {
                if (!$this->rewind()) {
                        throw Exception::fromLastError();
                }
@@ -58,7 +58,7 @@ class File {
                && (false !== fgets($this->fd))) {
                        return fgets($this->fd);
                }
-               return null;
+               return "";
        }
 
        /**
@@ -67,10 +67,10 @@ class File {
         * @return string
         * @throws Exception
         */
-       public function readFullDescription() : ?string {
+       public function readFullDescription() : string {
                $desc = $this->readDescription();
                while (false !== ($line = fgets($this->fd))) {
-                       if ($line{0} === "#") {
+                       if ($line[0] === "#") {
                                break;
                        } else {
                                $desc .= $line;