Skip to content

Commit

Permalink
chore: update deps (#84)
Browse files Browse the repository at this point in the history
* chore: update deps

* chore: fix and repush
  • Loading branch information
justlevine authored Aug 18, 2023
1 parent c1acde0 commit f8feab4
Show file tree
Hide file tree
Showing 28 changed files with 503 additions and 411 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"phpstan/phpstan": "^1.2",
"phpstan/extension-installer": "^1.1",
"szepeviktor/phpstan-wordpress": "^1.1.5",
"php-stubs/woocommerce-stubs": "^7.3",
"php-stubs/woocommerce-stubs": "^8.0",
"axepress/wp-graphql-stubs": "^1.12.0",
"axepress/wp-graphql-cs": "^1.0.0-beta",
"wp-cli/wp-cli-bundle": "^2.8.1",
Expand Down
551 changes: 304 additions & 247 deletions composer.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions vendor-prefixed/firebase/php-jwt/src/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ public static function decode(

// Check the nbf if it is defined. This is the time that the
// token can actually be used. If it's not yet that time, abort.
if (isset($payload->nbf) && $payload->nbf > ($timestamp + static::$leeway)) {
if (isset($payload->nbf) && floor($payload->nbf) > ($timestamp + static::$leeway)) {
throw new BeforeValidException(
'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->nbf)
'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) $payload->nbf)
);
}

// Check that this token has been created before 'now'. This prevents
// using tokens that have been created for later use (and haven't
// correctly used the nbf claim).
if (!isset($payload->nbf) && isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) {
if (!isset($payload->nbf) && isset($payload->iat) && floor($payload->iat) > ($timestamp + static::$leeway)) {
throw new BeforeValidException(
'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->iat)
'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) $payload->iat)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RejectionException extends \RuntimeException
* @param mixed $reason Rejection reason.
* @param string|null $description Optional description.
*/
public function __construct($reason, $description = null)
public function __construct($reason, ?string $description = null)
{
$this->reason = $reason;

Expand Down
6 changes: 4 additions & 2 deletions vendor-prefixed/guzzlehttp/psr7/src/AppendStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ public function __toString(): string
{
try {
$this->rewind();

return $this->getContents();
} catch (\Throwable $e) {
if (\PHP_VERSION_ID >= 70400) {
throw $e;
}
trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);

return '';
}
}
Expand Down Expand Up @@ -173,7 +175,7 @@ public function seek($offset, $whence = SEEK_SET): void
$stream->rewind();
} catch (\Exception $e) {
throw new \RuntimeException('Unable to seek stream '
. $i . ' of the AppendStream', 0, $e);
.$i.' of the AppendStream', 0, $e);
}
}

Expand Down Expand Up @@ -203,7 +205,7 @@ public function read($length): string
if ($this->current === $total) {
break;
}
$this->current++;
++$this->current;
}

$result = $this->streams[$this->current]->read($remaining);
Expand Down
7 changes: 4 additions & 3 deletions vendor-prefixed/guzzlehttp/psr7/src/FnStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class FnStream implements StreamInterface
private const SLOTS = [
'__toString', 'close', 'detach', 'rewind',
'getSize', 'tell', 'eof', 'isSeekable', 'seek', 'isWritable', 'write',
'isReadable', 'read', 'getContents', 'getMetadata'
'isReadable', 'read', 'getContents', 'getMetadata',
];

/** @var array<string, callable> */
Expand All @@ -39,7 +39,7 @@ public function __construct(array $methods)

// Create the functions on the class
foreach ($methods as $name => $fn) {
$this->{'_fn_' . $name} = $fn;
$this->{'_fn_'.$name} = $fn;
}
}

Expand All @@ -51,7 +51,7 @@ public function __construct(array $methods)
public function __get(string $name): void
{
throw new \BadMethodCallException(str_replace('_fn_', '', $name)
. '() is not implemented in the FnStream');
.'() is not implemented in the FnStream');
}

/**
Expand Down Expand Up @@ -105,6 +105,7 @@ public function __toString(): string
throw $e;
}
trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);

return '';
}
}
Expand Down
2 changes: 1 addition & 1 deletion vendor-prefixed/guzzlehttp/psr7/src/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function splitList($values): array
$v = '';
$isQuoted = false;
$isEscaped = false;
for ($i = 0, $max = \strlen($value); $i < $max; $i++) {
for ($i = 0, $max = \strlen($value); $i < $max; ++$i) {
if ($isEscaped) {
$v .= $value[$i];
$isEscaped = false;
Expand Down
8 changes: 1 addition & 7 deletions vendor-prefixed/guzzlehttp/psr7/src/HttpFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@
* Note: in consuming code it is recommended to require the implemented interfaces
* and inject the instance of this class multiple times.
*/
final class HttpFactory implements
RequestFactoryInterface,
ResponseFactoryInterface,
ServerRequestFactoryInterface,
StreamFactoryInterface,
UploadedFileFactoryInterface,
UriFactoryInterface
final class HttpFactory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface
{
public function createUploadedFile(
StreamInterface $stream,
Expand Down
6 changes: 3 additions & 3 deletions vendor-prefixed/guzzlehttp/psr7/src/InflateStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* then appends the zlib.inflate filter. The stream is then converted back
* to a Guzzle stream resource to be used as a Guzzle stream.
*
* @link http://tools.ietf.org/html/rfc1950
* @link http://tools.ietf.org/html/rfc1952
* @link http://php.net/manual/en/filters.compression.php
* @see http://tools.ietf.org/html/rfc1950
* @see http://tools.ietf.org/html/rfc1952
* @see http://php.net/manual/en/filters.compression.php
*/
final class InflateStream implements StreamInterface
{
Expand Down
24 changes: 12 additions & 12 deletions vendor-prefixed/guzzlehttp/psr7/src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@ final class Message
public static function toString(MessageInterface $message): string
{
if ($message instanceof RequestInterface) {
$msg = trim($message->getMethod() . ' '
. $message->getRequestTarget())
. ' HTTP/' . $message->getProtocolVersion();
$msg = trim($message->getMethod().' '
.$message->getRequestTarget())
.' HTTP/'.$message->getProtocolVersion();
if (!$message->hasHeader('host')) {
$msg .= "\r\nHost: " . $message->getUri()->getHost();
$msg .= "\r\nHost: ".$message->getUri()->getHost();
}
} elseif ($message instanceof ResponseInterface) {
$msg = 'HTTP/' . $message->getProtocolVersion() . ' '
. $message->getStatusCode() . ' '
. $message->getReasonPhrase();
$msg = 'HTTP/'.$message->getProtocolVersion().' '
.$message->getStatusCode().' '
.$message->getReasonPhrase();
} else {
throw new \InvalidArgumentException('Unknown message type');
}

foreach ($message->getHeaders() as $name => $values) {
if (strtolower($name) === 'set-cookie') {
foreach ($values as $value) {
$msg .= "\r\n{$name}: " . $value;
$msg .= "\r\n{$name}: ".$value;
}
} else {
$msg .= "\r\n{$name}: " . implode(', ', $values);
$msg .= "\r\n{$name}: ".implode(', ', $values);
}
}

return "{$msg}\r\n\r\n" . $message->getBody();
return "{$msg}\r\n\r\n".$message->getBody();
}

/**
Expand Down Expand Up @@ -196,7 +196,7 @@ public static function parseRequestUri(string $path, array $headers): string
$host = $headers[reset($hostKey)][0];
$scheme = substr($host, -4) === ':443' ? 'https' : 'http';

return $scheme . '://' . $host . '/' . ltrim($path, '/');
return $scheme.'://'.$host.'/'.ltrim($path, '/');
}

/**
Expand Down Expand Up @@ -237,7 +237,7 @@ public static function parseResponse(string $message): ResponseInterface
// between status-code and reason-phrase is required. But browsers accept
// responses without space and reason as well.
if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']);
throw new \InvalidArgumentException('Invalid response string: '.$data['start-line']);
}
$parts = explode(' ', $data['start-line'], 3);

Expand Down
8 changes: 5 additions & 3 deletions vendor-prefixed/guzzlehttp/psr7/src/MessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait MessageTrait
private $headers = [];

/** @var array<string, string> Map of lowercase header name => original name at registration */
private $headerNames = [];
private $headerNames = [];

/** @var string */
private $protocol = '1.1';
Expand All @@ -43,6 +43,7 @@ public function withProtocolVersion($version): MessageInterface

$new = clone $this;
$new->protocol = $version;

return $new;
}

Expand Down Expand Up @@ -141,6 +142,7 @@ public function withBody(StreamInterface $body): MessageInterface

$new = clone $this;
$new->stream = $body;

return $new;
}

Expand Down Expand Up @@ -230,7 +232,7 @@ private function assertHeader($header): void
));
}

if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) {
if (!preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) {
throw new \InvalidArgumentException(
sprintf('"%s" is not valid header name.', $header)
);
Expand Down Expand Up @@ -260,7 +262,7 @@ private function assertValue(string $value): void
// Clients must not send a request with line folding and a server sending folded headers is
// likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting
// folding is not likely to break any legitimate use case.
if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) {
if (!preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) {
throw new \InvalidArgumentException(
sprintf('"%s" is not valid header value.', $value)
);
Expand Down
Loading

0 comments on commit f8feab4

Please sign in to comment.