+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/contracts/Collection/ArrayList.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(array $items = [])
parent::__construct(array_values($items));
}

public function first()
public function first(): mixed
{
if (($result = reset($this->items)) !== false) {
return $result;
Expand All @@ -36,7 +36,7 @@ public function first()
throw new OutOfBoundsException('Collection is empty');
}

public function last()
public function last(): mixed
{
if (($result = end($this->items)) !== false) {
return $result;
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Collection/ArrayMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
class ArrayMap extends AbstractInMemoryCollection implements MapInterface
{
public function get($key)
public function get($key): mixed
{
if (!$this->has($key)) {
throw new OutOfBoundsException(sprintf("Collection does not contain element with key '%s'", $key));
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/Collection/ListInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface ListInterface extends CollectionInterface
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\OutOfBoundsException if collection is empty
*/
public function first();
public function first(): mixed;

/**
* Return last element of collection.
Expand All @@ -31,7 +31,7 @@ public function first();
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\OutOfBoundsException if collection is empty
*/
public function last();
public function last(): mixed;

/**
* @param TValue $value
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Collection/MapInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface MapInterface extends CollectionInterface
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\OutOfBoundsException if map does not contain element with given key
*/
public function get($key);
public function get($key): mixed;

/**
* Returns true if the given key is defined within the map.
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/Collection/MutableArrayList.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
*/
class MutableArrayList extends ArrayList implements MutableListInterface
{
public function append($value): void
public function append(mixed $value): void
{
$this->items[] = $value;
}

public function prepend($value): void
public function prepend(mixed $value): void
{
array_unshift($this->items, $value);
}

public function remove($value): void
public function remove(mixed $value): void
{
$idx = array_search($value, $this->items, true);
if ($idx !== false) {
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/Collection/MutableListInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ interface MutableListInterface extends ListInterface
/**
* @param TValue $value
*/
public function append($value): void;
public function append(mixed $value): void;

/**
* @param TValue $value
*/
public function prepend($value): void;
public function prepend(mixed $value): void;

/**
* @param TValue $value
*/
public function remove($value): void;
public function remove(mixed $value): void;

public function clear(): void;
}
4 changes: 2 additions & 2 deletions src/contracts/Collection/MutableMapInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ interface MutableMapInterface extends MapInterface
* @param TKey $key
* @param TValue $value
*/
public function set($key, $value): void;
public function set(mixed $key, mixed $value): void;

/**
* @param TKey $key
*/
public function unset($key): void;
public function unset(mixed $key): void;

public function clear(): void;
}
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载