MDL-79666 libraries: upgrade to version 1.12.1 of ScssPhp.
This commit is contained in:
@@ -33,7 +33,7 @@ use ScssPhp\ScssPhp\Util;
|
||||
*
|
||||
* @template-implements \ArrayAccess<int, mixed>
|
||||
*/
|
||||
class Number extends Node implements \ArrayAccess
|
||||
class Number extends Node implements \ArrayAccess, \JsonSerializable
|
||||
{
|
||||
const PRECISION = 10;
|
||||
|
||||
@@ -131,7 +131,7 @@ class Number extends Node implements \ArrayAccess
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getNumeratorUnits()
|
||||
{
|
||||
@@ -139,13 +139,23 @@ class Number extends Node implements \ArrayAccess
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getDenominatorUnits()
|
||||
{
|
||||
return $this->denominatorUnits;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize()
|
||||
{
|
||||
// Passing a compiler instance makes the method output a Sass representation instead of a CSS one, supporting full units.
|
||||
return $this->output(new Compiler());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
@@ -554,7 +564,7 @@ class Number extends Node implements \ArrayAccess
|
||||
|
||||
try {
|
||||
return $this->coerceUnits($other, function ($num1, $num2) {
|
||||
return round($num1,self::PRECISION) == round($num2, self::PRECISION);
|
||||
return round($num1, self::PRECISION) == round($num2, self::PRECISION);
|
||||
});
|
||||
} catch (SassScriptException $e) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user