Skip to content

Commit

Permalink
Fix: missing composer dependancies
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-foster-uk committed Jul 28, 2023
1 parent 751073b commit 3ee3a55
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 46 deletions.
24 changes: 12 additions & 12 deletions vendor/composer/installed.php
@@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'limesurvey/limesurvey',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'cd572b85685ddbd54e8f45659262f5d1abfddc08',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '751073b4f2744a7334bfd972163f614bbcb9ba2f',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -38,18 +38,18 @@
'dev_requirement' => false,
),
'laravel/serializable-closure' => array(
'pretty_version' => 'v1.3.0',
'version' => '1.3.0.0',
'reference' => 'f23fe9d4e95255dacee1bf3525e0810d1a1b0f37',
'pretty_version' => 'v1.3.1',
'version' => '1.3.1.0',
'reference' => 'e5a3057a5591e1cfe8183034b0203921abe2c902',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/serializable-closure',
'aliases' => array(),
'dev_requirement' => false,
),
'limesurvey/limesurvey' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'cd572b85685ddbd54e8f45659262f5d1abfddc08',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '751073b4f2744a7334bfd972163f614bbcb9ba2f',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -248,9 +248,9 @@
'dev_requirement' => false,
),
'twig/twig' => array(
'pretty_version' => 'v3.6.1',
'version' => '3.6.1.0',
'reference' => '7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd',
'pretty_version' => 'v3.7.0',
'version' => '3.7.0.0',
'reference' => '5cf942bbab3df42afa918caeba947f1b690af64b',
'type' => 'library',
'install_path' => __DIR__ . '/../twig/twig',
'aliases' => array(),
Expand Down
Expand Up @@ -511,8 +511,7 @@ public function getCode()
// named arguments...
case ':':
if ($lastState === 'closure' && $context === 'root') {
$state = 'ignore_next';
$lastState = 'closure';
$state = 'closure';
$code .= $id_start.$token;
}

Expand Down Expand Up @@ -651,7 +650,7 @@ public function getCode()
$state = 'id_name';
$context = 'extends';
$lastState = 'anonymous';
break;
break;
case '{':
$state = 'closure';
if (! $inside_structure) {
Expand Down
4 changes: 4 additions & 0 deletions vendor/twig/twig/CHANGELOG
@@ -1,3 +1,7 @@
# 3.7.0 (2023-07-26)

* Add support for the ...spread operator on arrays and hashes

# 3.6.1 (2023-06-08)

* Suppress some native return type deprecation messages
Expand Down
8 changes: 4 additions & 4 deletions vendor/twig/twig/src/Environment.php
Expand Up @@ -40,11 +40,11 @@
*/
class Environment
{
public const VERSION = '3.6.1';
public const VERSION_ID = 30601;
public const VERSION = '3.7.0';
public const VERSION_ID = 30700;
public const MAJOR_VERSION = 3;
public const MINOR_VERSION = 6;
public const RELEASE_VERSION = 1;
public const MINOR_VERSION = 7;
public const RELEASE_VERSION = 0;
public const EXTRA_VERSION = '';

private $charset;
Expand Down
17 changes: 16 additions & 1 deletion vendor/twig/twig/src/ExpressionParser.php
Expand Up @@ -334,7 +334,14 @@ public function parseArrayExpression()
}
$first = false;

$node->addElement($this->parseExpression());
if ($stream->test(/* Token::SPREAD_TYPE */ 13)) {
$stream->next();
$expr = $this->parseExpression();
$expr->setAttribute('spread', true);
$node->addElement($expr);
} else {
$node->addElement($this->parseExpression());
}
}
$stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ']', 'An opened array is not properly closed');

Expand All @@ -359,6 +366,14 @@ public function parseHashExpression()
}
$first = false;

if ($stream->test(/* Token::SPREAD_TYPE */ 13)) {
$stream->next();
$value = $this->parseExpression();
$value->setAttribute('spread', true);
$node->addElement($value);
continue;
}

// a hash key can be:
//
// * a number -- 12
Expand Down
26 changes: 14 additions & 12 deletions vendor/twig/twig/src/Extension/CoreExtension.php
Expand Up @@ -609,32 +609,34 @@ function twig_urlencode_filter($url)
}

/**
* Merges an array with another one.
* Merges any number of arrays or Traversable objects.
*
* {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
*
* {% set items = items|merge({ 'peugeot': 'car' }) %}
* {% set items = items|merge({ 'peugeot': 'car' }, { 'banana': 'fruit' }) %}
*
* {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #}
* {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'banana': 'fruit' } #}
*
* @param array|\Traversable $arr1 An array
* @param array|\Traversable $arr2 An array
* @param array|\Traversable ...$arrays Any number of arrays or Traversable objects to merge
*
* @return array The merged array
*/
function twig_array_merge($arr1, $arr2)
function twig_array_merge(...$arrays)
{
if (!twig_test_iterable($arr1)) {
throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($arr1)));
}
$result = [];

foreach ($arrays as $argNumber => $array) {
if (!twig_test_iterable($array)) {
throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" for argument %d.', \gettype($array), $argNumber + 1));
}

if (!twig_test_iterable($arr2)) {
throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as second argument.', \gettype($arr2)));
$result = array_merge($result, twig_to_array($array));
}

return array_merge(twig_to_array($arr1), twig_to_array($arr2));
return $result;
}


/**
* Slices a variable.
*
Expand Down
7 changes: 6 additions & 1 deletion vendor/twig/twig/src/Lexer.php
Expand Up @@ -315,8 +315,13 @@ private function lexExpression(): void
}
}

// spread operator
if ('.' === $this->code[$this->cursor] && ($this->cursor + 2 < $this->end) && '.' === $this->code[$this->cursor + 1] && '.' === $this->code[$this->cursor + 2]) {
$this->pushToken(Token::SPREAD_TYPE, '...');
$this->moveCursor('...');
}
// arrow function
if ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) {
elseif ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) {
$this->pushToken(Token::ARROW_TYPE, '=>');
$this->moveCursor('=>');
}
Expand Down
64 changes: 57 additions & 7 deletions vendor/twig/twig/src/Node/Expression/ArrayExpression.php
Expand Up @@ -66,20 +66,70 @@ public function addElement(AbstractExpression $value, AbstractExpression $key =

public function compile(Compiler $compiler): void
{
$keyValuePairs = $this->getKeyValuePairs();
$needsArrayMergeSpread = \PHP_VERSION_ID < 80100 && $this->hasSpreadItem($keyValuePairs);

if ($needsArrayMergeSpread) {
$compiler->raw('twig_array_merge(');
}
$compiler->raw('[');
$first = true;
foreach ($this->getKeyValuePairs() as $pair) {
$reopenAfterMergeSpread = false;
$nextIndex = 0;
foreach ($keyValuePairs as $pair) {
if ($reopenAfterMergeSpread) {
$compiler->raw(', [');
$reopenAfterMergeSpread = false;
}

if ($needsArrayMergeSpread && $pair['value']->hasAttribute('spread')) {
$compiler->raw('], ')->subcompile($pair['value']);
$first = true;
$reopenAfterMergeSpread = true;
continue;
}
if (!$first) {
$compiler->raw(', ');
}
$first = false;

$compiler
->subcompile($pair['key'])
->raw(' => ')
->subcompile($pair['value'])
;
if ($pair['value']->hasAttribute('spread') && !$needsArrayMergeSpread) {
$compiler->raw('...')->subcompile($pair['value']);
++$nextIndex;
} else {
$key = $pair['key'] instanceof ConstantExpression ? $pair['key']->getAttribute('value') : null;

if ($nextIndex !== $key) {
if (\is_int($key)) {
$nextIndex = $key + 1;
}
$compiler
->subcompile($pair['key'])
->raw(' => ')
;
} else {
++$nextIndex;
}

$compiler->subcompile($pair['value']);
}
}
if (!$reopenAfterMergeSpread) {
$compiler->raw(']');
}
$compiler->raw(']');
if ($needsArrayMergeSpread) {
$compiler->raw(')');
}
}

private function hasSpreadItem(array $pairs): bool
{
foreach ($pairs as $pair) {
if ($pair['value']->hasAttribute('spread')) {
return true;
}
}

return false;
}
}
6 changes: 6 additions & 0 deletions vendor/twig/twig/src/Token.php
Expand Up @@ -35,6 +35,7 @@ final class Token
public const INTERPOLATION_START_TYPE = 10;
public const INTERPOLATION_END_TYPE = 11;
public const ARROW_TYPE = 12;
public const SPREAD_TYPE = 13;

public function __construct(int $type, $value, int $lineno)
{
Expand Down Expand Up @@ -133,6 +134,9 @@ public static function typeToString(int $type, bool $short = false): string
case self::ARROW_TYPE:
$name = 'ARROW_TYPE';
break;
case self::SPREAD_TYPE:
$name = 'SPREAD_TYPE';
break;
default:
throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type));
}
Expand Down Expand Up @@ -171,6 +175,8 @@ public static function typeToEnglish(int $type): string
return 'end of string interpolation';
case self::ARROW_TYPE:
return 'arrow function';
case self::SPREAD_TYPE:
return 'spread operator';
default:
throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type));
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/twig/twig/src/TwigFilter.php
Expand Up @@ -29,7 +29,7 @@ final class TwigFilter
private $arguments = [];

/**
* @param callable|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation.
* @param callable|array<class-string, string>|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation.
*/
public function __construct(string $name, $callable = null, array $options = [])
{
Expand Down Expand Up @@ -57,7 +57,7 @@ public function getName(): string
/**
* Returns the callable to execute for this filter.
*
* @return callable|null
* @return callable|array<class-string, string>|null
*/
public function getCallable()
{
Expand Down
4 changes: 2 additions & 2 deletions vendor/twig/twig/src/TwigFunction.php
Expand Up @@ -29,7 +29,7 @@ final class TwigFunction
private $arguments = [];

/**
* @param callable|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation.
* @param callable|array<class-string, string>|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation.
*/
public function __construct(string $name, $callable = null, array $options = [])
{
Expand All @@ -55,7 +55,7 @@ public function getName(): string
/**
* Returns the callable to execute for this function.
*
* @return callable|null
* @return callable|array<class-string, string>|null
*/
public function getCallable()
{
Expand Down
4 changes: 2 additions & 2 deletions vendor/twig/twig/src/TwigTest.php
Expand Up @@ -28,7 +28,7 @@ final class TwigTest
private $arguments = [];

/**
* @param callable|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation.
* @param callable|array<class-string, string>|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation.
*/
public function __construct(string $name, $callable = null, array $options = [])
{
Expand All @@ -51,7 +51,7 @@ public function getName(): string
/**
* Returns the callable to execute for this test.
*
* @return callable|null
* @return callable|array<class-string, string>|null
*/
public function getCallable()
{
Expand Down

1 comment on commit 3ee3a55

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://bugs.limesurvey.org/view.php?id=18983

Fixed issue #18983: Unable to save genereal settings

Please sign in to comment.