private function clearEmptyGroups()
    {
        foreach (Craft::$app->fields->getAllGroups() as $group) {
            if (count($group->getFields()) == 0) {
                Craft::$app->fields->deleteGroup($group);
            }
        }
    }
private function clearEmptyGroups()
    {
        foreach (Craft::$app->fields->getAllGroups() as $group) {
            if (count($group->getFields()) == 0) {
                Craft::$app->fields->deleteGroup($group);
            }
        }
    }
private function clearEmptyGroups ( ) { foreach ( Craft :: $ app -> fields -> getAllGroups ( ) as $ group ) { if ( count ( $ group -> getFields ( ) ) == 0 ) { Craft :: $ app -> fields -> deleteGroup ( $ group ) ; } } }
Clear empty field groups
Clear empty field groups