Checks that lines do not exceed a specified maximum length. Provides options to exclude files by pattern and ignore specific types of lines (use statements, namespace declarations, docblocks).
-
class: Phauthentic\PHPStanRules\CleanCode\MaxLineLengthRule
arguments:
maxLineLength: 80
excludePatterns: ['/.*\.generated\.php$/', '/.*vendor.*/']
ignoreUseStatements: false
ignoreLineTypes:
useStatements: true
namespaceDeclaration: true
docBlocks: true
tags:
- phpstan.rules.rule -
class: Phauthentic\PHPStanRules\CleanCode\MaxLineLengthRule
arguments:
maxLineLength: 80
excludePatterns: []
ignoreUseStatements: true
tags:
- phpstan.rules.rulemaxLineLength: Maximum allowed line length in characters (required).excludePatterns: Array of regex patterns to exclude files from checking (optional, default:[]).ignoreUseStatements: Whether to ignore use statement lines (optional, default:false). Note: This parameter is maintained for backward compatibility. When set totrue, it takes precedence over theignoreLineTypesarray.ignoreLineTypes: Array of line types to ignore when checking line length (optional, default:[]). Available options:useStatements: Ignore lines containingusestatementsnamespaceDeclaration: Ignore lines containingnamespacedeclarationsdocBlocks: Ignore lines that are part of docblock comments (/** ... */)
ignoreLineTypes:
useStatements: trueignoreLineTypes:
namespaceDeclaration: true
docBlocks: trueignoreLineTypes:
useStatements: true
namespaceDeclaration: true
docBlocks: true