Closed victorelec14 closed 1 year ago
I Tink that this MR will give more compatibility between Psysh and Laravel / Pint by allowing the brackets to be on a new line.
In itself, that is not a problem from Psysh as @bobthecow explained in this post:
https://github.com/laravel/tinker/issues/161#issuecomment-1481037313
This MR has breaking changes that will make semicolons mandatory in Tinker, but it's something we're used to by now.
User::all()
It will always have to be with a semicolon at the end
User::all();
The list of Psysh options is here: https://github.com/bobthecow/psysh/wiki/Config-options#-config-options
$data = [ "1111", "2222", "3333", "4444", ]; foreach ($data as $pos) { echo $pos . "\n"; }
Result:
4444
Now with the curly backet in the same line of the foreach
$data = [ "1111", "2222", "3333", "4444", ]; foreach ($data as $pos){ echo $pos . "\n"; }`
Result :
1111 2222 3333 4444
Thanks
I don't want semicolons to be mandatory?
This is very much a matter of user preference and should be specified by users, not by the framework. The defaults are good 🙂
I Tink that this MR will give more compatibility between Psysh and Laravel / Pint by allowing the brackets to be on a new line.
In itself, that is not a problem from Psysh as @bobthecow explained in this post:
https://github.com/laravel/tinker/issues/161#issuecomment-1481037313
This MR has breaking changes that will make semicolons mandatory in Tinker, but it's something we're used to by now.
It will always have to be with a semicolon at the end
The list of Psysh options is here: https://github.com/bobthecow/psysh/wiki/Config-options#-config-options
Test Data:
Result:
Now with the curly backet in the same line of the foreach
Result :
Thanks