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

Simplify hasFlags function for FlagBag. #240

Open
laurentmuller opened this issue Jan 20, 2025 · 0 comments
Open

Simplify hasFlags function for FlagBag. #240

laurentmuller opened this issue Jan 20, 2025 · 0 comments

Comments

@laurentmuller
Copy link
Contributor

The function hasFlags() in the FlagBag class can be simplified. We can call the hasBits() function:

public function hasFlags(\BackedEnum ...$flags): bool
{
    $bits = static::encodeBits(array_map(static fn (\BackedEnum $flag) => $flag->value, $flags));

    return $this->hasBits($bits);
}
ogizanagi added a commit that referenced this issue Jan 21, 2025
This PR was merged into the 2.x-dev branch.

Discussion
----------

Simplified hasFlags.

This a PR for #240.

Commits
-------

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

No branches or pull requests

1 participant