Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 354 Bytes

hyrule-if.md

File metadata and controls

14 lines (12 loc) · 354 Bytes

Hyrule::if()

Applies a builder function if a condition is met:

$builder
    ->integer('quantity');
        ->with(Hyrule::if($lowStock, static function (IntegerNode $qty) {
            $qty->max(2)
                ->rule(new HasntOrderedWithinLast7DaysRule());
        }))
        ->required();
        ->end()
    ->string('...') // etc.