diff --git a/Datatypes/Enum.php b/Datatypes/Enum.php index 2df44d0f2..7b542d7bd 100644 --- a/Datatypes/Enum.php +++ b/Datatypes/Enum.php @@ -96,7 +96,7 @@ abstract class Enum { $constants = self::getConstants(); - return $this->constants[mt_rand(0, count($constants))]; + return $constants[mt_rand(0, count($constants))]; } } diff --git a/Module/ModuleManager.php b/Module/ModuleManager.php index 93ceff9b5..61710643d 100644 --- a/Module/ModuleManager.php +++ b/Module/ModuleManager.php @@ -49,7 +49,7 @@ class ModuleManager /** * All modules that are running on this uri. * - * @var \phpOMS\Module\ModuleAbstract + * @var \phpOMS\Module\ModuleAbstract[] * @since 1.0.0 */ private $running = []; diff --git a/Stdlib/PriorityQueue.php b/Stdlib/PriorityQueue.php index 8034ae597..fa829c33d 100644 --- a/Stdlib/PriorityQueue.php +++ b/Stdlib/PriorityQueue.php @@ -197,7 +197,7 @@ class PriorityQueue implements \Countable, \Serializable /** * {@inheritdoc} */ - public function unserialize(array $data) : array + public function unserialize($data) : array { $this->queue = json_decode($data); $this->count = count($this->queue); diff --git a/System/File/Directory.php b/System/File/Directory.php index 673fb4631..a09d62e50 100644 --- a/System/File/Directory.php +++ b/System/File/Directory.php @@ -73,7 +73,7 @@ class Directory extends FileAbstract implements \Iterator, \ArrayAccess public function get(string $name) : FileAbstract { - return $this->node[$name] ?? new NullFile(); + return $this->nodes[$name] ?? new NullFile(); } public function add(FileAbstract $file) diff --git a/System/File/FileAbstract.php b/System/File/FileAbstract.php index 0206e10e5..75a9433b6 100644 --- a/System/File/FileAbstract.php +++ b/System/File/FileAbstract.php @@ -30,10 +30,10 @@ namespace phpOMS\System\File; */ abstract class FileAbstract { - private $path = ''; - private $name = 'new_directory'; - private $count = 0; - private $size = 0; + protected $path = ''; + protected $name = 'new_directory'; + protected $count = 0; + protected $size = 0; private $createdAt = null; private $changedAt = null; private $owner = 0; diff --git a/Uri/Http.php b/Uri/Http.php index ef0d2310d..57bcbd7ba 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -332,7 +332,7 @@ class Http implements UriInterface */ public function getAuthority() : string { - return ($this->getUser() !== '' ? $this->getUser() . '@' : '') . $this->host . (isset($this->port) && $this->port !== '' ? ':' . $this->port : ''); + return ($this->getUser() !== '' ? $this->getUser() . '@' : '') . $this->host . (isset($this->port) && $this->port !== 0 ? ':' . $this->port : ''); } /** diff --git a/Utils/MultiMap.php b/Utils/MultiMap.php index 5f3303169..b159b6393 100644 --- a/Utils/MultiMap.php +++ b/Utils/MultiMap.php @@ -261,13 +261,13 @@ class MultiMap implements \Countable if($this->orderType !== OrderType::LOOSE) { $permutation = Permutation::permut($key); - foreach($permuation as $permut) { + foreach($permutation as $permut) { if($this->set(implode($permut, ':'), $value)) { return true; } } } else { - return $this->set(implode($key, ':')); + return $this->set(implode($key, ':'), $value); } return false; diff --git a/Utils/RnG/ArrayRandomize.php b/Utils/RnG/ArrayRandomize.php index d8bcabbfb..cad51922e 100644 --- a/Utils/RnG/ArrayRandomize.php +++ b/Utils/RnG/ArrayRandomize.php @@ -65,7 +65,7 @@ class ArrayRandomize for($i = count($arr)-1; $i > 0; $i--){ $rnd = mt_rand(0, $i); $shuffled[$i] = $arr[$rnd]; - $shuffled[$rand] = $arr[$i]; + $shuffled[$rnd] = $arr[$i]; } return $shuffled;