public function allocateWithTax(array $ratios): array
    {
        $method = $this->hasTax() ? 'afterTax' : 'withoutTax';

        $results = [];
        $allocates = static::asMoney($this->getAmountWithTax())->allocate($ratios);

        foreach ($allocates as $allocate) {
            $results[] = static::{$method}($allocate->getAmount(), $this->getTax());
        }

        return $results;
    }
public function allocateWithTax(array $ratios): array
    {
        $method = $this->hasTax() ? 'afterTax' : 'withoutTax';

        $results = [];
        $allocates = static::asMoney($this->getAmountWithTax())->allocate($ratios);

        foreach ($allocates as $allocate) {
            $results[] = static::{$method}($allocate->getAmount(), $this->getTax());
        }

        return $results;
    }
public function allocateWithTax ( array $ ratios ) : array { $ method = $ this -> hasTax ( ) ? 'afterTax' : 'withoutTax' ; $ results = [ ] ; $ allocates = static :: asMoney ( $ this -> getAmountWithTax ( ) ) -> allocate ( $ ratios ) ; foreach ( $ allocates as $ allocate ) { $ results [ ] = static :: { $ method } ( $ allocate -> getAmount ( ) , $ this -> getTax ( ) ) ; } return $ results ; }
Allocate the money according to a list of ratios with Tax.

@param  array  $ratios

@return Money[]
Allocate the money according to a list of ratios with Tax .