Break long lines and complex structures across multiple lines to improve code readability. Follow these guidelines: 1. Keep line length around 80 characters (soft limit)
Break long lines and complex structures across multiple lines to improve code readability. Follow these guidelines:
Example of proper formatting:
/**
* This is a long docblock description that would exceed
* the 80 character limit if written on a single line.
*
* @param string $param Description of the parameter
*/
public function example($param)
{
$data = [
'first_key' => 'value1',
'second_key' => 'value2',
'third_key' => 'value3',
];
$object->methodOne()
->methodTwo()
->methodThree();
}
Instead of:
/** This is a long docblock description that would exceed the 80 character limit if written on a single line. */
public function example($param)
{
$data = ['first_key' => 'value1', 'second_key' => 'value2', 'third_key' => 'value3'];
$object->methodOne()->methodTwo()->methodThree();
}
Enter the URL of a public GitHub repository