Give your SQL string a formatted structure on output with SQLFormatter

Code
<?php

use Doctrine\SqlFormatter\SqlFormatter;

$sql 'select id, name, feathers, color from budgy where dirt_level > 50';
$sql .= ' group by flock order by cage_id';

echo (new 
SqlFormatter())->format($sql);
Result
select
  id,
  name,
  feathers,
  color
from
  budgy
where
  dirt_level > 50
group by
  flock
order by
  cage_id
Used Versions
PHP 8.0, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8