You are here

public function SassString::op_times in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/script/literals/SassString.php \SassString::op_times()

* String multiplication. * this is repeated other times *

Parameters

sassNumber the number of times to repeat this: * @return sassString the string result

Overrides SassLiteral::op_times

File

phamlp/sass/script/literals/SassString.php, line 69

Class

SassString
SassString class. Provides operations and type testing for Sass strings. @package PHamlP @subpackage Sass.script.literals

Code

public function op_times($other) {
  if (!$other instanceof SassNumber || !$other
    ->isUnitless()) {
    throw new SassStringException('{what} must be a {type}', array(
      '{what}' => Phamlp::t('sass', 'Value'),
      '{type}' => Phamlp::t('sass', 'unitless number'),
    ), SassScriptParser::$context->node);
  }
  $this->value = str_repeat($this->value, $other->value);
  return $this;
}