src/MacroProcessor.php
private function callHandlers(string $keyword, int $strategy)
    {
        if ($this->handlers)
        {
            $stack = null;
            foreach($this->handlers as $handler){
                $replace = $handler($keyword);
                if (!is_null($replace)){
                    if ($strategy === EnumMacroProcessStorategy::STRATEGY_FISRT){
                        return $replace;
                    }
                    $stack[] = $replace;
                }
            }
            if ($strategy === EnumMacroProcessStorategy::STRATEGY_LAST && !empty($stack)){
                return array_pop($stack);
            }
        }
        return null;
    }
private function callHandlers(string $keyword, int $strategy)
    {
        if ($this->handlers)
        {
            $stack = null;
            foreach($this->handlers as $handler){
                $replace = $handler($keyword);
                if (!is_null($replace)){
                    if ($strategy === EnumMacroProcessStorategy::STRATEGY_FISRT){
                        return $replace;
                    }
                    $stack[] = $replace;
                }
            }
            if ($strategy === EnumMacroProcessStorategy::STRATEGY_LAST && !empty($stack)){
                return array_pop($stack);
            }
        }
        return null;
    }
private function callHandlers ( string $ keyword , int $ strategy ) { if ( $ this -> handlers ) { $ stack = null ; foreach ( $ this -> handlers as $ handler ) { $ replace = $ handler ( $ keyword ) ; if ( ! is_null ( $ replace ) ) { if ( $ strategy === EnumMacroProcessStorategy :: STRATEGY_FISRT ) { return $ replace ; } $ stack [ ] = $ replace ; } } if ( $ strategy === EnumMacroProcessStorategy :: STRATEGY_LAST && ! empty ( $ stack ) ) { return array_pop ( $ stack ) ; } } return null ; }
Callback all handlers

@param string $keyword
@param int $strategy

@return bool|string
Callback all handlers