-1

Php-cs-fixer returns the error 'braces' for one of the files. The following code causes the problem:

$meetings = Meeting::where(function ($query) use ($meeting_type_id) {
    //doSomething
});

Php-cs-fixer uses the default psr1, psr2 rules (vendor/bin/php-cs-fixer fix --dry-run --verbose --format=txt).

How do i make this code pass the php-cs-fixer?

ndm
  • 59,784
  • 9
  • 71
  • 110

1 Answers1

0

It worked by assigning the function to a variable and use this as an argument. Idkw.

$queryFunction = function ($query) use ($meeting_type_id) {
        //doSomething
};

$meetings = Meeting::where($queryFunction);