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

set modifiers of all final enum constants to be public #183

Conversation

pepijnolivier
Copy link

Hi thanks for bringing this package up to date 🙏

I wanted to filter some indexes using the Enum variable for IndexType (eg IndexType::primary) but noticed that these modifiers were all set to private, which means they are only accessible in their own namespace.

These are constant anyway, so I figured it would make sense to make all of these Enums public.

Having these public would make me allow to filter the primary keys on a table like such:

$primaryKeys = $table->getIndexes()->filter(function($index) {
    return $index->getType() == IndexType::PRIMARY;
});

@pepijnolivier
Copy link
Author

Nevermind, read the docs in the Enum dependency and realized I should just use IndexType::PRIMARY() rather than IndexType::PRIMARY 👍

@pepijnolivier pepijnolivier deleted the feature/public-enum-modifiers branch June 1, 2023 02:53
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

Successfully merging this pull request may close these issues.

None yet

1 participant