phpcs fixes

This commit is contained in:
Dennis Eichhorn 2018-02-17 22:05:29 +01:00
parent a15a1b229e
commit fdff9da488
15 changed files with 72 additions and 22 deletions

View File

@ -300,6 +300,17 @@ class FileCache implements CacheInterface
return $this->parseValue($type, $raw, $expireEnd);
}
/**
* Parse cached value
*
* @param int $type Cached value type
* @param string $raw Cached value
* @param int $expireEnd Value end position
*
* @return mixed
*
* @since 1.0.0
*/
private function parseValue(int $type, string $raw, int $expireEnd)
{
$value = null;
@ -414,6 +425,15 @@ class FileCache implements CacheInterface
return false;
}
/**
* Get cache path
*
* @param mixed $key Key for cached value
*
* @return string Path to cache file
*
* @since 1.0.0
*/
private function getPath($key) : string
{
$path = File::sanitize($key, self::SANITIZE);

View File

@ -165,6 +165,8 @@ class MemCache implements CacheInterface
/**
* Closing cache.
*
* @return void
*
* @since 1.0.0
*/
public function close()

View File

@ -56,6 +56,8 @@ class CookieJar
/**
* Lock
*
* @return void
*
* @since 1.0.0
*/
public static function lock() /* : void */

View File

@ -49,9 +49,11 @@ class CityPool implements \Countable
*
* @param City $city City
*
* @return void
*
* @since 1.0.0
*/
public function addCity(City $city)
public function addCity(City $city) /* : void */
{
$this->cities[$city->getName() . $city->getLatitude() . $city->getLongitude()] = $city;
}

View File

@ -56,9 +56,11 @@ class Population implements \Countable
* @param int $index Position to insert at
* @param Tour $tour Tour to insert
*
* @return void
*
* @since 1.0.0
*/
public function insertAt(int $index, Tour $tour)
public function insertAt(int $index, Tour $tour) /* : void */
{
$this->tours = array_slice($this->tours, 0, $index) + [$tour] + array_slice($this->tours, $index);
}
@ -69,6 +71,8 @@ class Population implements \Countable
* @param int $index Position to set/replace
* @param Tour $tour Tour to set
*
* @return void
*
* @since 1.0.0
*/
public function set(int $index, Tour $tour) /* : void */
@ -82,9 +86,11 @@ class Population implements \Countable
*
* @param Tour $tour Tour to add
*
* @return void
*
* @since 1.0.0
*/
public function add(Tour $tour)
public function add(Tour $tour) /* : void */
{
$this->tours[] = $tour;
}

View File

@ -135,9 +135,11 @@ class Tour implements \Countable
*
* @param City $city City
*
* @return void
*
* @since 1.0.0
*/
public function addCity(City $city)
public function addCity(City $city) /* : void */
{
$this->cities[] = $city;
@ -151,6 +153,8 @@ class Tour implements \Countable
* @param int $index Index to set/replace
* @param City $city City
*
* @return void
*
* @since 1.0.0
*/
public function setCity(int $index, City $city) /* : void */

View File

@ -27,9 +27,9 @@ class CauchyDistribution
/**
* Get probability density function.
*
* @param float $x
* @param float $x0
* @param float $gamma
* @param float $x Value x
* @param float $x0 Value x0
* @param float $gamma Gamma
*
* @return float
*
@ -43,9 +43,9 @@ class CauchyDistribution
/**
* Get cumulative distribution function.
*
* @param float $x
* @param float $x0
* @param float $gamma
* @param float $x Value x
* @param float $x0 Value x0
* @param float $gamma Gamma
*
* @return float
*
@ -59,7 +59,7 @@ class CauchyDistribution
/**
* Get mode.
*
* @param float $x0
* @param float $x0 Value x0
*
* @return float
*
@ -73,7 +73,7 @@ class CauchyDistribution
/**
* Get expected value.
*
* @param float $x0
* @param float $x0 Value x0
*
* @return float
*

View File

@ -142,7 +142,7 @@ class ChiSquaredDistribution
/**
* Get probability density function.
*
* @param float $x
* @param float $x Value x
* @param int $df Degreegs of freedom
*
* @return float
@ -220,7 +220,7 @@ class ChiSquaredDistribution
* Get moment generating function.
*
* @param int $df Degrees of freedom
* @param float $t
* @param float $t Value t
*
* @return float
*
@ -240,7 +240,7 @@ class ChiSquaredDistribution
/**
* Get skewness.
*
* @param int $df
* @param int $df Degrees of freedom
*
* @return float
*
@ -254,7 +254,7 @@ class ChiSquaredDistribution
/**
* Get Ex. kurtosis.
*
* @param int $df
* @param int $df Degrees of freedom
*
* @return float
*

View File

@ -51,7 +51,7 @@ class Nntp extends EmailAbstract
*/
public function connect(string $user = '', string $pass = '') /* : void */
{
$this->mailbox = '{' . $this->host . ':' . $this->port . '/nntp' . '}';
$this->mailbox = '{' . $this->host . ':' . $this->port . '/nntp}';
parent::connect();
}
}

View File

@ -51,7 +51,7 @@ class Pop3 extends EmailAbstract
*/
public function connect(string $user = '', string $pass = '') /* : void */
{
$this->mailbox = '{' . $this->host . ':' . $this->port . '/pop3' . '}';
$this->mailbox = '{' . $this->host . ':' . $this->port . '/pop3}';
parent::connect();
}
}

View File

@ -40,6 +40,8 @@ abstract class PacketAbstract implements \Serializable
*
* This is using a json format
*
* @return string
*
* @since 1.0.0
*/
abstract public function __toString();

View File

@ -170,9 +170,11 @@ class BinaryTree extends Tree
* @param Node $node Tree node
* @param \Closure $callback Task to perform on node
*
* @return void
*
* @since 1.0.0
*/
public function verticalOrder(Node $node, \Closure $callback)
public function verticalOrder(Node $node, \Closure $callback) /* : void */
{
$order = [];
$this->getVerticalOrder($node, 0, $order);

View File

@ -210,9 +210,11 @@ class Tree extends Graph
* @param Node $node Tree node
* @param \Closure $callback Task to perform on node
*
* @return void
*
* @since 1.0.0
*/
public function preOrder(Node $node, \Closure $callback)
public function preOrder(Node $node, \Closure $callback) /* : void */
{
if (count($this->nodes) === 0) {
return;
@ -233,9 +235,11 @@ class Tree extends Graph
* @param Node $node Tree node
* @param \Closure $callback Task to perform on node
*
* @return void
*
* @since 1.0.0
*/
public function postOrder(Node $node, \Closure $callback)
public function postOrder(Node $node, \Closure $callback) /* : void */
{
if (count($this->nodes) === 0) {
return;

View File

@ -133,6 +133,8 @@ class PriorityQueue implements \Countable, \Serializable
/**
* Delete last element.
*
* @return mixed
*
* @since 1.0.0
*/
public function remove()
@ -190,6 +192,8 @@ class PriorityQueue implements \Countable, \Serializable
*
* @param string $data Data to unserialze
*
* @return void
*
* @since 1.0.0
*/
public function unserialize($data)

View File

@ -43,9 +43,11 @@ namespace phpOMS\Utils\IO\Csv {
*
* @param string $path Path to import
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function importCsv($path);
public function importCsv($path); /* : void */
}
}