| @@ -29,7 +29,7 @@ | ||
| 29 | 29 |      { | 
| 30 | 30 | parent::__construct(); | 
| 31 | 31 | |
| 32 | - include __DIR__ . '/bootstrap.php'; | |
| 32 | + include __DIR__.'/bootstrap.php'; | |
| 33 | 33 | } | 
| 34 | 34 | |
| 35 | 35 | /** | 
| @@ -61,7 +61,7 @@ | ||
| 61 | 61 | continue; | 
| 62 | 62 | } | 
| 63 | 63 | |
| 64 | -                $commands->each(function ($command) use ($node) { | |
| 64 | +                $commands->each(function($command) use ($node) { | |
| 65 | 65 | $class = "\\Axiom\\Rivescript\\Cortex\\Commands\\$command"; | 
| 66 | 66 | $commandClass = new $class(); | 
| 67 | 67 | $commandClass->parse($node); | 
| @@ -50,7 +50,7 @@ | ||
| 50 | 50 | } | 
| 51 | 51 | |
| 52 | 52 |          if (stream_wrapper_register($this->name, ContentStream::class)) { | 
| 53 | - $this->stream = fopen($this->name . "://input", "r+"); | |
| 53 | + $this->stream = fopen($this->name."://input", "r+"); | |
| 54 | 54 | } | 
| 55 | 55 | |
| 56 | 56 |          if (is_resource($this->stream) === false) { | 
| @@ -111,8 +111,9 @@ | ||
| 111 | 111 | public function loadDirectory(string $path) | 
| 112 | 112 |      { | 
| 113 | 113 |          foreach (new DirectoryIterator($path) as $file) { | 
| 114 | - if ($file->isDot()) | |
| 115 | - continue; | |
| 114 | +            if ($file->isDot()) { | |
| 115 | + continue; | |
| 116 | + } | |
| 116 | 117 | |
| 117 | 118 | $this->loadFile($file->getPathname()); | 
| 118 | 119 | } | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 | */ | 
| 77 | 77 | public function stream_read(int $count): string | 
| 78 | 78 |      { | 
| 79 | - $p =& $this->position; | |
| 79 | + $p = & $this->position; | |
| 80 | 80 | $ret = substr($this->content, $p, $count); | 
| 81 | 81 | $p += strlen($ret); | 
| 82 | 82 | return $ret; | 
| @@ -91,10 +91,10 @@ discard block | ||
| 91 | 91 | */ | 
| 92 | 92 | public function stream_write(string $data): int | 
| 93 | 93 |      { | 
| 94 | - $v =& $this->content; | |
| 94 | + $v = & $this->content; | |
| 95 | 95 | $l = strlen($data); | 
| 96 | - $p =& $this->position; | |
| 97 | - $v = substr($v, 0, $p) . $data . substr($v, $p += $l); | |
| 96 | + $p = & $this->position; | |
| 97 | + $v = substr($v, 0, $p).$data.substr($v, $p += $l); | |
| 98 | 98 | return $l; | 
| 99 | 99 | } | 
| 100 | 100 | |
| @@ -132,7 +132,7 @@ discard block | ||
| 132 | 132 | public function stream_seek(int $offset, int $whence = SEEK_SET): bool | 
| 133 | 133 |      { | 
| 134 | 134 | $l = strlen($this->content); | 
| 135 | - $p =& $this->position; | |
| 135 | + $p = & $this->position; | |
| 136 | 136 |          switch ($whence) { | 
| 137 | 137 | case SEEK_SET: | 
| 138 | 138 | $newPos = $offset; | 
| @@ -147,7 +147,9 @@ | ||
| 147 | 147 | return false; | 
| 148 | 148 | } | 
| 149 | 149 | $ret = ($newPos >= 0 && $newPos <= $l); | 
| 150 | - if ($ret) $p = $newPos; | |
| 150 | +        if ($ret) { | |
| 151 | + $p = $newPos; | |
| 152 | + } | |
| 151 | 153 | return $ret; | 
| 152 | 154 | } | 
| 153 | 155 | } |