-
-
Notifications
You must be signed in to change notification settings - Fork 147
Closed
Description
Version: 3.2.*
Bug Description
Wrapping condition ignore the length of the property name and needed characters $ = []
https://github.com/nette/php-generator/blob/master/src/PhpGenerator/Helpers.php#L97
Steps To Reproduce
Actual generator produce code:
/** @var int[] */
public $terminalsValues = ['true' => 3, 'false' => 4, 'null' => 5, '{' => 6, '}' => 7, ',' => 8, ':' => 9, '[' => 10, ']' => 11];Expected Behavior
Generate code:
/** @var int[] */
public $terminalsValues = [
'true' => 3,
'false' => 4,
'null' => 5,
'{' => 6,
'}' => 7,
',' => 8,
':' => 9,
'[' => 10,
']' => 11
];Possible Solution
Add possibility to modify Helper::WRAP_LENGTH by custom length that will be filled here by str_len($property->getName()) + 6
Metadata
Metadata
Assignees
Labels
No labels