Back to all reviewers

Split for better readability

getsentry/sentry-php
Based on 11 comments
PHP

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)

Code Style PHP

Reviewer Prompt

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)
  2. Split docblocks and comments across multiple lines
  3. Break down complex arrays and method chains
  4. Format related elements consistently

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();
}
11
Comments Analyzed
PHP
Primary Language
Code Style
Category

Source Discussions