## Why is this an issue?

Explicitly declaring method visibility provides clarity and improves code readability. This leads to:

- Simplifying access to and use of the methods for other developers, enhancing the maintainability of the codebase.
- Promoting the principle of encapsulation, allowing you to control the accessibility of methods and prevent unintended access or modifications from external code.

By explicitly stating the visibility, you establish a clear contract for how the methods should be interacted with, making it easier to understand and reason about the behavior of the code.

Available access modifiers are:

- `private` - access allowed only within the same class
- `protected` - access allowed to the class and its child classes
- `public` - unfettered access by all (default)

## How to fix it

### Code examples

#### Noncompliant code example

    function foo(){...}

#### Compliant solution

    private function foo(){...}

## Resources

### Documentation

- PHP Manual - Visibility
- W3Schools - Access Modifiers