Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Bump web-auth/webauthn-lib from 3.3.9 to 3.3.12 #1785

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 10 additions & 5 deletions beberlei/assert/lib/Assert/Assertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ public static function startsWith($string, $needle, $message = null, string $pro
{
static::string($string, $message, $propertyPath);

if (0 !== \mb_strpos($string, $needle, null, $encoding)) {
if (0 !== \mb_strpos($string, $needle, 0, $encoding)) {
$message = \sprintf(
static::generateMessage($message ?: 'Value "%s" does not start with "%s".'),
static::stringify($string),
Expand Down Expand Up @@ -987,7 +987,7 @@ public static function endsWith($string, $needle, $message = null, string $prope

$stringPosition = \mb_strlen($string, $encoding) - \mb_strlen($needle, $encoding);

if (\mb_strripos($string, $needle, null, $encoding) !== $stringPosition) {
if (\mb_strripos($string, $needle, 0, $encoding) !== $stringPosition) {
$message = \sprintf(
static::generateMessage($message ?: 'Value "%s" does not end with "%s".'),
static::stringify($string),
Expand Down Expand Up @@ -1019,7 +1019,7 @@ public static function contains($string, $needle, $message = null, string $prope
{
static::string($string, $message, $propertyPath);

if (false === \mb_strpos($string, $needle, null, $encoding)) {
if (false === \mb_strpos($string, $needle, 0, $encoding)) {
$message = \sprintf(
static::generateMessage($message ?: 'Value "%s" does not contain "%s".'),
static::stringify($string),
Expand Down Expand Up @@ -1051,7 +1051,7 @@ public static function notContains($string, $needle, $message = null, string $pr
{
static::string($string, $message, $propertyPath);

if (false !== \mb_strpos($string, $needle, null, $encoding)) {
if (false !== \mb_strpos($string, $needle, 0, $encoding)) {
$message = \sprintf(
static::generateMessage($message ?: 'Value "%s" contains "%s".'),
static::stringify($string),
Expand Down Expand Up @@ -2620,7 +2620,12 @@ public static function satisfy($value, $callback, $message = null, string $prope
public static function ip($value, $flag = null, $message = null, string $propertyPath = null): bool
{
static::string($value, $message, $propertyPath);
if (!\filter_var($value, FILTER_VALIDATE_IP, $flag)) {
if ($flag === null) {
$filterVarResult = \filter_var($value, FILTER_VALIDATE_IP);
} else {
$filterVarResult = \filter_var($value, FILTER_VALIDATE_IP, $flag);
}
if (!$filterVarResult) {
$message = \sprintf(
static::generateMessage($message ?: 'Value "%s" was expected to be a valid IP address.'),
static::stringify($value)
Expand Down
21 changes: 10 additions & 11 deletions beberlei/assert/lib/Assert/AssertionChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Assert;

use LogicException;
use ReflectionClass;

/**
* Chaining builder for assertions.
Expand Down Expand Up @@ -171,13 +170,12 @@ public function __call($methodName, $args): AssertionChain
return $this;
}

if (!\method_exists($this->assertionClassName, $methodName)) {
try {
$method = new \ReflectionMethod($this->assertionClassName, $methodName);
} catch (\ReflectionException $exception) {
throw new \RuntimeException("Assertion '".$methodName."' does not exist.");
}

$reflClass = new ReflectionClass($this->assertionClassName);
$method = $reflClass->getMethod($methodName);

\array_unshift($args, $this->value);
$params = $method->getParameters();

Expand All @@ -186,12 +184,13 @@ public function __call($methodName, $args): AssertionChain
continue;
}

if ('message' == $param->getName()) {
$args[$idx] = $this->defaultMessage;
}

if ('propertyPath' == $param->getName()) {
$args[$idx] = $this->defaultPropertyPath;
switch ($param->getName()) {
case 'message':
$args[$idx] = $this->defaultMessage;
break;
case 'propertyPath':
$args[$idx] = $this->defaultPropertyPath;
break;
}
}

Expand Down
36 changes: 35 additions & 1 deletion brick/math/src/BigDecimal.php
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,40 @@ public function __toString() : string
return \substr($value, 0, -$this->scale) . '.' . \substr($value, -$this->scale);
}

/**
* This method is required for serializing the object and SHOULD NOT be accessed directly.
*
* @internal
*
* @return array{value: string, scale: int}
*/
public function __serialize(): array
{
return ['value' => $this->value, 'scale' => $this->scale];
}

/**
* This method is only here to allow unserializing the object and cannot be accessed directly.
*
* @internal
* @psalm-suppress RedundantPropertyInitializationCheck
*
* @param array{value: string, scale: int} $data
*
* @return void
*
* @throws \LogicException
*/
public function __unserialize(array $data): void
{
if (isset($this->value)) {
throw new \LogicException('__unserialize() is an internal function, it must not be called directly.');
}

$this->value = $data['value'];
$this->scale = $data['scale'];
}

/**
* This method is required by interface Serializable and SHOULD NOT be accessed directly.
*
Expand Down Expand Up @@ -794,7 +828,7 @@ public function unserialize($value) : void
* @param BigDecimal $x The first decimal number.
* @param BigDecimal $y The second decimal number.
*
* @return array{0: string, 1: string} The scaled integer values of $x and $y.
* @return array{string, string} The scaled integer values of $x and $y.
*/
private function scaleValues(BigDecimal $x, BigDecimal $y) : array
{
Expand Down
33 changes: 33 additions & 0 deletions brick/math/src/BigInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,39 @@ public function __toString() : string
return $this->value;
}

/**
* This method is required for serializing the object and SHOULD NOT be accessed directly.
*
* @internal
*
* @return array{value: string}
*/
public function __serialize(): array
{
return ['value' => $this->value];
}

/**
* This method is only here to allow unserializing the object and cannot be accessed directly.
*
* @internal
* @psalm-suppress RedundantPropertyInitializationCheck
*
* @param array{value: string} $data
*
* @return void
*
* @throws \LogicException
*/
public function __unserialize(array $data): void
{
if (isset($this->value)) {
throw new \LogicException('__unserialize() is an internal function, it must not be called directly.');
}

$this->value = $data['value'];
}

/**
* This method is required by interface Serializable and SHOULD NOT be accessed directly.
*
Expand Down
34 changes: 34 additions & 0 deletions brick/math/src/BigRational.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,40 @@ public function __toString() : string
return $this->numerator . '/' . $this->denominator;
}

/**
* This method is required for serializing the object and SHOULD NOT be accessed directly.
*
* @internal
*
* @return array{numerator: BigInteger, denominator: BigInteger}
*/
public function __serialize(): array
{
return ['numerator' => $this->numerator, 'denominator' => $this->denominator];
}

/**
* This method is only here to allow unserializing the object and cannot be accessed directly.
*
* @internal
* @psalm-suppress RedundantPropertyInitializationCheck
*
* @param array{numerator: BigInteger, denominator: BigInteger} $data
*
* @return void
*
* @throws \LogicException
*/
public function __unserialize(array $data): void
{
if (isset($this->numerator)) {
throw new \LogicException('__unserialize() is an internal function, it must not be called directly.');
}

$this->numerator = $data['numerator'];
$this->denominator = $data['denominator'];
}

/**
* This method is required by interface Serializable and SHOULD NOT be accessed directly.
*
Expand Down
5 changes: 1 addition & 4 deletions brick/math/src/Internal/Calculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private static function detect() : Calculator
* @param string $a The first operand.
* @param string $b The second operand.
*
* @return array{0: bool, 1: bool, 2: string, 3: string} Whether $a and $b are negative, followed by their digits.
* @return array{bool, bool, string, string} Whether $a and $b are negative, followed by their digits.
*/
final protected function init(string $a, string $b) : array
{
Expand Down Expand Up @@ -677,9 +677,6 @@ private function bitwise(string $operator, string $a, string $b) : string
}

/**
* @psalm-suppress InvalidOperand
* @see https://github.com/vimeo/psalm/issues/4456
*
* @param string $number A positive, binary number.
*
* @return string
Expand Down
2 changes: 1 addition & 1 deletion brick/math/src/Internal/Calculator/NativeCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ private function doCmp(string $a, string $b) : int
* @param string $a The first operand.
* @param string $b The second operand.
*
* @return array{0: string, 1: string, 2: int}
* @return array{string, string, int}
*/
private function pad(string $a, string $b) : array
{
Expand Down
Loading