src/Invoice/CompletorStrategyBase.php
public function apply()
    {
        $this->replacingLines = array();
        $this->init();
        if ($this->checkPreconditions()) {
            return $this->execute();
        } else {
            if (!empty($this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyPreconditionFailed])) {
                $this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyPreconditionFailed] .= ', ';
            } else {
                $this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyPreconditionFailed] = '';
            }
            $this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyPreconditionFailed] .= $this->getName();
            return false;
        }
    }
public function apply()
    {
        $this->replacingLines = array();
        $this->init();
        if ($this->checkPreconditions()) {
            return $this->execute();
        } else {
            if (!empty($this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyPreconditionFailed])) {
                $this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyPreconditionFailed] .= ', ';
            } else {
                $this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyPreconditionFailed] = '';
            }
            $this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyPreconditionFailed] .= $this->getName();
            return false;
        }
    }
public function apply ( ) { $ this -> replacingLines = array ( ) ; $ this -> init ( ) ; if ( $ this -> checkPreconditions ( ) ) { return $ this -> execute ( ) ; } else { if ( ! empty ( $ this -> invoice [ Tag :: Customer ] [ Tag :: Invoice ] [ Meta :: CompletorStrategyPreconditionFailed ] ) ) { $ this -> invoice [ Tag :: Customer ] [ Tag :: Invoice ] [ Meta :: CompletorStrategyPreconditionFailed ] .= ', ' ; } else { $ this -> invoice [ Tag :: Customer ] [ Tag :: Invoice ] [ Meta :: CompletorStrategyPreconditionFailed ] = '' ; } $ this -> invoice [ Tag :: Customer ] [ Tag :: Invoice ] [ Meta :: CompletorStrategyPreconditionFailed ] .= $ this -> getName ( ) ; return false ; } }
Applies the strategy to see if it results in a valid solution.

@return bool
Success.
Applies the strategy to see if it results in a valid solution .