Skip to content

Commit

Permalink
removed useless annotations @param and @return
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 20, 2017
1 parent eca4ae2 commit b6341f0
Show file tree
Hide file tree
Showing 19 changed files with 70 additions and 375 deletions.
17 changes: 4 additions & 13 deletions src/Iterators/CachingIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,24 @@ public function __construct($iterator)

/**
* Is the current element the first one?
* @param int grid width
* @return bool
*/
public function isFirst(int $width = NULL): bool
public function isFirst(int $gridWidth = NULL): bool
{
return $this->counter === 1 || ($width && $this->counter !== 0 && (($this->counter - 1) % $width) === 0);
return $this->counter === 1 || ($gridWidth && $this->counter !== 0 && (($this->counter - 1) % $gridWidth) === 0);
}


/**
* Is the current element the last one?
* @param int grid width
* @return bool
*/
public function isLast(int $width = NULL): bool
public function isLast(int $gridWidth = NULL): bool
{
return !$this->hasNext() || ($width && ($this->counter % $width) === 0);
return !$this->hasNext() || ($gridWidth && ($this->counter % $gridWidth) === 0);
}


/**
* Is the iterator empty?
* @return bool
*/
public function isEmpty(): bool
{
Expand All @@ -88,7 +83,6 @@ public function isEmpty(): bool

/**
* Is the counter odd?
* @return bool
*/
public function isOdd(): bool
{
Expand All @@ -98,7 +92,6 @@ public function isOdd(): bool

/**
* Is the counter even?
* @return bool
*/
public function isEven(): bool
{
Expand All @@ -108,7 +101,6 @@ public function isEven(): bool

/**
* Returns the counter.
* @return int
*/
public function getCounter(): int
{
Expand All @@ -118,7 +110,6 @@ public function getCounter(): int

/**
* Returns the count of elements.
* @return int
*/
public function count(): int
{
Expand Down
5 changes: 0 additions & 5 deletions src/Utils/ArrayHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator
{

/**
* @param array to wrap
* @param bool
* @return static
*/
public static function from(array $arr, bool $recursive = TRUE): self
Expand All @@ -39,7 +37,6 @@ public static function from(array $arr, bool $recursive = TRUE): self

/**
* Returns an iterator over all items.
* @return \RecursiveArrayIterator
*/
public function getIterator(): \RecursiveArrayIterator
{
Expand All @@ -49,7 +46,6 @@ public function getIterator(): \RecursiveArrayIterator

/**
* Returns items count.
* @return int
*/
public function count(): int
{
Expand Down Expand Up @@ -82,7 +78,6 @@ public function offsetGet($key)

/**
* Determines whether a item exists.
* @return bool
*/
public function offsetExists($key): bool
{
Expand Down
5 changes: 0 additions & 5 deletions src/Utils/ArrayList.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate

/**
* Returns an iterator over all items.
* @return \ArrayIterator
*/
public function getIterator(): \ArrayIterator
{
Expand All @@ -34,7 +33,6 @@ public function getIterator(): \ArrayIterator

/**
* Returns items count.
* @return int
*/
public function count(): int
{
Expand All @@ -45,7 +43,6 @@ public function count(): int
/**
* Replaces or appends a item.
* @param int|NULL
* @param mixed
* @return void
* @throws Nette\OutOfRangeException
*/
Expand Down Expand Up @@ -81,7 +78,6 @@ public function offsetGet($index)
/**
* Determines whether a item exists.
* @param int
* @return bool
*/
public function offsetExists($index): bool
{
Expand All @@ -106,7 +102,6 @@ public function offsetUnset($index)

/**
* Prepends a item.
* @param mixed
* @return void
*/
public function prepend($value)
Expand Down
19 changes: 3 additions & 16 deletions src/Utils/Arrays.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ class Arrays

/**
* Returns item from array or $default if item is not set.
* @param array
* @param string|int|array one or more keys
* @param mixed
* @param string|int|array $key one or more keys
* @return mixed
* @throws Nette\InvalidArgumentException if item does not exist and default value is not provided
*/
Expand All @@ -46,8 +44,7 @@ public static function get(array $arr, $key, $default = NULL)

/**
* Returns reference to array item.
* @param array
* @param string|int|array one or more keys
* @param string|int|array $key one or more keys
* @return mixed
* @throws Nette\InvalidArgumentException if traversed item is not an array
*/
Expand All @@ -66,7 +63,6 @@ public static function &getRef(array &$arr, $key)

/**
* Recursively appends elements of remaining keys from the second array to the first.
* @return array
*/
public static function mergeTree(array $arr1, array $arr2): array
{
Expand Down Expand Up @@ -131,7 +127,6 @@ public static function renameKey(array &$arr, $oldKey, $newKey)

/**
* Returns array entries that match the pattern.
* @return array
*/
public static function grep(array $arr, string $pattern, int $flags = 0): array
{
Expand All @@ -141,7 +136,6 @@ public static function grep(array $arr, string $pattern, int $flags = 0): array

/**
* Returns flattened array.
* @return array
*/
public static function flatten(array $arr, bool $preserveKeys = FALSE): array
{
Expand All @@ -156,7 +150,6 @@ public static function flatten(array $arr, bool $preserveKeys = FALSE): array

/**
* Finds whether a variable is a zero-based integer indexed array.
* @return bool
*/
public static function isList($value): bool
{
Expand Down Expand Up @@ -218,7 +211,6 @@ public static function associate(array $arr, $path)

/**
* Normalizes to associative array.
* @return array
*/
public static function normalize(array $arr, $filling = NULL): array
{
Expand All @@ -232,9 +224,7 @@ public static function normalize(array $arr, $filling = NULL): array

/**
* Picks element from the array by key and return its value.
* @param array
* @param string|int array key
* @param mixed
* @param string|int $key array key
* @return mixed
* @throws Nette\InvalidArgumentException if item does not exist and default value is not provided
*/
Expand All @@ -256,7 +246,6 @@ public static function pick(array &$arr, $key, $default = NULL)

/**
* Tests whether some element in the array passes the callback test.
* @return bool
*/
public static function some(array $arr, callable $callback): bool
{
Expand All @@ -271,7 +260,6 @@ public static function some(array $arr, callable $callback): bool

/**
* Tests whether all elements in the array pass the callback test.
* @return bool
*/
public static function every(array $arr, callable $callback): bool
{
Expand All @@ -286,7 +274,6 @@ public static function every(array $arr, callable $callback): bool

/**
* Applies the callback to the elements of the array.
* @return array
*/
public static function map(array $arr, callable $callback): array
{
Expand Down
18 changes: 4 additions & 14 deletions src/Utils/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ class Callback
use Nette\StaticClass;

/**
* @param mixed class, object, callable
* @param string method
* @return \Closure
* @param string|object|callable class, object, callable
*/
public static function closure($callable, string $m = NULL): \Closure
public static function closure($callable, string $method = NULL): \Closure
{
if ($m !== NULL) {
$callable = [$callable, $m];
if ($method !== NULL) {
$callable = [$callable, $method];

} elseif (is_string($callable) && count($tmp = explode('::', $callable)) === 2) {
$callable = $tmp;
Expand Down Expand Up @@ -79,7 +77,6 @@ public static function invokeArgs($callable, array $args = [])

/**
* Invokes internal PHP function with own error handler.
* @param string
* @return mixed
*/
public static function invokeSafe(string $function, array $args, callable $onError)
Expand Down Expand Up @@ -120,9 +117,6 @@ public static function check($callable, bool $syntax = FALSE)
}


/**
* @return string
*/
public static function toString($callable): string
{
if ($callable instanceof \Closure) {
Expand Down Expand Up @@ -160,9 +154,6 @@ public static function toReflection($callable)
}


/**
* @return bool
*/
public static function isStatic(callable $callable): bool
{
return is_array($callable) ? is_string($callable[0]) : is_string($callable);
Expand All @@ -172,7 +163,6 @@ public static function isStatic(callable $callable): bool
/**
* Unwraps closure created by self::closure()
* @internal
* @return callable
*/
public static function unwrap(\Closure $closure): callable
{
Expand Down
11 changes: 3 additions & 8 deletions src/Utils/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,13 @@ public static function fromParts(int $year, int $month, int $day, int $hour = 0,
}


/**
* @return string
*/
public function __toString(): string
{
return $this->format('Y-m-d H:i:s');
}


/**
* @param string
* @return static
*/
public function modifyClone(string $modify = ''): self
Expand Down Expand Up @@ -118,9 +114,9 @@ public function getTimestamp()

/**
* Returns new DateTime object formatted according to the specified format.
* @param string The format the $time parameter should be in
* @param string String representing the time
* @param string|\DateTimeZone desired timezone (default timezone is used if NULL is passed)
* @param string The format the $time parameter should be in
* @param string String representing the time
* @param string|\DateTimeZone desired timezone (default timezone is used if NULL is passed)
* @return static|FALSE
*/
public static function createFromFormat($format, $time, $timezone = NULL)
Expand All @@ -142,7 +138,6 @@ public static function createFromFormat($format, $time, $timezone = NULL)

/**
* Returns JSON representation in ISO 8601 (used by JavaScript).
* @return string
*/
public function jsonSerialize(): string
{
Expand Down
2 changes: 0 additions & 2 deletions src/Utils/FileSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public static function rename(string $name, string $newName, bool $overwrite = T

/**
* Reads file content.
* @return string
* @throws Nette\IOException
*/
public static function read(string $file): string
Expand Down Expand Up @@ -149,7 +148,6 @@ public static function write(string $file, string $content, int $mode = 0666)

/**
* Is path absolute?
* @return bool
*/
public static function isAbsolute(string $path): bool
{
Expand Down
Loading

0 comments on commit b6341f0

Please sign in to comment.