Skip to content

Commit

Permalink
up: update a collection method and ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Nov 10, 2023
1 parent 1cc3206 commit d439fda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1]
php: [8.0, 8.1, 8.2]
os: [ubuntu-latest, macOS-latest] # windows-latest,
# include: # will not testing on php 7.2
# - os: 'ubuntu-latest'
Expand Down Expand Up @@ -54,4 +54,4 @@ jobs:
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: phpunit -v --debug
run: phpunit
12 changes: 6 additions & 6 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,23 @@ public function setKeyPathSep(string $keyPathSep): void
}

/**
* @param array|Traversable $data
* @param iterable $data
*
* @return $this
*/
public function load(array|Traversable $data): self
public function load(iterable $data): self
{
$this->bindData($this->data, $data);

return $this;
}

/**
* @param array|Traversable $data
* @param iterable $data
*
* @return $this
*/
public function loadData(array|Traversable $data): self
public function loadData(iterable $data): self
{
$this->bindData($this->data, $data);

Expand All @@ -147,10 +147,10 @@ public function loadData(array|Traversable $data): self

/**
* @param array $parent
* @param array|Traversable $data
* @param iterable $data
* @param int $depth
*/
protected function bindData(array &$parent, array|Traversable $data, int $depth = 1): void
protected function bindData(array &$parent, iterable $data, int $depth = 1): void
{
foreach ($data as $key => $value) {
if ($value === null) {
Expand Down

0 comments on commit d439fda

Please sign in to comment.