public function check($budgets, \DateTimeImmutable $date)
    {
        foreach ($budgets as $budget) {
            $this->checkBudget($budget, $date);

            if ($budget->hasChildren()) {
                foreach ($budget->getChildren() as $child) {
                    $this->checkBudget($child, $date);
                }
            }
        }
    }
public function check($budgets, \DateTimeImmutable $date)
    {
        foreach ($budgets as $budget) {
            $this->checkBudget($budget, $date);

            if ($budget->hasChildren()) {
                foreach ($budget->getChildren() as $child) {
                    $this->checkBudget($child, $date);
                }
            }
        }
    }
public function check ( $ budgets , \ DateTimeImmutable $ date ) { foreach ( $ budgets as $ budget ) { $ this -> checkBudget ( $ budget , $ date ) ; if ( $ budget -> hasChildren ( ) ) { foreach ( $ budget -> getChildren ( ) as $ child ) { $ this -> checkBudget ( $ child , $ date ) ; } } } }
Check for new budget month to add

@param  Budget[] $budgets
@param  \DateTimeImmutable $date
@return BudgetMonth[]
Check for new budget month to add