Bug fixes.

This commit is contained in:
Dennis Eichhorn 2016-03-27 22:38:30 +02:00
parent cfe6fb0059
commit 8ebdf58d34
8 changed files with 12 additions and 12 deletions

View File

@ -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))];
}
}

View File

@ -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 = [];

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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 : '');
}
/**

View File

@ -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;

View File

@ -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;