for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LesserPhp\Compiler\Value;
/**
* lesserphp
* https://www.maswaba.de/lesserphp
*
* LESS CSS compiler, adapted from http://lesscss.org
* Copyright 2013, Leaf Corcoran <[email protected]>
* Copyright 2016, Marcus Schwarz <[email protected]>
* Copyright 2017, Stefan Pöhner <[email protected]>
* Licensed under MIT or GPLv3, see LICENSE
* @package LesserPhp
*/
class NumberValue extends AbstractValue
{
* @var float
private $number;
* @var string
private $unit;
* @inheritdoc
public function getCompiled()
$num = $this->number;
if (isset($this->options['numberPrecision'])) {
$num = round($num, $this->options['numberPrecision']);
}
return $num . $this->unit;
public function initializeFromOldFormat(array $value)
$this->number = $value[1];
$this->unit = $value[2];