Skip to content

Commit 1e3ce03

Browse files
committed
Minor improvements
1 parent 9285aa6 commit 1e3ce03

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ Sets or returns the seperator for paths to values in multi-dimensional arrays or
16561656
public static function delimiter( ?string $char = null ) : string
16571657
```
16581658

1659-
* @param **string** `$char` Separator character, e.g. "." for "key.to.value" instaed of "key/to/value"
1659+
* @param **string|null** `$char` Separator character, e.g. "." for "key.to.value" instaed of "key/to/value"
16601660
* @return **string** Separator used up to now
16611661

16621662
The static method only changes the separator for new maps created afterwards.
@@ -3128,12 +3128,12 @@ Map::from( ['foo', 'bar'] )->insertAfter( null, 'baz' );
31283128
Inserts the item at the given position in the map.
31293129

31303130
```php
3131-
public function insertAt( int $pos, $element, $key = null ) : self
3131+
public function insertAt( int $pos, $value, $key = null ) : self
31323132
```
31333133

3134-
* @param **int** `$pos` Position the element it should be inserted at
3135-
* @param **mixed** `$element` Element to be inserted
3136-
* @param **mixed|null** `$key` Element key or NULL to assign an integer key automatically
3134+
* @param **int** `$pos` Position the value should be inserted at
3135+
* @param **mixed** `$value` Value to be inserted
3136+
* @param **mixed|null** `$key` Value key or NULL to assign an integer key automatically
31373137
* @return **self<int|string,mixed>** Updated map for fluid interface
31383138

31393139
**Examples:**

src/Map.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,26 +2439,26 @@ public function insertAfter( $element, $value ) : self
24392439
* ['a' => 'foo', 'b' => 'bar', 'c' => 'baz']
24402440
* ['a' => 'foo', 'c' => 'baz', 'b' => 'bar']
24412441
*
2442-
* @param int $pos Position the element it should be inserted at
2443-
* @param mixed $element Element to be inserted
2444-
* @param mixed|null $key Element key or NULL to assign an integer key automatically
2442+
* @param int $pos Position the value should be inserted at
2443+
* @param mixed $value Value to be inserted
2444+
* @param mixed|null $key Value key or NULL to assign an integer key automatically
24452445
* @return self<int|string,mixed> Updated map for fluid interface
24462446
*/
2447-
public function insertAt( int $pos, $element, $key = null ) : self
2447+
public function insertAt( int $pos, $value, $key = null ) : self
24482448
{
24492449
if( $key !== null )
24502450
{
24512451
$list = $this->list();
24522452

24532453
$this->list = array_merge(
24542454
array_slice( $list, 0, $pos, true ),
2455-
[$key => $element],
2455+
[$key => $value],
24562456
array_slice( $list, $pos, null, true )
24572457
);
24582458
}
24592459
else
24602460
{
2461-
array_splice( $this->list(), $pos, 0, [$element] );
2461+
array_splice( $this->list(), $pos, 0, [$value] );
24622462
}
24632463

24642464
return $this;

0 commit comments

Comments
 (0)