Always be explicit and consistent when handling null values to improve code clarity and prevent subtle bugs. This applies to null checks, nullable type declarations, and function parameters.

For null checks:

For type declarations:

For function parameters:

// Bad
public function doSomething($client)
{
    if ($client) {
        // ...
    }
}

// Good
public function doSomething(?ClientInterface $client = null): ?string
{
    if (null !== $client) {
        // ...
    }
}

This pattern makes intent clear, improves static analysis capabilities, and provides better autocomplete support in IDEs. It also prevents confusion between false, empty strings, zero, and null values in conditionals.