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 laravel/serializable-closure from 1.2.2 to 1.3.3 #1645

Merged
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"icewind/searchdav": "^3.1.0",
"icewind/streams": "^0.7.7",
"kornrunner/blurhash": "^1.2",
"laravel/serializable-closure": "^1.2.2",
"laravel/serializable-closure": "^1.3.3",
"mexitek/phpcolors": "^1.0",
"microsoft/azure-storage-blob": "^1.5.4",
"mlocati/ip-lib": "^1.18",
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,7 @@
'Laravel\\SerializableClosure\\Support\\ClosureStream' => $vendorDir . '/laravel/serializable-closure/src/Support/ClosureStream.php',
'Laravel\\SerializableClosure\\Support\\ReflectionClosure' => $vendorDir . '/laravel/serializable-closure/src/Support/ReflectionClosure.php',
'Laravel\\SerializableClosure\\Support\\SelfReference' => $vendorDir . '/laravel/serializable-closure/src/Support/SelfReference.php',
'Laravel\\SerializableClosure\\UnsignedSerializableClosure' => $vendorDir . '/laravel/serializable-closure/src/UnsignedSerializableClosure.php',
'League\\Uri\\Contracts\\AuthorityInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/AuthorityInterface.php',
'League\\Uri\\Contracts\\DataPathInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/DataPathInterface.php',
'League\\Uri\\Contracts\\DomainHostInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/DomainHostInterface.php',
Expand Down
1 change: 1 addition & 0 deletions composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -2411,6 +2411,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
'Laravel\\SerializableClosure\\Support\\ClosureStream' => __DIR__ . '/..' . '/laravel/serializable-closure/src/Support/ClosureStream.php',
'Laravel\\SerializableClosure\\Support\\ReflectionClosure' => __DIR__ . '/..' . '/laravel/serializable-closure/src/Support/ReflectionClosure.php',
'Laravel\\SerializableClosure\\Support\\SelfReference' => __DIR__ . '/..' . '/laravel/serializable-closure/src/Support/SelfReference.php',
'Laravel\\SerializableClosure\\UnsignedSerializableClosure' => __DIR__ . '/..' . '/laravel/serializable-closure/src/UnsignedSerializableClosure.php',
'League\\Uri\\Contracts\\AuthorityInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/AuthorityInterface.php',
'League\\Uri\\Contracts\\DataPathInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/DataPathInterface.php',
'League\\Uri\\Contracts\\DomainHostInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/DomainHostInterface.php',
Expand Down
12 changes: 6 additions & 6 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1906,17 +1906,17 @@
},
{
"name": "laravel/serializable-closure",
"version": "v1.2.2",
"version_normalized": "1.2.2.0",
"version": "v1.3.3",
"version_normalized": "1.3.3.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae"
"reference": "3dbf8a8e914634c48d389c1234552666b3d43754"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae",
"reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3dbf8a8e914634c48d389c1234552666b3d43754",
"reference": "3dbf8a8e914634c48d389c1234552666b3d43754",
"shasum": ""
},
"require": {
Expand All @@ -1928,7 +1928,7 @@
"phpstan/phpstan": "^1.8.2",
"symfony/var-dumper": "^5.4.11"
},
"time": "2022-09-08T13:45:54+00:00",
"time": "2023-11-08T14:08:06+00:00",
"type": "library",
"extra": {
"branch-alias": {
Expand Down
10 changes: 5 additions & 5 deletions composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'nextcloud/3rdparty',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'd3ba5617189292ace65a2920a61b3ac5e456d37d',
'reference' => 'bcafd28f17256a5e6f8bcc448f1f31384e8de2e0',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
Expand Down Expand Up @@ -245,9 +245,9 @@
'dev_requirement' => false,
),
'laravel/serializable-closure' => array(
'pretty_version' => 'v1.2.2',
'version' => '1.2.2.0',
'reference' => '47afb7fae28ed29057fdca37e16a84f90cc62fae',
'pretty_version' => 'v1.3.3',
'version' => '1.3.3.0',
'reference' => '3dbf8a8e914634c48d389c1234552666b3d43754',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/serializable-closure',
'aliases' => array(),
Expand Down Expand Up @@ -319,7 +319,7 @@
'nextcloud/3rdparty' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'd3ba5617189292ace65a2920a61b3ac5e456d37d',
'reference' => 'bcafd28f17256a5e6f8bcc448f1f31384e8de2e0',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
Expand Down
11 changes: 11 additions & 0 deletions laravel/serializable-closure/src/SerializableClosure.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ public function getClosure()
return $this->serializable->getClosure();
}

/**
* Create a new unsigned serializable closure instance.
*
* @param Closure $closure
* @return \Laravel\SerializableClosure\UnsignedSerializableClosure
*/
public static function unsigned(Closure $closure)
{
return new UnsignedSerializableClosure($closure);
}

/**
* Sets the serializable closure secret key.
*
Expand Down
5 changes: 3 additions & 2 deletions laravel/serializable-closure/src/Serializers/Native.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Laravel\SerializableClosure\Support\ClosureStream;
use Laravel\SerializableClosure\Support\ReflectionClosure;
use Laravel\SerializableClosure\Support\SelfReference;
use Laravel\SerializableClosure\UnsignedSerializableClosure;
use ReflectionObject;
use UnitEnum;

Expand Down Expand Up @@ -379,7 +380,7 @@ protected function mapPointers(&$data)

$item = $property->getValue($data);

if ($item instanceof SerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) {
if ($item instanceof SerializableClosure || $item instanceof UnsignedSerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) {
$this->code['objects'][] = [
'instance' => $data,
'property' => $property,
Expand Down Expand Up @@ -452,7 +453,7 @@ protected function mapByReference(&$data)
}

unset($value);
} elseif (is_object($data) && ! $data instanceof SerializableClosure) {
} elseif (is_object($data) && ! $data instanceof SerializableClosure && ! $data instanceof UnsignedSerializableClosure) {
if (isset($this->scope[$data])) {
$data = $this->scope[$data];

Expand Down
13 changes: 8 additions & 5 deletions laravel/serializable-closure/src/Support/ReflectionClosure.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,9 @@ public function getCode()
break;
case 'id_name':
switch ($token[0]) {
// named arguments...
case ':':
case $token[0] === ':' && $context !== 'instanceof':
if ($lastState === 'closure' && $context === 'root') {
$state = 'ignore_next';
$lastState = 'closure';
$state = 'closure';
$code .= $id_start.$token;
}

Expand Down Expand Up @@ -643,6 +641,11 @@ public function getCode()
break;
case 'anonymous':
switch ($token[0]) {
case T_NAME_QUALIFIED:
[$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]);
$state = 'id_name';
$lastState = 'anonymous';
break 2;
case T_NS_SEPARATOR:
case T_STRING:
$id_start = $token[1];
Expand All @@ -651,7 +654,7 @@ public function getCode()
$state = 'id_name';
$context = 'extends';
$lastState = 'anonymous';
break;
break;
case '{':
$state = 'closure';
if (! $inside_structure) {
Expand Down
82 changes: 82 additions & 0 deletions laravel/serializable-closure/src/UnsignedSerializableClosure.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php

namespace Laravel\SerializableClosure;

use Closure;
use Laravel\SerializableClosure\Exceptions\PhpVersionNotSupportedException;

class UnsignedSerializableClosure
{
/**
* The closure's serializable.
*
* @var \Laravel\SerializableClosure\Contracts\Serializable
*/
protected $serializable;

/**
* Creates a new serializable closure instance.
*
* @param \Closure $closure
* @return void
*/
public function __construct(Closure $closure)
{
if (\PHP_VERSION_ID < 70400) {
throw new PhpVersionNotSupportedException();
}

$this->serializable = new Serializers\Native($closure);
}

/**
* Resolve the closure with the given arguments.
*
* @return mixed
*/
public function __invoke()
{
if (\PHP_VERSION_ID < 70400) {
throw new PhpVersionNotSupportedException();
}

return call_user_func_array($this->serializable, func_get_args());
}

/**
* Gets the closure.
*
* @return \Closure
*/
public function getClosure()
{
if (\PHP_VERSION_ID < 70400) {
throw new PhpVersionNotSupportedException();
}

return $this->serializable->getClosure();
}

/**
* Get the serializable representation of the closure.
*
* @return array
*/
public function __serialize()
{
return [
'serializable' => $this->serializable,
];
}

/**
* Restore the closure after serialization.
*
* @param array $data
* @return void
*/
public function __unserialize($data)
{
$this->serializable = $data['serializable'];
}
}