Skip to content

Commit

Permalink
Use same parameter names in stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Dec 12, 2023
1 parent f268dfa commit 761f390
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
18 changes: 9 additions & 9 deletions stubs/CoreGenericClasses.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -158,46 +158,46 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
* Returns whether the requested index exists
* @link http://php.net/manual/en/arrayobject.offsetexists.php
*
* @param TKey $index The index being checked.
* @param TKey $offset The index being checked.
* @return bool true if the requested index exists, otherwise false
*
* @since 5.0.0
*/
public function offsetExists($index) { }
public function offsetExists($offset) { }

/**
* Returns the value at the specified index
* @link http://php.net/manual/en/arrayobject.offsetget.php
*
* @param TKey $index The index with the value.
* @param TKey $offset The index with the value.
* @return TValue The value at the specified index or false.
*
* @since 5.0.0
*/
public function offsetGet($index) { }
public function offsetGet($offset) { }

/**
* Sets the value at the specified index to newval
* @link http://php.net/manual/en/arrayobject.offsetset.php
*
* @param TKey $index The index being set.
* @param TValue $newval The new value for the index.
* @param TKey $offset The index being set.
* @param TValue $value The new value for the index.
* @return void
*
* @since 5.0.0
*/
public function offsetSet($index, $newval) { }
public function offsetSet($offset, $value) { }

/**
* Unsets the value at the specified index
* @link http://php.net/manual/en/arrayobject.offsetunset.php
*
* @param TKey $index The index being unset.
* @param TKey $offset The index being unset.
* @return void
*
* @since 5.0.0
*/
public function offsetUnset($index) { }
public function offsetUnset($offset) { }

/**
* Appends the value
Expand Down
18 changes: 9 additions & 9 deletions stubs/CoreGenericIterators.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -185,30 +185,30 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Coun
public function __construct($array = array(), $flags = 0) { }

/**
* @param TKey $index The offset being checked.
* @param TKey $offset The offset being checked.
* @return bool true if the offset exists, otherwise false
*/
public function offsetExists($index) { }
public function offsetExists($offset) { }

/**
* @param TKey $index The offset to get the value from.
* @param TKey $offset The offset to get the value from.
* @return TValue|null The value at offset index, null when accessing invalid indexes
* @psalm-ignore-nullable-return
*/
public function offsetGet($index) { }
public function offsetGet($offset) { }

/**
* @param TKey $index The index to set for.
* @param TValue $newval The new value to store at the index.
* @param TKey $offset The index to set for.
* @param TValue $value The new value to store at the index.
* @return void
*/
public function offsetSet($index, $newval) { }
public function offsetSet($offset, $value) { }

/**
* @param TKey $index The offset to unset.
* @param TKey $offset The offset to unset.
* @return void
*/
public function offsetUnset($index) { }
public function offsetUnset($offset) { }

/**
* @param TValue $value The value to append.
Expand Down
52 changes: 26 additions & 26 deletions stubs/SPL.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializa
/**
* Add/insert a new value at the specified index
*
* @param int $index The index where the new value is to be inserted.
* @param TValue $newval The new value for the index.
* @param int $offset The index where the new value is to be inserted.
* @param TValue $value The new value for the index.
* @return void
*
* @link https://php.net/spldoublylinkedlist.add
* @since 5.5.0
*/
public function add($index, $newval) {}
public function add($offset, $value) {}

/**
* Pops a node from the end of the doubly linked list
Expand Down Expand Up @@ -107,49 +107,49 @@ class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializa
public function isEmpty() {}

/**
* Returns whether the requested $index exists
* Returns whether the requested $offset exists
* @link https://php.net/manual/en/spldoublylinkedlist.offsetexists.php
*
* @param int $index The index being checked.
* @param int $offset The index being checked.
* @return bool true if the requested index exists, otherwise false
*
* @since 5.3.0
*/
public function offsetExists($index) {}
public function offsetExists($offset) {}

/**
* Returns the value at the specified $index
* Returns the value at the specified $offset
* @link https://php.net/manual/en/spldoublylinkedlist.offsetget.php
*
* @param int $index The index with the value.
* @param int $offset The index with the value.
* @return TValue The value at the specified index.
*
* @since 5.3.0
*/
public function offsetGet($index) {}
public function offsetGet($offset) {}

/**
* Sets the value at the specified $index to $newval
* Sets the value at the specified $offset to $value
* @link https://php.net/manual/en/spldoublylinkedlist.offsetset.php
*
* @param int $index The index being set.
* @param TValue $newval The new value for the index.
* @param int $offset The index being set.
* @param TValue $value The new value for the index.
* @return void
*
* @since 5.3.0
*/
public function offsetSet($index, $newval) {}
public function offsetSet($offset, $value) {}

/**
* Unsets the value at the specified $index
* Unsets the value at the specified $offset
* @link https://php.net/manual/en/spldoublylinkedlist.offsetunset.php
*
* @param int $index The index being unset.
* @param int $offset The index being unset.
* @return void
*
* @since 5.3.0
*/
public function offsetUnset($index) {}
public function offsetUnset($offset) {}

/**
* Return current array entry
Expand Down Expand Up @@ -297,46 +297,46 @@ class SplFixedArray implements Iterator, ArrayAccess, Countable {
* Returns whether the specified index exists
* @link https://php.net/manual/en/splfixedarray.offsetexists.php
*
* @param int $index The index being checked.
* @param int $offset The index being checked.
* @return bool true if the requested index exists, and false otherwise.
*
* @since 5.3.0
*/
public function offsetExists(int $index): bool {}
public function offsetExists(int $offset): bool {}

/**
* Sets a new value at a specified index
* @link https://php.net/manual/en/splfixedarray.offsetset.php
*
* @param int $index The index being sent.
* @param TValue $newval The new value for the index
* @param int $offset The index being sent.
* @param TValue $value The new value for the index
* @return void
*
* @since 5.3.0
*/
public function offsetSet(int $index, $newval): void {}
public function offsetSet(int $offset, $value): void {}

/**
* Unsets the value at the specified $index
* Unsets the value at the specified $offset
* @link https://php.net/manual/en/splfixedarray.offsetunset.php
*
* @param int $index The index being unset
* @param int $offset The index being unset
* @return void
*
* @since 5.3.0
*/
public function offsetUnset(int $index): void {}
public function offsetUnset(int $offset): void {}

/**
* Returns the value at the specified index
* @link https://php.net/manual/en/splfixedarray.offsetget.php
*
* @param int $index The index with the value
* @param int $offset The index with the value
* @return TValue The value at the specified index
*
* @since 5.3.0
*/
public function offsetGet(int $index) {}
public function offsetGet(int $offset) {}
}


Expand Down

0 comments on commit 761f390

Please sign in to comment.