It seems that you can't configure that.
https://mlocati.github.io/php-cs-fixer-configurator/#version:3.59|fixer:single_line_empty_body
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Here is the code for my pint.json file:
{
"preset": "laravel",
"rules": {
"not_operator_with_successor_space": false,
"concat_space": {
"spacing": "one"
},
"class_attributes_separation": {
"elements": {
"method": "one"
}
},
"array_syntax": {
"syntax": "short"
},
"list_syntax": {
"syntax": "long"
},
"braces": {
"position_after_functions_and_oop_constructs": "next"
}
}
}
The project has this code:
namespace App\Providers;
class SomeClass1
{
public function register(): void
{
}
}
Laravel Pint changes it to this code:
class SomeClass1
{
public function register(): void {}
}
The same goes for the class. The project has this code:
class SomeClass2
{
}
Laravel Pint changes it to this code:
class SomeClass2 {}
I do not like it. I want the formatting of empty classes and methods to look the same as non-empty ones. How can I prevent Laravel Pint from removing newlines from empty methods and classes?
Please or to participate in this conversation.