Plugins
extends AbstractPackageCollection
in package
Class Plugins
Table of Contents
Properties
Methods
- __call() : mixed
- Convert function calls for the existing keys into their values.
- __clone() : mixed
- Clone the iterator.
- __construct() : mixed
- Local Plugins Constructor
- __toString() : string
- Convents iterator to a comma separated list.
- append() : $this
- Append new elements to the list.
- filter() : $this
- Filter elements from the list
- first() : mixed
- Get the first item
- indexOf() : string|int|false
- last() : mixed
- Get the last item
- nth() : mixed|bool
- Return nth item.
- prev() : mixed
- Return previous item.
- random() : $this
- Pick one or more random entries.
- remove() : void
- Remove item from the list.
- reverse() : $this
- Reverse the Iterator
- shuffle() : $this
- Shuffle items.
- slice() : $this
- Slice the list.
- sort() : $this|array<string|int, mixed>
- Sorts elements from the list and returns a copy of the list in the proper order
- toArray() : array<string|int, mixed>
- toJson() : string
Properties
$items
protected
array<string|int, mixed>
$items
= []
$type
protected
string
$type
= 'plugins'
Methods
__call()
Convert function calls for the existing keys into their values.
public
__call(string $key, mixed $args) : mixed
Parameters
- $key : string
- $args : mixed
Attributes
- #[ReturnTypeWillChange]
__clone()
Clone the iterator.
public
__clone() : mixed
Attributes
- #[ReturnTypeWillChange]
__construct()
Local Plugins Constructor
public
__construct() : mixed
__toString()
Convents iterator to a comma separated list.
public
__toString() : string
Attributes
- #[ReturnTypeWillChange]
Return values
stringappend()
Append new elements to the list.
public
append(array<string|int, mixed>|Iterator $items) : $this
Parameters
- $items : array<string|int, mixed>|Iterator
-
Items to be appended. Existing keys will be overridden with the new values.
Return values
$thisfilter()
Filter elements from the list
public
filter([callable|null $callback = null ]) : $this
Parameters
- $callback : callable|null = null
-
A function the receives ($value, $key) and must return a boolean to indicate filter status
Return values
$thisfirst()
Get the first item
public
first() : mixed
indexOf()
public
indexOf(mixed $needle) : string|int|false
Parameters
- $needle : mixed
-
Searched value.
Return values
string|int|false —Key if found, otherwise false.
last()
Get the last item
public
last() : mixed
nth()
Return nth item.
public
nth(int $key) : mixed|bool
Parameters
- $key : int
Return values
mixed|boolprev()
Return previous item.
public
prev() : mixed
random()
Pick one or more random entries.
public
random([int $num = 1 ]) : $this
Parameters
- $num : int = 1
-
Specifies how many entries should be picked.
Return values
$thisremove()
Remove item from the list.
public
remove(string $key) : void
Parameters
- $key : string
reverse()
Reverse the Iterator
public
reverse() : $this
Return values
$thisshuffle()
Shuffle items.
public
shuffle() : $this
Return values
$thisslice()
Slice the list.
public
slice(int $offset[, int|null $length = null ]) : $this
Parameters
- $offset : int
- $length : int|null = null
Return values
$thissort()
Sorts elements from the list and returns a copy of the list in the proper order
public
sort([callable|null $callback = null ][, bool $desc = false ]) : $this|array<string|int, mixed>
Parameters
- $callback : callable|null = null
- $desc : bool = false
Return values
$this|array<string|int, mixed>toArray()
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toJson()
public
toJson() : string