Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced map with reduce to pass changed values. #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elnur-ibr
Copy link

While using two or more dependent callback on define it was not passing already resolved data.

class UserStoreRequestFactory extends RequestFactory
{
    public function definition(): array
    {
        return [
            'name'       => $this->faker()->name,
            'status'     => 'active',
            'email'      => $this->faker()->email,
            'level'      => 1,
            'client_ids' => fn (array $data) => [1,2,3],
            'brand_ids'  => fn (array $data) => $this->getBrandIds(data['client_ids']),
        ];
    }
}

public function getBrandIds(array $clientIds)

It was throwing error Argument #1 ($clientIds) must be of type array, Closure given, called in

@etibarrustam
Copy link

I am facing the same issue. Can it be fixed, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants