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

Added new Arr::notAccessible($value) function. Tests are added. #53272

Closed
wants to merge 2 commits into from

Conversation

mdariftiens
Copy link
Contributor

@mdariftiens mdariftiens commented Oct 22, 2024

Summary:

This pull request introduces a new static method Arr::notAccessible() to the Arr utility class, along with a comprehensive set of unit tests to verify its functionality. This method checks whether a given value is not accessible as an array.

Key Changes:

New Method: Arr::notAccessible($value)

This method is a simple inverse of the existing Arr::accessible($value) method. It returns true if the value is not accessible as an array and false if it is.
The method helps to simplify the logic when checking non-array-accessible types, enhancing code readability.

Unit Tests:

Added a suite of tests for the Arr::notAccessible() method.
Tests cover various data types to ensure that the method behaves correctly in different scenarios, including arrays, collections, objects, primitives, and anonymous functions.

No Breaking Changes

This addition does not alter any existing functionality

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

@mdariftiens mdariftiens deleted the NotAccessible branch October 23, 2024 13:39
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.

2 participants