What are the best practices for formatting PHP code, especially when dealing with functions and conditional statements like switch cases?

When formatting PHP code, it's important to maintain consistency and readability for easier debugging and maintenance. For functions and conditional statements like switch cases, it's recommended to use proper indentation, braces on new lines, and clear spacing between elements to improve code clarity.

// Example of well-formatted PHP code for a function and switch case

function processInput($input) {
    switch ($input) {
        case 'A':
            echo 'Input is A';
            break;
        case 'B':
            echo 'Input is B';
            break;
        default:
            echo 'Input is not recognized';
    }
}

$input = 'A';
processInput($input);