diff --git a/.github/workflows/php80.yml b/.github/workflows/php80.yml deleted file mode 100644 index 7be2df5..0000000 --- a/.github/workflows/php80.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build PHP 8.0 - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: true - matrix: - os: [ ubuntu-latest ] - php: [ 8.0 ] - - name: PHP${{matrix.php}} - ${{matrix.os}} - - steps: - - name: Clone Repo - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mysqli, mbstring, sqlsrv - tools: phpunit:8.5.13 - - - name: Install Dependencies - run: composer install --prefer-dist --no-interaction --no-dev - - - name: Execute Tests - run: phpunit --configuration tests/phpunit.xml - - - name: CodeCov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/php81.yaml b/.github/workflows/php81.yaml new file mode 100644 index 0000000..fead114 --- /dev/null +++ b/.github/workflows/php81.yaml @@ -0,0 +1,26 @@ +name: Build PHP 8.1 + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + test: + name: Run Tests + uses: WebFiori/workflows/.github/workflows/test-php.yaml@main + with: + php-version: '8.1' + + code-coverage: + name: Coverage + needs: test + uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main + with: + php-version: '8.1' + coverage-file: 'php-8.1-coverage.xml' + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + + diff --git a/.github/workflows/php81.yml b/.github/workflows/php81.yml deleted file mode 100644 index 4348d47..0000000 --- a/.github/workflows/php81.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build PHP 8.1 - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: true - matrix: - os: [ ubuntu-latest ] - php: [8.1] - - name: PHP${{matrix.php}} - ${{matrix.os}} - - steps: - - name: Clone Repo - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mysqli, mbstring, sqlsrv - tools: phpunit:9.5.20, composer - - - name: Install Dependencies - run: composer install --prefer-dist --no-interaction --no-dev - - - name: Execute Tests - run: phpunit --configuration tests/phpunit.xml - - - name: CodeCov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/php82.yaml b/.github/workflows/php82.yaml new file mode 100644 index 0000000..978033a --- /dev/null +++ b/.github/workflows/php82.yaml @@ -0,0 +1,27 @@ +name: Build PHP 8.2 + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + test: + name: Run Tests + uses: WebFiori/workflows/.github/workflows/test-php.yaml@main + with: + php-version: '8.2' + phpunit-config: "tests/phpunit10.xml" + + code-coverage: + name: Coverage + needs: test + uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main + with: + php-version: '8.2' + coverage-file: 'php-8.2-coverage.xml' + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + + diff --git a/.github/workflows/php82.yml b/.github/workflows/php82.yml deleted file mode 100644 index 88753ce..0000000 --- a/.github/workflows/php82.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build PHP 8.2 - -on: - push: - branches: [ master, dev ] - pull_request: - branches: [ master ] - -jobs: - - test: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: true - matrix: - os: [ ubuntu-latest ] - php: [8.2] - - name: PHP${{matrix.php}} - ${{matrix.os}} - - steps: - - name: Clone Repo - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mysqli, mbstring, sqlsrv - tools: phpunit:9.5.20, composer, symplify/easy-coding-standard:12.0.6, phpbench/phpbench:1.2.14 - - - name: Install Dependencies - run: composer install --prefer-dist --no-interaction --no-dev - - - name: Execute Tests - run: phpunit --configuration tests/phpunit.xml - - - name: CodeCov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - diff --git a/.github/workflows/php83.yaml b/.github/workflows/php83.yaml new file mode 100644 index 0000000..8ecb808 --- /dev/null +++ b/.github/workflows/php83.yaml @@ -0,0 +1,45 @@ +name: Build PHP 8.3 + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main, dev ] +env: + OPERATING_SYS: ubuntu-latest + PHP_VERSION: 8.3 +jobs: + + test: + name: Run Tests + uses: WebFiori/workflows/.github/workflows/test-php.yaml@main + with: + php-version: '8.3' + phpunit-config: 'tests/phpunit10.xml' + + + code-coverage: + name: Coverage + needs: test + uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main + with: + php-version: '8.3' + coverage-file: 'php-8.3-coverage.xml' + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + code-quality: + name: Code Quality + needs: test + uses: WebFiori/workflows/.github/workflows/quality-sonarcloud.yaml@main + with: + coverage-file: 'php-8.3-coverage.xml' + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + release-prod: + name: Prepare Production Release Branch / Publish Release + needs: [code-coverage, code-quality] + uses: WebFiori/workflows/.github/workflows/release-php.yaml@main + with: + branch: 'main' diff --git a/.github/workflows/php83.yml b/.github/workflows/php83.yml deleted file mode 100644 index 31ae4a6..0000000 --- a/.github/workflows/php83.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Build PHP 8.3 - -on: - push: - branches: [ master, dev ] - pull_request: - branches: [ master ] - -jobs: - - test: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: true - matrix: - os: [ ubuntu-latest ] - php: [8.3] - - name: PHP${{matrix.php}} - ${{matrix.os}} - - steps: - - name: Clone Repo - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mysqli, mbstring, sqlsrv - tools: phpunit:9.5.20, composer, symplify/easy-coding-standard:12.0.6, phpbench/phpbench:1.2.14 - - - - - name: Install Dependencies - run: composer install --prefer-dist --no-interaction --no-dev - - - name: Execute Tests - run: phpunit --configuration tests/phpunit.xml - - - name: CodeCov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - - name: SonarCloud Code Scan - uses: sonarsource/sonarqube-scan-action@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - - release_prod: - name: Prepare Production Release Branch / Publish Release - needs: - - "test" - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - steps: - - uses: actions/checkout@v4 - - uses: google-github-actions/release-please-action@v3 - with: - release-type: php - config-file: release-please-config.json - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/php84.yaml b/.github/workflows/php84.yaml new file mode 100644 index 0000000..1ce3097 --- /dev/null +++ b/.github/workflows/php84.yaml @@ -0,0 +1,27 @@ +name: Build PHP 8.4 + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + test: + name: Run Tests + uses: WebFiori/workflows/.github/workflows/test-php.yaml@main + with: + php-version: '8.4' + phpunit-config: "tests/phpunit10.xml" + + code-coverage: + name: Coverage + needs: test + uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main + with: + php-version: '8.4' + coverage-file: 'php-8.4-coverage.xml' + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + + diff --git a/.github/workflows/php84.yml b/.github/workflows/php84.yml deleted file mode 100644 index deda301..0000000 --- a/.github/workflows/php84.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Build PHP 8.4 - -on: - push: - branches: [ master, dev ] - pull_request: - branches: [ master, dev ] - -jobs: - - test: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: true - matrix: - os: [ ubuntu-latest ] - php: [8.4] - - name: PHP${{matrix.php}} - ${{matrix.os}} - - steps: - - name: Clone Repo - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mysqli, mbstring, sqlsrv - tools: phpunit:9.5.20, composer, symplify/easy-coding-standard:12.0.6, phpbench/phpbench:1.2.14 - - - - - name: Install Dependencies - run: composer install --prefer-dist --no-interaction --no-dev - - - name: Execute Tests - run: phpunit --configuration tests/phpunit.xml - - - name: CodeCov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - - release_prod: - name: Prepare Production Release Branch / Publish Release - needs: - - "test" - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' - steps: - - uses: actions/checkout@v4 - - uses: google-github-actions/release-please-action@v3 - with: - release-type: php - config-file: release-please-config.json - token: ${{ secrets.GITHUB_TOKEN }} - - diff --git a/.gitignore b/.gitignore index b431711..4a838c8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ clover.xml composer.lock vendor/* .idea/* +*.Identifier diff --git a/README.md b/README.md index d9cfe96..b0ab0b6 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ Basic data structures used by WebFiori framework.
-
+
-
+
@@ -23,13 +23,287 @@ Basic data structures used by WebFiori framework.
## Supported PHP Versions
| Build Status |
|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
-|
|
-|
|
-|
|
-|
|
-|
|
+|
|
+|
|
+|
|
+|
|
## Supported Collections
* Linked List
* Stack
* Queue
+
+## Installation
+
+You can install the library through Composer:
+
+```bash
+composer require webfiori/collections
+```
+
+## Usage
+
+### LinkedList
+
+The `LinkedList` class provides a doubly-linked list implementation with full iterator support.
+
+```php
+add("First");
+$list->add("Second");
+$list->add("Third");
+
+// Access elements by index
+echo $list->get(0); // "First"
+echo $list->get(1); // "Second"
+
+// Insert at specific position
+$list->insert("Inserted", 1); // Insert at index 1
+
+// Remove elements
+$removed = $list->remove(0); // Remove first element
+$removed = $list->removeElement("Second"); // Remove by value
+
+// Check if element exists
+if ($list->contains("Third")) {
+ echo "Found Third!";
+}
+
+// Get element index
+$index = $list->indexOf("Third");
+
+// Iterate through the list
+foreach ($list as $item) {
+ echo $item . "\n";
+}
+
+// Convert to array
+$array = $list->toArray();
+
+// Sort the list (works with strings, numbers, and Comparable objects)
+$list->insertionSort(); // Ascending
+$list->insertionSort(false); // Descending
+
+// Get list size
+echo "Size: " . $list->size();
+
+// Clear all elements
+$list->clear();
+```
+
+#### LinkedList with Size Limit
+
+```php
+// Create a list with maximum 5 elements
+$limitedList = new LinkedList(5);
+
+// This will return false if limit is reached
+$success = $limitedList->add("Item");
+```
+
+### Stack
+
+The `Stack` class implements a Last-In-First-Out (LIFO) data structure.
+
+```php
+push("Bottom");
+$stack->push("Middle");
+$stack->push("Top");
+
+// Peek at the top element without removing it
+echo $stack->peek(); // "Top"
+
+// Pop elements from the stack
+$top = $stack->pop(); // "Top"
+$middle = $stack->pop(); // "Middle"
+
+// Check stack size
+echo "Size: " . $stack->size();
+
+// Convert to array
+$array = $stack->toArray();
+
+// You can also use add() method (alias for push)
+$stack->add("New Top");
+```
+
+#### Stack with Size Limit
+
+```php
+// Create a stack with maximum 10 elements
+$limitedStack = new Stack(10);
+
+// This will return false if limit is reached
+$success = $limitedStack->push("Item");
+```
+
+### Queue
+
+The `Queue` class implements a First-In-First-Out (FIFO) data structure.
+
+```php
+enqueue("First");
+$queue->enqueue("Second");
+$queue->enqueue("Third");
+
+// Peek at the front element without removing it
+echo $queue->peek(); // "First"
+
+// Dequeue elements
+$first = $queue->dequeue(); // "First"
+$second = $queue->dequeue(); // "Second"
+
+// Check queue size
+echo "Size: " . $queue->size();
+
+// Convert to array
+$array = $queue->toArray();
+
+// You can also use add() method (alias for enqueue)
+$queue->add("Fourth");
+```
+
+#### Queue with Size Limit
+
+```php
+// Create a queue with maximum 100 elements
+$limitedQueue = new Queue(100);
+
+// This will return false if limit is reached
+$success = $limitedQueue->enqueue("Item");
+```
+
+## Advanced Usage
+
+### Custom Object Sorting
+
+To sort custom objects in a LinkedList, implement the `Comparable` interface:
+
+```php
+name = $name;
+ $this->age = $age;
+ }
+
+ public function compare($other): int {
+ if (!($other instanceof Person)) {
+ return 1;
+ }
+
+ // Compare by age
+ if ($this->age == $other->age) {
+ return 0;
+ }
+
+ return $this->age > $other->age ? 1 : -1;
+ }
+
+ public function getName() {
+ return $this->name;
+ }
+
+ public function getAge() {
+ return $this->age;
+ }
+}
+
+// Usage
+$list = new LinkedList();
+$list->add(new Person("Alice", 30));
+$list->add(new Person("Bob", 25));
+$list->add(new Person("Charlie", 35));
+
+// Sort by age
+$list->insertionSort(); // Ascending by age
+```
+
+### Working with References
+
+All collections work with references, allowing you to modify objects after adding them:
+
+```php
+$data = ["key" => "value"];
+$list = new LinkedList();
+$list->add($data);
+
+// Modify the original data
+$data["key"] = "modified";
+
+// The list contains the modified data
+$retrieved = $list->get(0);
+echo $retrieved["key"]; // "modified"
+```
+
+## API Reference
+
+### Common Methods (All Collections)
+
+- `add(&$element): bool` - Add an element to the collection
+- `size(): int` - Get the number of elements
+- `toArray(): array` - Convert collection to array
+- `count(): int` - Get element count (implements Countable)
+
+### LinkedList Specific Methods
+
+- `get($index): mixed` - Get element at index
+- `getFirst(): mixed` - Get first element
+- `getLast(): mixed` - Get last element
+- `remove($index): mixed` - Remove element at index
+- `removeFirst(): mixed` - Remove first element
+- `removeLast(): mixed` - Remove last element
+- `removeElement(&$element): mixed` - Remove specific element
+- `insert(&$element, $position): bool` - Insert at position
+- `indexOf($element): int` - Find element index
+- `contains(&$element): bool` - Check if element exists
+- `countElement(&$element): int` - Count occurrences
+- `replace(&$old, &$new): bool` - Replace element
+- `insertionSort($ascending = true): bool` - Sort elements
+- `clear(): void` - Remove all elements
+- `max(): int` - Get maximum capacity (-1 for unlimited)
+
+### Stack Specific Methods
+
+- `push($element): bool` - Add element to top
+- `pop(): mixed` - Remove and return top element
+- `peek(): mixed` - View top element without removing
+- `max(): int` - Get maximum capacity (-1 for unlimited)
+
+### Queue Specific Methods
+
+- `enqueue($element): bool` - Add element to rear
+- `dequeue(): mixed` - Remove and return front element
+- `peek(): mixed` - View front element without removing
+- `max(): int` - Get maximum capacity (-1 for unlimited)
+
+
+## License
+
+This library is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
diff --git a/webfiori/collections/AbstractCollection.php b/WebFiori/Collections/AbstractCollection.php
similarity index 90%
rename from webfiori/collections/AbstractCollection.php
rename to WebFiori/Collections/AbstractCollection.php
index 87a5057..f05612d 100644
--- a/webfiori/collections/AbstractCollection.php
+++ b/WebFiori/Collections/AbstractCollection.php
@@ -8,14 +8,13 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\collections;
+namespace WebFiori\Collections;
use Countable;
/**
* A base class that can be used to create different collections.
*
* @author Ibrahim
- * @version 1.0
*/
abstract class AbstractCollection implements Countable {
public static $NULL = null;
@@ -55,18 +54,14 @@ public function __toString() {
*
* @return bool The method should be implemented in a way that it returns
* true if the element is added and returns false otherwise.
- *
- * @since 1.0
*/
public abstract function add(&$el);
/**
* Returns the number of elements in the collection.
*
- * This one is similar to calling the method "AbstractCollection::size()".
+ * This one is similar to calling the method AbstractCollection::size().
*
* @return int Number of elements in the collection.
- *
- * @since 1.0
*/
public function count() : int {
return $this->size();
@@ -75,16 +70,12 @@ public function count() : int {
* Returns the number of elements in the collection.
*
* @return int The number of elements in the collection.
- *
- * @since 1.0
*/
public abstract function size() : int ;
/**
* Returns an array that contains the elements of the collection.
*
* @return array An array that contains the elements of the collection.
- *
- * @since 1.0
*/
public abstract function toArray() : array;
}
diff --git a/webfiori/collections/Comparable.php b/WebFiori/Collections/Comparable.php
similarity index 92%
rename from webfiori/collections/Comparable.php
rename to WebFiori/Collections/Comparable.php
index 508f1e6..0bd4c8c 100644
--- a/webfiori/collections/Comparable.php
+++ b/WebFiori/Collections/Comparable.php
@@ -8,15 +8,13 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\collections;
+namespace WebFiori\Collections;
/**
* An interface that is used to compare objects. It is used by the class
* LinkedList's sorting method in order to compare objects.
*
* @author Ibrahim
- *
- * @version 1.0
*/
interface Comparable {
/**
@@ -31,8 +29,6 @@ interface Comparable {
* with.
*
* @return int Negative value, 0 or positive value.
- *
- * @since 1.0
*/
public function compare($other) : int;
}
diff --git a/webfiori/collections/LinkedList.php b/WebFiori/Collections/LinkedList.php
similarity index 96%
rename from webfiori/collections/LinkedList.php
rename to WebFiori/Collections/LinkedList.php
index c1c22c4..2b8c11f 100644
--- a/webfiori/collections/LinkedList.php
+++ b/WebFiori/Collections/LinkedList.php
@@ -9,60 +9,47 @@
*
*/
-namespace webfiori\collections;
+namespace WebFiori\Collections;
use Iterator;
/**
* A class that represents a linked list data structure.
*
* @author Ibrahim
- * @version 1.4.3
*/
class LinkedList extends AbstractCollection implements Iterator {
/**
* The first node in the list.
*
- * @var Node
- *
- * @since 1.0
+ * @var Node|null
*/
private $head;
/**
* A node which is used for iterator related methods.
*
- * @var Node
- *
- * @since 1.4.3
+ * @var Node|null
*/
private $iteratorEl;
/**
* The maximum number of elements the list can have.
*
* @var int
- *
- * @since 1.4.1
*/
private $maxEls;
/**
* A null guard for the methods that return null reference.
- *
- * @since 1.4
*/
private $null;
/**
* The number of elements in the node.
*
* @var int
- *
- * @since 1.0
*/
private $size;
/**
* The last node in the list.
*
- * @var Node
- *
- * @since 1.0
+ * @var Node|null
*/
private $tail;
/**
@@ -71,7 +58,6 @@ class LinkedList extends AbstractCollection implements Iterator {
* @param int $max The maximum number of elements that the list can hold.
* If 0 or a negative number is given, the list will be able to hold
* unlimited number of elements.
- *
*/
public function __construct($max = 0) {
$this->null = null;
@@ -88,11 +74,11 @@ public function __construct($max = 0) {
/**
* Returns the element at the specified index.
*
+ * @param int $index The index of the element to retrieve.
+ *
* @return mixed The element at the specified index. If the list
* is empty or the given index is out of list bounds, The method will
* return null.
- *
- * @since 1.1
*/
public function &get($index) {
if (gettype($index) == 'integer' && $index < $this->size() && $index > -1) {
@@ -127,8 +113,6 @@ public function &get($index) {
*
* @return mixed The method will return The element after removal if the given element
* is removed. Other than that, the method will return null.
- *
- * @since 1.0
*/
public function &removeElement(&$val) {
if ($this->size() == 1) {
@@ -152,8 +136,6 @@ public function &removeElement(&$val) {
*
* @return mixed If the list has elements, the last element is returned.
* If the list is empty, the method will return null.
- *
- * @since 1.0
*/
public function &removeLast() {
if ($this->size() == 1) {
@@ -181,8 +163,6 @@ public function &removeLast() {
*
* @return mixed If the list has elements, the first element is returned.
* If the list is empty, the method will return null.
- *
- * @since 1.0
*/
public function &removeFirst() {
if ($this->size() == 1) {
@@ -213,8 +193,6 @@ public function &removeFirst() {
* @param int $index The index of the element.
*
* @return mixed The element that was removed. null if no element is removed.
- *
- * @since 1.0
*/
public function &remove($index) {
if (gettype($index) == 'integer' && $index < $this->size() && $index > -1) {
@@ -249,8 +227,6 @@ public function &remove($index) {
*
* @return mixed The first element that was added to the list. If the list
* is empty, The method will return null.
- *
- * @since 1.1
*/
public function &getFirst() {
if ($this->size() >= 1) {
@@ -265,8 +241,6 @@ public function &getFirst() {
*
* @return mixed The last element that was added to the list. If the list
* is empty, The method will return null.
- *
- * @since 1.1
*/
public function &getLast() {
if ($this->size() == 1) {
@@ -287,8 +261,6 @@ public function &getLast() {
* @return bool true if the element is added. The method will return
* false only if the list accepts a limited number of elements and that
* number has been reached.
- *
- * @since 1.0
*/
public function add(&$el) : bool {
if ($this->validateSize()) {
@@ -321,8 +293,6 @@ public function add(&$el) : bool {
}
/**
* Removes all the elements from the list.
- *
- * @since 1.1
*/
public function clear() {
$this->head = null;
@@ -339,8 +309,6 @@ public function clear() {
*
* @return bool true if the element is on the list. Other than that,
* the method will return false.
- *
- * @since 1.0
*/
public function contains(&$el) : bool {
if ($this->size() == 0) {
@@ -367,8 +335,6 @@ public function contains(&$el) : bool {
*
* @return int The number of times the element has appeared on the list. If
* the element does not exist, 0 is returned.
- *
- * @since 1.0
*/
public function countElement(&$el) : int {
$count = 0;
@@ -397,8 +363,6 @@ public function countElement(&$el) : int {
* is doing.
*
* @return mixed The element that the iterator is currently is pointing to.
- *
- * @since 1.4.3
*/
public function current() {
if ($this->iteratorEl !== null) {
@@ -418,8 +382,6 @@ public function current() {
*
* @return int The index of the element if found. If the list does not contain
* the element or is empty, the method will return -1.
- *
- * @since 1.2
*/
public function indexOf($el) : int {
if ($this->size() == 1) {
@@ -515,7 +477,7 @@ public function insert(&$el,$position) : bool {
*