` naming convention.
- *
+ *
* @param string $param the block names to validate.
- *
+ *
* @return bool true, if they are valid or false otherwise
*/
public static function validate_block_names( $param ) {
@@ -47,7 +47,7 @@ public static function validate_block_names( $param ) {
/**
* Register the rest routes
- *
+ *
* @return void
*/
public static function register_rest_routes() {
@@ -57,6 +57,7 @@ public static function register_rest_routes() {
'callback' => [ __CLASS__, 'get_block_content' ],
'args' => [
'id' => [
+ 'required' => true,
'validate_callback' => function ( $param ) {
$post_id = intval( $param );
$is_valid = self::is_post_readable( $post_id );
@@ -94,7 +95,7 @@ public static function register_rest_routes() {
/**
* Validates if a request can access the Block Data API or not.
- *
+ *
* @return bool true, if it can be accessed or false otherwise
*/
public static function permission_callback() {
@@ -110,20 +111,26 @@ public static function permission_callback() {
/**
* Returns the block contents for a post.
- *
+ *
* @param array $params the params provided to the REST endpoint which include:
* - id: the post ID
* - (optional) include: an array of block names to include
* - (optional) exclude: an array of block names to exclude.
- *
+ *
* @access private
- *
+ *
* @return array|WPError the block contents of the post
*/
public static function get_block_content( $params ) {
- // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
- $filter_options['exclude'] = $params['exclude'];
- $filter_options['include'] = $params['include'];
+ $filter_options = [];
+ if ( ! empty( $params['exclude'] ) ) {
+ // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
+ $filter_options['exclude'] = $params['exclude'];
+ }
+
+ if ( ! empty( $params['include'] ) ) {
+ $filter_options['include'] = $params['include'];
+ }
$post_id = $params['id'];
$post = get_post( $post_id );
@@ -163,13 +170,13 @@ public static function get_block_content( $params ) {
/**
* Validates that a post is valid or not, based on:
- *
+ *
* - That it exists.
* - Is a post type that is REST-accessible
* - Is readable by the current user.
- *
+ *
* @param int $post_id the post ID to validate.
- *
+ *
* @return bool true if it is, false otherwise.
*/
private static function is_post_readable( $post_id ) {
diff --git a/tests/parser/test-content-parser.php b/tests/parser/test-content-parser.php
index 1895ad5c..f76c00f5 100644
--- a/tests/parser/test-content-parser.php
+++ b/tests/parser/test-content-parser.php
@@ -50,7 +50,7 @@ public function test_block_filter_via_code() {
],
];
- $block_filter_function = function ( $is_block_included, $block_name, $block ) {
+ $block_filter_function = function ( $is_block_included, $block_name ) {
if ( 'test/block2' === $block_name ) {
return false;
} else {
@@ -58,10 +58,10 @@ public function test_block_filter_via_code() {
}
};
- add_filter( 'vip_block_data_api__allow_block', $block_filter_function, 10, 3 );
+ add_filter( 'vip_block_data_api__allow_block', $block_filter_function, 10, 2 );
$content_parser = new ContentParser( $this->registry );
$blocks = $content_parser->parse( $html );
- remove_filter( 'vip_block_data_api__allow_block', $block_filter_function, 10, 3 );
+ remove_filter( 'vip_block_data_api__allow_block', $block_filter_function, 10, 2 );
$this->assertArrayNotHasKey( 'errors', $blocks );
$this->assertNotEmpty( $blocks, sprintf( 'Unexpected parser output: %s', wp_json_encode( $blocks ) ) );
diff --git a/tests/rest/test-rest-api.php b/tests/rest/test-rest-api.php
index 87f04f1c..25242978 100644
--- a/tests/rest/test-rest-api.php
+++ b/tests/rest/test-rest-api.php
@@ -451,7 +451,7 @@ public function test_rest_api_returns_error_for_include_and_exclude_filter() {
public function test_rest_api_returns_error_for_unexpected_exception() {
$post_id = $this->get_post_id_with_content( 'Content
' );
- $exception_causing_parser_function = function ( $sourced_block, $block_name, $post_id, $block ) {
+ $exception_causing_parser_function = function () {
throw new Exception( 'Exception in parser' );
};
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index 5490b88d..0fb0a2c1 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -6,10 +6,5 @@
$baseDir = dirname($vendorDir);
return array(
- 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
- 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
- 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
- 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
- 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php
index ea109851..c64234b5 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -6,8 +6,6 @@
$baseDir = dirname($vendorDir);
return array(
- 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
- '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
);
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
index c0e14dd1..942a1526 100644
--- a/vendor/composer/autoload_psr4.php
+++ b/vendor/composer/autoload_psr4.php
@@ -6,7 +6,6 @@
$baseDir = dirname($vendorDir);
return array(
- 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Symfony\\Component\\DomCrawler\\' => array($vendorDir . '/symfony/dom-crawler'),
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index f66e5e9d..0961a940 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -7,8 +7,6 @@
class ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a
{
public static $files = array (
- 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
- '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
);
@@ -16,7 +14,6 @@ class ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a
public static $prefixLengthsPsr4 = array (
'S' =>
array (
- 'Symfony\\Polyfill\\Php80\\' => 23,
'Symfony\\Polyfill\\Mbstring\\' => 26,
'Symfony\\Polyfill\\Ctype\\' => 23,
'Symfony\\Component\\DomCrawler\\' => 29,
@@ -29,10 +26,6 @@ class ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a
);
public static $prefixDirsPsr4 = array (
- 'Symfony\\Polyfill\\Php80\\' =>
- array (
- 0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
- ),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
@@ -56,12 +49,7 @@ class ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a
);
public static $classMap = array (
- 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
- 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
- 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
- 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
- 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
public static function getInitializer(ClassLoader $loader)
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index f9fcf365..746979e9 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -72,24 +72,23 @@
},
{
"name": "symfony/css-selector",
- "version": "v5.4.26",
- "version_normalized": "5.4.26.0",
+ "version": "v6.0.19",
+ "version_normalized": "6.0.19.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "0ad3f7e9a1ab492c5b4214cf22a9dc55dcf8600a"
+ "reference": "f1d00bddb83a4cb2138564b2150001cb6ce272b1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/0ad3f7e9a1ab492c5b4214cf22a9dc55dcf8600a",
- "reference": "0ad3f7e9a1ab492c5b4214cf22a9dc55dcf8600a",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/f1d00bddb83a4cb2138564b2150001cb6ce272b1",
+ "reference": "f1d00bddb83a4cb2138564b2150001cb6ce272b1",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
- "time": "2023-07-07T06:10:25+00:00",
+ "time": "2023-01-01T08:36:10+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -121,7 +120,7 @@
"description": "Converts CSS selectors to XPath expressions",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/css-selector/tree/v5.4.26"
+ "source": "https://github.com/symfony/css-selector/tree/v6.0.19"
},
"funding": [
{
@@ -139,109 +138,37 @@
],
"install-path": "../symfony/css-selector"
},
- {
- "name": "symfony/deprecation-contracts",
- "version": "v2.5.2",
- "version_normalized": "2.5.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
- "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "time": "2022-01-02T09:53:40+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "2.5-dev"
- },
- "thanks": {
- "name": "symfony/contracts",
- "url": "https://github.com/symfony/contracts"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "files": [
- "function.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "A generic function and convention to trigger deprecation notices",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "install-path": "../symfony/deprecation-contracts"
- },
{
"name": "symfony/dom-crawler",
- "version": "v5.4.25",
- "version_normalized": "5.4.25.0",
+ "version": "v6.0.19",
+ "version_normalized": "6.0.19.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
- "reference": "d2aefa5a7acc5511422792931d14d1be96fe9fea"
+ "reference": "622578ff158318b1b49d95068bd6b66c713601e9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d2aefa5a7acc5511422792931d14d1be96fe9fea",
- "reference": "d2aefa5a7acc5511422792931d14d1be96fe9fea",
+ "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/622578ff158318b1b49d95068bd6b66c713601e9",
+ "reference": "622578ff158318b1b49d95068bd6b66c713601e9",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php80": "^1.16"
+ "symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"masterminds/html5": "<2.6"
},
"require-dev": {
"masterminds/html5": "^2.6",
- "symfony/css-selector": "^4.4|^5.0|^6.0"
+ "symfony/css-selector": "^5.4|^6.0"
},
"suggest": {
"symfony/css-selector": ""
},
- "time": "2023-06-05T08:05:41+00:00",
+ "time": "2023-01-20T17:44:14+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -269,7 +196,7 @@
"description": "Eases DOM navigation for HTML and XML documents",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/dom-crawler/tree/v5.4.25"
+ "source": "https://github.com/symfony/dom-crawler/tree/v6.0.19"
},
"funding": [
{
@@ -457,92 +384,6 @@
}
],
"install-path": "../symfony/polyfill-mbstring"
- },
- {
- "name": "symfony/polyfill-php80",
- "version": "v1.28.0",
- "version_normalized": "1.28.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
- "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "time": "2023-01-26T09:26:14+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.28-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "install-path": "../symfony/polyfill-php80"
}
],
"dev": false,
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 87d59b63..97cbe1bf 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'automattic/vip-block-data-api',
'pretty_version' => 'dev-trunk',
'version' => 'dev-trunk',
- 'reference' => 'd98425acb0b1c58f3584f1fbc160a4756e0c5c79',
+ 'reference' => '6de847ac4eebc3cb19cb0bb417f8bf5c5f9be643',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -13,7 +13,7 @@
'automattic/vip-block-data-api' => array(
'pretty_version' => 'dev-trunk',
'version' => 'dev-trunk',
- 'reference' => 'd98425acb0b1c58f3584f1fbc160a4756e0c5c79',
+ 'reference' => '6de847ac4eebc3cb19cb0bb417f8bf5c5f9be643',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -29,27 +29,18 @@
'dev_requirement' => false,
),
'symfony/css-selector' => array(
- 'pretty_version' => 'v5.4.26',
- 'version' => '5.4.26.0',
- 'reference' => '0ad3f7e9a1ab492c5b4214cf22a9dc55dcf8600a',
+ 'pretty_version' => 'v6.0.19',
+ 'version' => '6.0.19.0',
+ 'reference' => 'f1d00bddb83a4cb2138564b2150001cb6ce272b1',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/css-selector',
'aliases' => array(),
'dev_requirement' => false,
),
- 'symfony/deprecation-contracts' => array(
- 'pretty_version' => 'v2.5.2',
- 'version' => '2.5.2.0',
- 'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
'symfony/dom-crawler' => array(
- 'pretty_version' => 'v5.4.25',
- 'version' => '5.4.25.0',
- 'reference' => 'd2aefa5a7acc5511422792931d14d1be96fe9fea',
+ 'pretty_version' => 'v6.0.19',
+ 'version' => '6.0.19.0',
+ 'reference' => '622578ff158318b1b49d95068bd6b66c713601e9',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/dom-crawler',
'aliases' => array(),
@@ -73,14 +64,5 @@
'aliases' => array(),
'dev_requirement' => false,
),
- 'symfony/polyfill-php80' => array(
- 'pretty_version' => 'v1.28.0',
- 'version' => '1.28.0.0',
- 'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../symfony/polyfill-php80',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
),
);
diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php
index a8b98d5c..b168ddd5 100644
--- a/vendor/composer/platform_check.php
+++ b/vendor/composer/platform_check.php
@@ -4,8 +4,8 @@
$issues = array();
-if (!(PHP_VERSION_ID >= 70205)) {
- $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.';
+if (!(PHP_VERSION_ID >= 80002)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
diff --git a/vendor/symfony/css-selector/CssSelectorConverter.php b/vendor/symfony/css-selector/CssSelectorConverter.php
index bbb6afe2..86ccb795 100644
--- a/vendor/symfony/css-selector/CssSelectorConverter.php
+++ b/vendor/symfony/css-selector/CssSelectorConverter.php
@@ -27,10 +27,10 @@
class CssSelectorConverter
{
private $translator;
- private $cache;
+ private array $cache;
- private static $xmlCache = [];
- private static $htmlCache = [];
+ private static array $xmlCache = [];
+ private static array $htmlCache = [];
/**
* @param bool $html Whether HTML support should be enabled. Disable it for XML documents
@@ -59,10 +59,8 @@ public function __construct(bool $html = true)
*
* Optionally, a prefix can be added to the resulting XPath
* expression with the $prefix parameter.
- *
- * @return string
*/
- public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::')
+ public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string
{
return $this->cache[$prefix][$cssExpr] ?? $this->cache[$prefix][$cssExpr] = $this->translator->cssToXPath($cssExpr, $prefix);
}
diff --git a/vendor/symfony/css-selector/Exception/SyntaxErrorException.php b/vendor/symfony/css-selector/Exception/SyntaxErrorException.php
index 7deacf9c..f73860ce 100644
--- a/vendor/symfony/css-selector/Exception/SyntaxErrorException.php
+++ b/vendor/symfony/css-selector/Exception/SyntaxErrorException.php
@@ -23,42 +23,27 @@
*/
class SyntaxErrorException extends ParseException
{
- /**
- * @return self
- */
- public static function unexpectedToken(string $expectedValue, Token $foundToken)
+ public static function unexpectedToken(string $expectedValue, Token $foundToken): self
{
return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
}
- /**
- * @return self
- */
- public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation)
+ public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation): self
{
return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
}
- /**
- * @return self
- */
- public static function unclosedString(int $position)
+ public static function unclosedString(int $position): self
{
return new self(sprintf('Unclosed/invalid string at %s.', $position));
}
- /**
- * @return self
- */
- public static function nestedNot()
+ public static function nestedNot(): self
{
return new self('Got nested ::not().');
}
- /**
- * @return self
- */
- public static function stringAsFunctionArgument()
+ public static function stringAsFunctionArgument(): self
{
return new self('String not allowed as function argument.');
}
diff --git a/vendor/symfony/css-selector/LICENSE b/vendor/symfony/css-selector/LICENSE
index 0138f8f0..00837045 100644
--- a/vendor/symfony/css-selector/LICENSE
+++ b/vendor/symfony/css-selector/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-present Fabien Potencier
+Copyright (c) 2004-2023 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/symfony/css-selector/Node/AbstractNode.php b/vendor/symfony/css-selector/Node/AbstractNode.php
index 1306aeac..d99e80a8 100644
--- a/vendor/symfony/css-selector/Node/AbstractNode.php
+++ b/vendor/symfony/css-selector/Node/AbstractNode.php
@@ -23,17 +23,10 @@
*/
abstract class AbstractNode implements NodeInterface
{
- /**
- * @var string
- */
- private $nodeName;
+ private string $nodeName;
public function getNodeName(): string
{
- if (null === $this->nodeName) {
- $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class);
- }
-
- return $this->nodeName;
+ return $this->nodeName ??= preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class);
}
}
diff --git a/vendor/symfony/css-selector/Node/AttributeNode.php b/vendor/symfony/css-selector/Node/AttributeNode.php
index 0b6e0ee0..bca91eb8 100644
--- a/vendor/symfony/css-selector/Node/AttributeNode.php
+++ b/vendor/symfony/css-selector/Node/AttributeNode.php
@@ -24,10 +24,10 @@
class AttributeNode extends AbstractNode
{
private $selector;
- private $namespace;
- private $attribute;
- private $operator;
- private $value;
+ private ?string $namespace;
+ private string $attribute;
+ private string $operator;
+ private ?string $value;
public function __construct(NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value)
{
diff --git a/vendor/symfony/css-selector/Node/ClassNode.php b/vendor/symfony/css-selector/Node/ClassNode.php
index 1efca808..0e937688 100644
--- a/vendor/symfony/css-selector/Node/ClassNode.php
+++ b/vendor/symfony/css-selector/Node/ClassNode.php
@@ -24,7 +24,7 @@
class ClassNode extends AbstractNode
{
private $selector;
- private $name;
+ private string $name;
public function __construct(NodeInterface $selector, string $name)
{
diff --git a/vendor/symfony/css-selector/Node/CombinedSelectorNode.php b/vendor/symfony/css-selector/Node/CombinedSelectorNode.php
index a217a45e..f5f99697 100644
--- a/vendor/symfony/css-selector/Node/CombinedSelectorNode.php
+++ b/vendor/symfony/css-selector/Node/CombinedSelectorNode.php
@@ -24,7 +24,7 @@
class CombinedSelectorNode extends AbstractNode
{
private $selector;
- private $combinator;
+ private string $combinator;
private $subSelector;
public function __construct(NodeInterface $selector, string $combinator, NodeInterface $subSelector)
diff --git a/vendor/symfony/css-selector/Node/ElementNode.php b/vendor/symfony/css-selector/Node/ElementNode.php
index fbf8ea0f..b05164fe 100644
--- a/vendor/symfony/css-selector/Node/ElementNode.php
+++ b/vendor/symfony/css-selector/Node/ElementNode.php
@@ -23,8 +23,8 @@
*/
class ElementNode extends AbstractNode
{
- private $namespace;
- private $element;
+ private ?string $namespace;
+ private ?string $element;
public function __construct(string $namespace = null, string $element = null)
{
diff --git a/vendor/symfony/css-selector/Node/FunctionNode.php b/vendor/symfony/css-selector/Node/FunctionNode.php
index c464cf7c..e91a1662 100644
--- a/vendor/symfony/css-selector/Node/FunctionNode.php
+++ b/vendor/symfony/css-selector/Node/FunctionNode.php
@@ -26,8 +26,8 @@
class FunctionNode extends AbstractNode
{
private $selector;
- private $name;
- private $arguments;
+ private string $name;
+ private array $arguments;
/**
* @param Token[] $arguments
diff --git a/vendor/symfony/css-selector/Node/HashNode.php b/vendor/symfony/css-selector/Node/HashNode.php
index 94114c09..119b0d57 100644
--- a/vendor/symfony/css-selector/Node/HashNode.php
+++ b/vendor/symfony/css-selector/Node/HashNode.php
@@ -24,7 +24,7 @@
class HashNode extends AbstractNode
{
private $selector;
- private $id;
+ private string $id;
public function __construct(NodeInterface $selector, string $id)
{
diff --git a/vendor/symfony/css-selector/Node/PseudoNode.php b/vendor/symfony/css-selector/Node/PseudoNode.php
index 12b7bd26..5d6325a5 100644
--- a/vendor/symfony/css-selector/Node/PseudoNode.php
+++ b/vendor/symfony/css-selector/Node/PseudoNode.php
@@ -24,7 +24,7 @@
class PseudoNode extends AbstractNode
{
private $selector;
- private $identifier;
+ private string $identifier;
public function __construct(NodeInterface $selector, string $identifier)
{
diff --git a/vendor/symfony/css-selector/Node/SelectorNode.php b/vendor/symfony/css-selector/Node/SelectorNode.php
index 6e52b2fa..55fae1e7 100644
--- a/vendor/symfony/css-selector/Node/SelectorNode.php
+++ b/vendor/symfony/css-selector/Node/SelectorNode.php
@@ -24,7 +24,7 @@
class SelectorNode extends AbstractNode
{
private $tree;
- private $pseudoElement;
+ private ?string $pseudoElement;
public function __construct(NodeInterface $tree, string $pseudoElement = null)
{
diff --git a/vendor/symfony/css-selector/Node/Specificity.php b/vendor/symfony/css-selector/Node/Specificity.php
index b00f6d28..bb8e5e34 100644
--- a/vendor/symfony/css-selector/Node/Specificity.php
+++ b/vendor/symfony/css-selector/Node/Specificity.php
@@ -29,9 +29,9 @@ class Specificity
public const B_FACTOR = 10;
public const C_FACTOR = 1;
- private $a;
- private $b;
- private $c;
+ private int $a;
+ private int $b;
+ private int $c;
public function __construct(int $a, int $b, int $c)
{
diff --git a/vendor/symfony/css-selector/Parser/Reader.php b/vendor/symfony/css-selector/Parser/Reader.php
index 4b43effe..c0b6923a 100644
--- a/vendor/symfony/css-selector/Parser/Reader.php
+++ b/vendor/symfony/css-selector/Parser/Reader.php
@@ -23,9 +23,9 @@
*/
class Reader
{
- private $source;
- private $length;
- private $position = 0;
+ private string $source;
+ private int $length;
+ private int $position = 0;
public function __construct(string $source)
{
@@ -60,10 +60,7 @@ public function getOffset(string $string)
return false === $position ? false : $position - $this->position;
}
- /**
- * @return array|false
- */
- public function findPattern(string $pattern)
+ public function findPattern(string $pattern): array|false
{
$source = substr($this->source, $this->position);
diff --git a/vendor/symfony/css-selector/Parser/Token.php b/vendor/symfony/css-selector/Parser/Token.php
index a053203c..a538d07f 100644
--- a/vendor/symfony/css-selector/Parser/Token.php
+++ b/vendor/symfony/css-selector/Parser/Token.php
@@ -31,9 +31,9 @@ class Token
public const TYPE_NUMBER = 'number';
public const TYPE_STRING = 'string';
- private $type;
- private $value;
- private $position;
+ private ?string $type;
+ private ?string $value;
+ private ?int $position;
public function __construct(?string $type, ?string $value, ?int $position)
{
diff --git a/vendor/symfony/css-selector/Parser/TokenStream.php b/vendor/symfony/css-selector/Parser/TokenStream.php
index 2085f2dd..e2c15a64 100644
--- a/vendor/symfony/css-selector/Parser/TokenStream.php
+++ b/vendor/symfony/css-selector/Parser/TokenStream.php
@@ -29,34 +29,23 @@ class TokenStream
/**
* @var Token[]
*/
- private $tokens = [];
+ private array $tokens = [];
/**
* @var Token[]
*/
- private $used = [];
+ private array $used = [];
- /**
- * @var int
- */
- private $cursor = 0;
-
- /**
- * @var Token|null
- */
+ private int $cursor = 0;
private $peeked;
-
- /**
- * @var bool
- */
- private $peeking = false;
+ private bool $peeking = false;
/**
* Pushes a token.
*
* @return $this
*/
- public function push(Token $token): self
+ public function push(Token $token): static
{
$this->tokens[] = $token;
@@ -68,7 +57,7 @@ public function push(Token $token): self
*
* @return $this
*/
- public function freeze(): self
+ public function freeze(): static
{
return $this;
}
diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php b/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php
index e0dcc5bf..35c96a48 100644
--- a/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php
+++ b/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php
@@ -31,7 +31,7 @@ class Tokenizer
/**
* @var Handler\HandlerInterface[]
*/
- private $handlers;
+ private array $handlers;
public function __construct()
{
diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php
index 2e78a1c4..3c77cf09 100644
--- a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php
+++ b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php
@@ -23,18 +23,18 @@
*/
class TokenizerPatterns
{
- private $unicodeEscapePattern;
- private $simpleEscapePattern;
- private $newLineEscapePattern;
- private $escapePattern;
- private $stringEscapePattern;
- private $nonAsciiPattern;
- private $nmCharPattern;
- private $nmStartPattern;
- private $identifierPattern;
- private $hashPattern;
- private $numberPattern;
- private $quotedStringPattern;
+ private string $unicodeEscapePattern;
+ private string $simpleEscapePattern;
+ private string $newLineEscapePattern;
+ private string $escapePattern;
+ private string $stringEscapePattern;
+ private string $nonAsciiPattern;
+ private string $nmCharPattern;
+ private string $nmStartPattern;
+ private string $identifierPattern;
+ private string $hashPattern;
+ private string $numberPattern;
+ private string $quotedStringPattern;
public function __construct()
{
diff --git a/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php b/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php
index aa6f3f70..642702bb 100644
--- a/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php
+++ b/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php
@@ -31,7 +31,7 @@ class NodeExtension extends AbstractExtension
public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
- private $flags;
+ private int $flags;
public function __construct(int $flags = 0)
{
@@ -41,7 +41,7 @@ public function __construct(int $flags = 0)
/**
* @return $this
*/
- public function setFlag(int $flag, bool $on): self
+ public function setFlag(int $flag, bool $on): static
{
if ($on && !$this->hasFlag($flag)) {
$this->flags += $flag;
diff --git a/vendor/symfony/css-selector/XPath/Translator.php b/vendor/symfony/css-selector/XPath/Translator.php
index 8ce47303..c0bb29de 100644
--- a/vendor/symfony/css-selector/XPath/Translator.php
+++ b/vendor/symfony/css-selector/XPath/Translator.php
@@ -35,18 +35,18 @@ class Translator implements TranslatorInterface
/**
* @var ParserInterface[]
*/
- private $shortcutParsers = [];
+ private array $shortcutParsers = [];
/**
* @var Extension\ExtensionInterface[]
*/
- private $extensions = [];
+ private array $extensions = [];
- private $nodeTranslators = [];
- private $combinationTranslators = [];
- private $functionTranslators = [];
- private $pseudoClassTranslators = [];
- private $attributeMatchingTranslators = [];
+ private array $nodeTranslators = [];
+ private array $combinationTranslators = [];
+ private array $functionTranslators = [];
+ private array $pseudoClassTranslators = [];
+ private array $attributeMatchingTranslators = [];
public function __construct(ParserInterface $parser = null)
{
@@ -117,7 +117,7 @@ public function selectorToXPath(SelectorNode $selector, string $prefix = 'descen
/**
* @return $this
*/
- public function registerExtension(Extension\ExtensionInterface $extension): self
+ public function registerExtension(Extension\ExtensionInterface $extension): static
{
$this->extensions[$extension->getName()] = $extension;
@@ -145,7 +145,7 @@ public function getExtension(string $name): Extension\ExtensionInterface
/**
* @return $this
*/
- public function registerParserShortcut(ParserInterface $shortcut): self
+ public function registerParserShortcut(ParserInterface $shortcut): static
{
$this->shortcutParsers[] = $shortcut;
diff --git a/vendor/symfony/css-selector/XPath/XPathExpr.php b/vendor/symfony/css-selector/XPath/XPathExpr.php
index e45ce7d8..a76e30be 100644
--- a/vendor/symfony/css-selector/XPath/XPathExpr.php
+++ b/vendor/symfony/css-selector/XPath/XPathExpr.php
@@ -23,9 +23,9 @@
*/
class XPathExpr
{
- private $path;
- private $element;
- private $condition;
+ private string $path;
+ private string $element;
+ private string $condition;
public function __construct(string $path = '', string $element = '*', string $condition = '', bool $starPrefix = false)
{
@@ -46,7 +46,7 @@ public function getElement(): string
/**
* @return $this
*/
- public function addCondition(string $condition): self
+ public function addCondition(string $condition): static
{
$this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition;
@@ -61,7 +61,7 @@ public function getCondition(): string
/**
* @return $this
*/
- public function addNameTest(): self
+ public function addNameTest(): static
{
if ('*' !== $this->element) {
$this->addCondition('name() = '.Translator::getXpathLiteral($this->element));
@@ -74,7 +74,7 @@ public function addNameTest(): self
/**
* @return $this
*/
- public function addStarPrefix(): self
+ public function addStarPrefix(): static
{
$this->path .= '*/';
@@ -86,7 +86,7 @@ public function addStarPrefix(): self
*
* @return $this
*/
- public function join(string $combiner, self $expr): self
+ public function join(string $combiner, self $expr): static
{
$path = $this->__toString().$combiner;
diff --git a/vendor/symfony/css-selector/composer.json b/vendor/symfony/css-selector/composer.json
index f0b71249..7c9551cd 100644
--- a/vendor/symfony/css-selector/composer.json
+++ b/vendor/symfony/css-selector/composer.json
@@ -20,8 +20,7 @@
}
],
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\CssSelector\\": "" },
diff --git a/vendor/symfony/deprecation-contracts/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore
deleted file mode 100644
index c49a5d8d..00000000
--- a/vendor/symfony/deprecation-contracts/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-vendor/
-composer.lock
-phpunit.xml
diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md
deleted file mode 100644
index 7932e261..00000000
--- a/vendor/symfony/deprecation-contracts/CHANGELOG.md
+++ /dev/null
@@ -1,5 +0,0 @@
-CHANGELOG
-=========
-
-The changelog is maintained for all Symfony contracts at the following URL:
-https://github.com/symfony/contracts/blob/main/CHANGELOG.md
diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE
deleted file mode 100644
index 406242ff..00000000
--- a/vendor/symfony/deprecation-contracts/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2020-2022 Fabien Potencier
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md
deleted file mode 100644
index 4957933a..00000000
--- a/vendor/symfony/deprecation-contracts/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-Symfony Deprecation Contracts
-=============================
-
-A generic function and convention to trigger deprecation notices.
-
-This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices.
-
-By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component,
-the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments.
-
-The function requires at least 3 arguments:
- - the name of the Composer package that is triggering the deprecation
- - the version of the package that introduced the deprecation
- - the message of the deprecation
- - more arguments can be provided: they will be inserted in the message using `printf()` formatting
-
-Example:
-```php
-trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
-```
-
-This will generate the following message:
-`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`
-
-While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty
-`function trigger_deprecation() {}` in your application.
diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json
deleted file mode 100644
index cc7cc123..00000000
--- a/vendor/symfony/deprecation-contracts/composer.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "symfony/deprecation-contracts",
- "type": "library",
- "description": "A generic function and convention to trigger deprecation notices",
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "require": {
- "php": ">=7.1"
- },
- "autoload": {
- "files": [
- "function.php"
- ]
- },
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-main": "2.5-dev"
- },
- "thanks": {
- "name": "symfony/contracts",
- "url": "https://github.com/symfony/contracts"
- }
- }
-}
diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php
deleted file mode 100644
index d4371504..00000000
--- a/vendor/symfony/deprecation-contracts/function.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (!function_exists('trigger_deprecation')) {
- /**
- * Triggers a silenced deprecation notice.
- *
- * @param string $package The name of the Composer package that is triggering the deprecation
- * @param string $version The version of the package that introduced the deprecation
- * @param string $message The message of the deprecation
- * @param mixed ...$args Values to insert in the message using printf() formatting
- *
- * @author Nicolas Grekas
- */
- function trigger_deprecation(string $package, string $version, string $message, ...$args): void
- {
- @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
- }
-}
diff --git a/vendor/symfony/dom-crawler/AbstractUriElement.php b/vendor/symfony/dom-crawler/AbstractUriElement.php
index 8ff0b992..c1417425 100644
--- a/vendor/symfony/dom-crawler/AbstractUriElement.php
+++ b/vendor/symfony/dom-crawler/AbstractUriElement.php
@@ -55,49 +55,39 @@ public function __construct(\DOMElement $node, string $currentUri = null, ?strin
/**
* Gets the node associated with this link.
- *
- * @return \DOMElement
*/
- public function getNode()
+ public function getNode(): \DOMElement
{
return $this->node;
}
/**
* Gets the method associated with this link.
- *
- * @return string
*/
- public function getMethod()
+ public function getMethod(): string
{
return $this->method ?? 'GET';
}
/**
* Gets the URI associated with this link.
- *
- * @return string
*/
- public function getUri()
+ public function getUri(): string
{
return UriResolver::resolve($this->getRawUri(), $this->currentUri);
}
/**
* Returns raw URI data.
- *
- * @return string
*/
- abstract protected function getRawUri();
+ abstract protected function getRawUri(): string;
/**
* Returns the canonicalized URI path (see RFC 3986, section 5.2.4).
*
* @param string $path URI path
- *
- * @return string
*/
- protected function canonicalizePath(string $path)
+ protected function canonicalizePath(string $path): string
{
if ('' === $path || '/' === $path) {
return $path;
diff --git a/vendor/symfony/dom-crawler/CHANGELOG.md b/vendor/symfony/dom-crawler/CHANGELOG.md
index 6904b37a..12542964 100644
--- a/vendor/symfony/dom-crawler/CHANGELOG.md
+++ b/vendor/symfony/dom-crawler/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========
+6.0
+---
+
+ * Remove `Crawler::parents()` method, use `ancestors()` instead
+
5.4
---
diff --git a/vendor/symfony/dom-crawler/Crawler.php b/vendor/symfony/dom-crawler/Crawler.php
index 08baced5..3cd410fd 100644
--- a/vendor/symfony/dom-crawler/Crawler.php
+++ b/vendor/symfony/dom-crawler/Crawler.php
@@ -30,58 +30,40 @@ class Crawler implements \Countable, \IteratorAggregate
/**
* The default namespace prefix to be used with XPath and CSS expressions.
- *
- * @var string
*/
- private $defaultNamespacePrefix = 'default';
+ private string $defaultNamespacePrefix = 'default';
/**
* A map of manually registered namespaces.
*
* @var array
*/
- private $namespaces = [];
+ private array $namespaces = [];
/**
* A map of cached namespaces.
- *
- * @var \ArrayObject
*/
- private $cachedNamespaces;
+ private \ArrayObject $cachedNamespaces;
- /**
- * The base href value.
- *
- * @var string|null
- */
- private $baseHref;
-
- /**
- * @var \DOMDocument|null
- */
- private $document;
+ private ?string $baseHref;
+ private ?\DOMDocument $document = null;
/**
* @var list<\DOMNode>
*/
- private $nodes = [];
+ private array $nodes = [];
/**
* Whether the Crawler contains HTML or XML content (used when converting CSS to XPath).
- *
- * @var bool
*/
- private $isHtml = true;
+ private bool $isHtml = true;
- /**
- * @var HTML5|null
- */
private $html5Parser;
/**
* @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A Node to use as the base for the crawling
*/
- public function __construct($node = null, string $uri = null, string $baseHref = null)
+ public function __construct(\DOMNodeList|\DOMNode|array|string $node = null, string $uri = null, string $baseHref = null)
{
$this->uri = $uri;
$this->baseHref = $baseHref ?: $uri;
@@ -93,20 +75,16 @@ public function __construct($node = null, string $uri = null, string $baseHref =
/**
* Returns the current URI.
- *
- * @return string|null
*/
- public function getUri()
+ public function getUri(): ?string
{
return $this->uri;
}
/**
* Returns base href.
- *
- * @return string|null
*/
- public function getBaseHref()
+ public function getBaseHref(): ?string
{
return $this->baseHref;
}
@@ -131,7 +109,7 @@ public function clear()
*
* @throws \InvalidArgumentException when node is not the expected type
*/
- public function add($node)
+ public function add(\DOMNodeList|\DOMNode|array|string|null $node)
{
if ($node instanceof \DOMNodeList) {
$this->addNodeList($node);
@@ -235,9 +213,6 @@ public function addXmlContent(string $content, string $charset = 'UTF-8', int $o
}
$internalErrors = libxml_use_internal_errors(true);
- if (\LIBXML_VERSION < 20900) {
- $disableEntities = libxml_disable_entity_loader(true);
- }
$dom = new \DOMDocument('1.0', $charset);
$dom->validateOnParse = true;
@@ -247,9 +222,6 @@ public function addXmlContent(string $content, string $charset = 'UTF-8', int $o
}
libxml_use_internal_errors($internalErrors);
- if (\LIBXML_VERSION < 20900) {
- libxml_disable_entity_loader($disableEntities);
- }
$this->addDocument($dom);
@@ -323,10 +295,8 @@ public function addNode(\DOMNode $node)
/**
* Returns a node given its position in the node list.
- *
- * @return static
*/
- public function eq(int $position)
+ public function eq(int $position): static
{
if (isset($this->nodes[$position])) {
return $this->createSubCrawler($this->nodes[$position]);
@@ -351,7 +321,7 @@ public function eq(int $position)
*
* @return array An array of values returned by the anonymous function
*/
- public function each(\Closure $closure)
+ public function each(\Closure $closure): array
{
$data = [];
foreach ($this->nodes as $i => $node) {
@@ -363,10 +333,8 @@ public function each(\Closure $closure)
/**
* Slices the list of nodes by $offset and $length.
- *
- * @return static
*/
- public function slice(int $offset = 0, int $length = null)
+ public function slice(int $offset = 0, int $length = null): static
{
return $this->createSubCrawler(\array_slice($this->nodes, $offset, $length));
}
@@ -377,10 +345,8 @@ public function slice(int $offset = 0, int $length = null)
* To remove a node from the list, the anonymous function must return false.
*
* @param \Closure $closure An anonymous function
- *
- * @return static
*/
- public function reduce(\Closure $closure)
+ public function reduce(\Closure $closure): static
{
$nodes = [];
foreach ($this->nodes as $i => $node) {
@@ -394,20 +360,16 @@ public function reduce(\Closure $closure)
/**
* Returns the first node of the current selection.
- *
- * @return static
*/
- public function first()
+ public function first(): static
{
return $this->eq(0);
}
/**
* Returns the last node of the current selection.
- *
- * @return static
*/
- public function last()
+ public function last(): static
{
return $this->eq(\count($this->nodes) - 1);
}
@@ -415,11 +377,9 @@ public function last()
/**
* Returns the siblings nodes of the current selection.
*
- * @return static
- *
* @throws \InvalidArgumentException When current node is empty
*/
- public function siblings()
+ public function siblings(): static
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -470,11 +430,9 @@ public function closest(string $selector): ?self
/**
* Returns the next siblings nodes of the current selection.
*
- * @return static
- *
* @throws \InvalidArgumentException When current node is empty
*/
- public function nextAll()
+ public function nextAll(): static
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -486,11 +444,9 @@ public function nextAll()
/**
* Returns the previous sibling nodes of the current selection.
*
- * @return static
- *
* @throws \InvalidArgumentException
*/
- public function previousAll()
+ public function previousAll(): static
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -499,28 +455,12 @@ public function previousAll()
return $this->createSubCrawler($this->sibling($this->getNode(0), 'previousSibling'));
}
- /**
- * Returns the parent nodes of the current selection.
- *
- * @return static
- *
- * @throws \InvalidArgumentException When current node is empty
- */
- public function parents()
- {
- trigger_deprecation('symfony/dom-crawler', '5.3', 'The %s() method is deprecated, use ancestors() instead.', __METHOD__);
-
- return $this->ancestors();
- }
-
/**
* Returns the ancestors of the current selection.
*
- * @return static
- *
* @throws \InvalidArgumentException When the current node is empty
*/
- public function ancestors()
+ public function ancestors(): static
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -541,12 +481,10 @@ public function ancestors()
/**
* Returns the children nodes of the current selection.
*
- * @return static
- *
* @throws \InvalidArgumentException When current node is empty
* @throws \RuntimeException If the CssSelector Component is not available and $selector is provided
*/
- public function children(string $selector = null)
+ public function children(string $selector = null): static
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -567,11 +505,9 @@ public function children(string $selector = null)
/**
* Returns the attribute value of the first node of the list.
*
- * @return string|null
- *
* @throws \InvalidArgumentException When current node is empty
*/
- public function attr(string $attribute)
+ public function attr(string $attribute): ?string
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -585,11 +521,9 @@ public function attr(string $attribute)
/**
* Returns the node name of the first node of the list.
*
- * @return string
- *
* @throws \InvalidArgumentException When current node is empty
*/
- public function nodeName()
+ public function nodeName(): string
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -606,11 +540,9 @@ public function nodeName()
* @param string|null $default When not null: the value to return when the current node is empty
* @param bool $normalizeWhitespace Whether whitespaces should be trimmed and normalized to single spaces
*
- * @return string
- *
* @throws \InvalidArgumentException When current node is empty
*/
- public function text(string $default = null, bool $normalizeWhitespace = true)
+ public function text(string $default = null, bool $normalizeWhitespace = true): string
{
if (!$this->nodes) {
if (null !== $default) {
@@ -642,11 +574,9 @@ public function innerText(): string
*
* @param string|null $default When not null: the value to return when the current node is empty
*
- * @return string
- *
* @throws \InvalidArgumentException When current node is empty
*/
- public function html(string $default = null)
+ public function html(string $default = null): string
{
if (!$this->nodes) {
if (null !== $default) {
@@ -692,10 +622,8 @@ public function outerHtml(): string
*
* Since an XPath expression might evaluate to either a simple type or a \DOMNodeList,
* this method will return either an array of simple types or a new Crawler instance.
- *
- * @return array|Crawler
*/
- public function evaluate(string $xpath)
+ public function evaluate(string $xpath): array|Crawler
{
if (null === $this->document) {
throw new \LogicException('Cannot evaluate the expression on an uninitialized crawler.');
@@ -723,10 +651,8 @@ public function evaluate(string $xpath)
* Example:
*
* $crawler->filter('h1 a')->extract(['_text', 'href']);
- *
- * @return array
*/
- public function extract(array $attributes)
+ public function extract(array $attributes): array
{
$count = \count($attributes);
@@ -756,10 +682,8 @@ public function extract(array $attributes)
* is considered as a fake parent of the elements inside it.
* This means that a child selector "div" or "./div" will match only
* the div elements of the current crawler, not their children.
- *
- * @return static
*/
- public function filterXPath(string $xpath)
+ public function filterXPath(string $xpath): static
{
$xpath = $this->relativize($xpath);
@@ -776,11 +700,9 @@ public function filterXPath(string $xpath)
*
* This method only works if you have installed the CssSelector Symfony Component.
*
- * @return static
- *
- * @throws \LogicException if the CssSelector Component is not available
+ * @throws \RuntimeException if the CssSelector Component is not available
*/
- public function filter(string $selector)
+ public function filter(string $selector): static
{
$converter = $this->createCssSelectorConverter();
@@ -790,10 +712,8 @@ public function filter(string $selector)
/**
* Selects links by name or alt value for clickable images.
- *
- * @return static
*/
- public function selectLink(string $value)
+ public function selectLink(string $value): static
{
return $this->filterRelativeXPath(
sprintf('descendant-or-self::a[contains(concat(\' \', normalize-space(string(.)), \' \'), %1$s) or ./img[contains(concat(\' \', normalize-space(string(@alt)), \' \'), %1$s)]]', static::xpathLiteral(' '.$value.' '))
@@ -802,10 +722,8 @@ public function selectLink(string $value)
/**
* Selects images by alt value.
- *
- * @return static
*/
- public function selectImage(string $value)
+ public function selectImage(string $value): static
{
$xpath = sprintf('descendant-or-self::img[contains(normalize-space(string(@alt)), %s)]', static::xpathLiteral($value));
@@ -814,10 +732,8 @@ public function selectImage(string $value)
/**
* Selects a button by name or alt value for images.
- *
- * @return static
*/
- public function selectButton(string $value)
+ public function selectButton(string $value): static
{
return $this->filterRelativeXPath(
sprintf('descendant-or-self::input[((contains(%1$s, "submit") or contains(%1$s, "button")) and contains(concat(\' \', normalize-space(string(@value)), \' \'), %2$s)) or (contains(%1$s, "image") and contains(concat(\' \', normalize-space(string(@alt)), \' \'), %2$s)) or @id=%3$s or @name=%3$s] | descendant-or-self::button[contains(concat(\' \', normalize-space(string(.)), \' \'), %2$s) or @id=%3$s or @name=%3$s]', 'translate(@type, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")', static::xpathLiteral(' '.$value.' '), static::xpathLiteral($value))
@@ -827,11 +743,9 @@ public function selectButton(string $value)
/**
* Returns a Link object for the first node in the list.
*
- * @return Link
- *
* @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
*/
- public function link(string $method = 'get')
+ public function link(string $method = 'get'): Link
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -853,7 +767,7 @@ public function link(string $method = 'get')
*
* @throws \InvalidArgumentException If the current node list contains non-DOMElement instances
*/
- public function links()
+ public function links(): array
{
$links = [];
foreach ($this->nodes as $node) {
@@ -870,11 +784,9 @@ public function links()
/**
* Returns an Image object for the first node in the list.
*
- * @return Image
- *
* @throws \InvalidArgumentException If the current node list is empty
*/
- public function image()
+ public function image(): Image
{
if (!\count($this)) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -894,7 +806,7 @@ public function image()
*
* @return Image[]
*/
- public function images()
+ public function images(): array
{
$images = [];
foreach ($this as $node) {
@@ -911,11 +823,9 @@ public function images()
/**
* Returns a Form object for the first node in the list.
*
- * @return Form
- *
* @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
*/
- public function form(array $values = null, string $method = null)
+ public function form(array $values = null, string $method = null): Form
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
@@ -964,10 +874,8 @@ public function registerNamespace(string $prefix, string $namespace)
*
* echo Crawler::xpathLiteral('a\'b"c');
* //prints concat('a', "'", 'b"c')
- *
- * @return string
*/
- public static function xpathLiteral(string $s)
+ public static function xpathLiteral(string $s): string
{
if (!str_contains($s, "'")) {
return sprintf("'%s'", $s);
@@ -997,10 +905,8 @@ public static function xpathLiteral(string $s)
* Filters the list of nodes with an XPath expression.
*
* The XPath expression should already be processed to apply it in the context of each node.
- *
- * @return static
*/
- private function filterRelativeXPath(string $xpath): object
+ private function filterRelativeXPath(string $xpath): static
{
$crawler = $this->createSubCrawler(null);
if (null === $this->document) {
@@ -1106,19 +1012,12 @@ private function relativize(string $xpath): string
return $xpath; // The XPath expression is invalid
}
- /**
- * @return \DOMNode|null
- */
- public function getNode(int $position)
+ public function getNode(int $position): ?\DOMNode
{
return $this->nodes[$position] ?? null;
}
- /**
- * @return int
- */
- #[\ReturnTypeWillChange]
- public function count()
+ public function count(): int
{
return \count($this->nodes);
}
@@ -1126,16 +1025,12 @@ public function count()
/**
* @return \ArrayIterator
*/
- #[\ReturnTypeWillChange]
- public function getIterator()
+ public function getIterator(): \ArrayIterator
{
return new \ArrayIterator($this->nodes);
}
- /**
- * @return array
- */
- protected function sibling(\DOMNode $node, string $siblingDir = 'nextSibling')
+ protected function sibling(\DOMNode $node, string $siblingDir = 'nextSibling'): array
{
$nodes = [];
@@ -1159,9 +1054,6 @@ private function parseXhtml(string $htmlContent, string $charset = 'UTF-8'): \DO
$htmlContent = $this->convertToHtmlEntities($htmlContent, $charset);
$internalErrors = libxml_use_internal_errors(true);
- if (\LIBXML_VERSION < 20900) {
- $disableEntities = libxml_disable_entity_loader(true);
- }
$dom = new \DOMDocument('1.0', $charset);
$dom->validateOnParse = true;
@@ -1171,9 +1063,6 @@ private function parseXhtml(string $htmlContent, string $charset = 'UTF-8'): \DO
}
libxml_use_internal_errors($internalErrors);
- if (\LIBXML_VERSION < 20900) {
- libxml_disable_entity_loader($disableEntities);
- }
return $dom;
}
@@ -1249,10 +1138,8 @@ private function findNamespacePrefixes(string $xpath): array
* Creates a crawler for some subnodes.
*
* @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $nodes
- *
- * @return static
*/
- private function createSubCrawler($nodes): object
+ private function createSubCrawler(\DOMNodeList|\DOMNode|array|string|null $nodes): static
{
$crawler = new static($nodes, $this->uri, $this->baseHref);
$crawler->isHtml = $this->isHtml;
diff --git a/vendor/symfony/dom-crawler/Field/ChoiceFormField.php b/vendor/symfony/dom-crawler/Field/ChoiceFormField.php
index 9eed27ba..918a18e2 100644
--- a/vendor/symfony/dom-crawler/Field/ChoiceFormField.php
+++ b/vendor/symfony/dom-crawler/Field/ChoiceFormField.php
@@ -20,29 +20,17 @@
*/
class ChoiceFormField extends FormField
{
- /**
- * @var string
- */
- private $type;
- /**
- * @var bool
- */
- private $multiple;
- /**
- * @var array
- */
- private $options;
- /**
- * @var bool
- */
- private $validationDisabled = false;
+ private string $type;
+ private bool $multiple;
+ private array $options;
+ private bool $validationDisabled = false;
/**
* Returns true if the field should be included in the submitted values.
*
* @return bool true if the field should be included in the submitted values, false otherwise
*/
- public function hasValue()
+ public function hasValue(): bool
{
// don't send a value for unchecked checkboxes
if (\in_array($this->type, ['checkbox', 'radio']) && null === $this->value) {
@@ -54,10 +42,8 @@ public function hasValue()
/**
* Check if the current selected option is disabled.
- *
- * @return bool
*/
- public function isDisabled()
+ public function isDisabled(): bool
{
if (parent::isDisabled() && 'select' === $this->type) {
return true;
@@ -74,10 +60,8 @@ public function isDisabled()
/**
* Sets the value of the field.
- *
- * @param string|array $value The value of the field
*/
- public function select($value)
+ public function select(string|array|bool $value)
{
$this->setValue($value);
}
@@ -113,11 +97,9 @@ public function untick()
/**
* Sets the value of the field.
*
- * @param string|array|bool|null $value The value of the field
- *
* @throws \InvalidArgumentException When value type provided is not correct
*/
- public function setValue($value)
+ public function setValue(string|array|bool|null $value)
{
if ('checkbox' === $this->type && false === $value) {
// uncheck
@@ -175,20 +157,16 @@ public function addChoice(\DOMElement $node)
/**
* Returns the type of the choice field (radio, select, or checkbox).
- *
- * @return string
*/
- public function getType()
+ public function getType(): string
{
return $this->type;
}
/**
* Returns true if the field accepts multiple values.
- *
- * @return bool
*/
- public function isMultiple()
+ public function isMultiple(): bool
{
return $this->multiple;
}
@@ -268,11 +246,9 @@ private function buildOptionValue(\DOMElement $node): array
/**
* Checks whether given value is in the existing options.
*
- * @internal since Symfony 5.3
- *
- * @return bool
+ * @internal
*/
- public function containsOption(string $optionValue, array $options)
+ public function containsOption(string $optionValue, array $options): bool
{
if ($this->validationDisabled) {
return true;
@@ -290,11 +266,9 @@ public function containsOption(string $optionValue, array $options)
/**
* Returns list of available field options.
*
- * @internal since Symfony 5.3
- *
- * @return array
+ * @internal
*/
- public function availableOptionValues()
+ public function availableOptionValues(): array
{
$values = [];
@@ -308,11 +282,11 @@ public function availableOptionValues()
/**
* Disables the internal validation of the field.
*
- * @internal since Symfony 5.3
+ * @internal
*
* @return $this
*/
- public function disableValidation()
+ public function disableValidation(): static
{
$this->validationDisabled = true;
diff --git a/vendor/symfony/dom-crawler/Field/FormField.php b/vendor/symfony/dom-crawler/Field/FormField.php
index 066af4a1..2edb1090 100644
--- a/vendor/symfony/dom-crawler/Field/FormField.php
+++ b/vendor/symfony/dom-crawler/Field/FormField.php
@@ -57,10 +57,8 @@ public function __construct(\DOMElement $node)
/**
* Returns the label tag associated to the field or null if none.
- *
- * @return \DOMElement|null
*/
- public function getLabel()
+ public function getLabel(): ?\DOMElement
{
$xpath = new \DOMXPath($this->node->ownerDocument);
@@ -78,20 +76,16 @@ public function getLabel()
/**
* Returns the name of the field.
- *
- * @return string
*/
- public function getName()
+ public function getName(): string
{
return $this->name;
}
/**
* Gets the value of the field.
- *
- * @return string|array|null
*/
- public function getValue()
+ public function getValue(): string|array|null
{
return $this->value;
}
@@ -106,20 +100,16 @@ public function setValue(?string $value)
/**
* Returns true if the field should be included in the submitted values.
- *
- * @return bool
*/
- public function hasValue()
+ public function hasValue(): bool
{
return true;
}
/**
* Check if the current field is disabled.
- *
- * @return bool
*/
- public function isDisabled()
+ public function isDisabled(): bool
{
return $this->node->hasAttribute('disabled');
}
diff --git a/vendor/symfony/dom-crawler/Form.php b/vendor/symfony/dom-crawler/Form.php
index ebad35b3..8d0b2aa4 100644
--- a/vendor/symfony/dom-crawler/Form.php
+++ b/vendor/symfony/dom-crawler/Form.php
@@ -21,20 +21,9 @@
*/
class Form extends Link implements \ArrayAccess
{
- /**
- * @var \DOMElement
- */
- private $button;
-
- /**
- * @var FormFieldRegistry
- */
+ private \DOMElement $button;
private $fields;
-
- /**
- * @var string
- */
- private $baseHref;
+ private ?string $baseHref;
/**
* @param \DOMElement $node A \DOMElement instance
@@ -54,10 +43,8 @@ public function __construct(\DOMElement $node, string $currentUri = null, string
/**
* Gets the form node associated with this form.
- *
- * @return \DOMElement
*/
- public function getFormNode()
+ public function getFormNode(): \DOMElement
{
return $this->node;
}
@@ -69,7 +56,7 @@ public function getFormNode()
*
* @return $this
*/
- public function setValues(array $values)
+ public function setValues(array $values): static
{
foreach ($values as $name => $value) {
$this->fields->set($name, $value);
@@ -82,10 +69,8 @@ public function setValues(array $values)
* Gets the field values.
*
* The returned array does not include file fields (@see getFiles).
- *
- * @return array
*/
- public function getValues()
+ public function getValues(): array
{
$values = [];
foreach ($this->fields->all() as $name => $field) {
@@ -103,10 +88,8 @@ public function getValues()
/**
* Gets the file field values.
- *
- * @return array
*/
- public function getFiles()
+ public function getFiles(): array
{
if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) {
return [];
@@ -132,10 +115,8 @@ public function getFiles()
*
* This method converts fields with the array notation
* (like foo[bar] to arrays) like PHP does.
- *
- * @return array
*/
- public function getPhpValues()
+ public function getPhpValues(): array
{
$values = [];
foreach ($this->getValues() as $name => $value) {
@@ -159,10 +140,8 @@ public function getPhpValues()
* (@see getPhpValues), rather than uploaded files found in $_FILES.
* For a compound file field foo[bar] it will create foo[bar][name],
* instead of foo[name][bar] which would be found in $_FILES.
- *
- * @return array
*/
- public function getPhpFiles()
+ public function getPhpFiles(): array
{
$values = [];
foreach ($this->getFiles() as $name => $value) {
@@ -195,10 +174,8 @@ function (&$value, $key) {
* The returned URI is not the same as the form "action" attribute.
* This method merges the value if the method is GET to mimics
* browser behavior.
- *
- * @return string
*/
- public function getUri()
+ public function getUri(): string
{
$uri = parent::getUri();
@@ -219,7 +196,7 @@ public function getUri()
return $uri;
}
- protected function getRawUri()
+ protected function getRawUri(): string
{
// If the form was created from a button rather than the form node, check for HTML5 action overrides
if ($this->button !== $this->node && $this->button->getAttribute('formaction')) {
@@ -233,10 +210,8 @@ protected function getRawUri()
* Gets the form method.
*
* If no method is defined in the form, GET is returned.
- *
- * @return string
*/
- public function getMethod()
+ public function getMethod(): string
{
if (null !== $this->method) {
return $this->method;
@@ -262,10 +237,8 @@ public function getName(): string
/**
* Returns true if the named field exists.
- *
- * @return bool
*/
- public function has(string $name)
+ public function has(string $name): bool
{
return $this->fields->has($name);
}
@@ -285,7 +258,7 @@ public function remove(string $name)
*
* @throws \InvalidArgumentException When field is not present in this form
*/
- public function get(string $name)
+ public function get(string $name): FormField|array
{
return $this->fields->get($name);
}
@@ -303,7 +276,7 @@ public function set(FormField $field)
*
* @return FormField[]
*/
- public function all()
+ public function all(): array
{
return $this->fields->all();
}
@@ -312,11 +285,8 @@ public function all()
* Returns true if the named field exists.
*
* @param string $name The field name
- *
- * @return bool
*/
- #[\ReturnTypeWillChange]
- public function offsetExists($name)
+ public function offsetExists(mixed $name): bool
{
return $this->has($name);
}
@@ -330,8 +300,7 @@ public function offsetExists($name)
*
* @throws \InvalidArgumentException if the field does not exist
*/
- #[\ReturnTypeWillChange]
- public function offsetGet($name)
+ public function offsetGet(mixed $name): FormField|array
{
return $this->fields->get($name);
}
@@ -342,12 +311,9 @@ public function offsetGet($name)
* @param string $name The field name
* @param string|array $value The value of the field
*
- * @return void
- *
* @throws \InvalidArgumentException if the field does not exist
*/
- #[\ReturnTypeWillChange]
- public function offsetSet($name, $value)
+ public function offsetSet(mixed $name, mixed $value): void
{
$this->fields->set($name, $value);
}
@@ -356,11 +322,8 @@ public function offsetSet($name, $value)
* Removes a field from the form.
*
* @param string $name The field name
- *
- * @return void
*/
- #[\ReturnTypeWillChange]
- public function offsetUnset($name)
+ public function offsetUnset(mixed $name): void
{
$this->fields->remove($name);
}
@@ -370,7 +333,7 @@ public function offsetUnset($name)
*
* @return $this
*/
- public function disableValidation()
+ public function disableValidation(): static
{
foreach ($this->fields->all() as $field) {
if ($field instanceof Field\ChoiceFormField) {
diff --git a/vendor/symfony/dom-crawler/FormFieldRegistry.php b/vendor/symfony/dom-crawler/FormFieldRegistry.php
index 7f131e72..3db15b8f 100644
--- a/vendor/symfony/dom-crawler/FormFieldRegistry.php
+++ b/vendor/symfony/dom-crawler/FormFieldRegistry.php
@@ -20,9 +20,8 @@
*/
class FormFieldRegistry
{
- private $fields = [];
-
- private $base = '';
+ private array $fields = [];
+ private string $base = '';
/**
* Adds a field to the registry.
@@ -70,7 +69,7 @@ public function remove(string $name)
*
* @throws \InvalidArgumentException if the field does not exist
*/
- public function &get(string $name)
+ public function &get(string $name): FormField|array
{
$segments = $this->getSegments($name);
$target = &$this->fields;
@@ -102,11 +101,9 @@ public function has(string $name): bool
/**
* Set the value of a field based on the fully qualified name and its children.
*
- * @param mixed $value The value
- *
* @throws \InvalidArgumentException if the field does not exist
*/
- public function set(string $name, $value)
+ public function set(string $name, mixed $value)
{
$target = &$this->get($name);
if ((!\is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
diff --git a/vendor/symfony/dom-crawler/Image.php b/vendor/symfony/dom-crawler/Image.php
index b1ac5ca2..e5736415 100644
--- a/vendor/symfony/dom-crawler/Image.php
+++ b/vendor/symfony/dom-crawler/Image.php
@@ -21,7 +21,7 @@ public function __construct(\DOMElement $node, string $currentUri = null)
parent::__construct($node, $currentUri, 'GET');
}
- protected function getRawUri()
+ protected function getRawUri(): string
{
return $this->node->getAttribute('src');
}
diff --git a/vendor/symfony/dom-crawler/LICENSE b/vendor/symfony/dom-crawler/LICENSE
index 0138f8f0..00837045 100644
--- a/vendor/symfony/dom-crawler/LICENSE
+++ b/vendor/symfony/dom-crawler/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-present Fabien Potencier
+Copyright (c) 2004-2023 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/symfony/dom-crawler/Link.php b/vendor/symfony/dom-crawler/Link.php
index 80a356e4..658b4fd8 100644
--- a/vendor/symfony/dom-crawler/Link.php
+++ b/vendor/symfony/dom-crawler/Link.php
@@ -18,7 +18,7 @@
*/
class Link extends AbstractUriElement
{
- protected function getRawUri()
+ protected function getRawUri(): string
{
return $this->node->getAttribute('href');
}
diff --git a/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorAttributeValueSame.php b/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorAttributeValueSame.php
index a198784d..8c4248c0 100644
--- a/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorAttributeValueSame.php
+++ b/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorAttributeValueSame.php
@@ -16,9 +16,9 @@
final class CrawlerSelectorAttributeValueSame extends Constraint
{
- private $selector;
- private $attribute;
- private $expectedText;
+ private string $selector;
+ private string $attribute;
+ private string $expectedText;
public function __construct(string $selector, string $attribute, string $expectedText)
{
diff --git a/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorExists.php b/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorExists.php
index 112b772b..710ce551 100644
--- a/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorExists.php
+++ b/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorExists.php
@@ -16,7 +16,7 @@
final class CrawlerSelectorExists extends Constraint
{
- private $selector;
+ private string $selector;
public function __construct(string $selector)
{
diff --git a/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextContains.php b/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextContains.php
index c4697ecf..83305808 100644
--- a/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextContains.php
+++ b/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextContains.php
@@ -16,10 +16,10 @@
final class CrawlerSelectorTextContains extends Constraint
{
- private $selector;
- private $expectedText;
- private $hasNode = false;
- private $nodeText;
+ private string $selector;
+ private string $expectedText;
+ private bool $hasNode = false;
+ private string $nodeText;
public function __construct(string $selector, string $expectedText)
{
diff --git a/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextSame.php b/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextSame.php
index 551cdca8..e24b152f 100644
--- a/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextSame.php
+++ b/vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextSame.php
@@ -16,8 +16,8 @@
final class CrawlerSelectorTextSame extends Constraint
{
- private $selector;
- private $expectedText;
+ private string $selector;
+ private string $expectedText;
public function __construct(string $selector, string $expectedText)
{
diff --git a/vendor/symfony/dom-crawler/UriResolver.php b/vendor/symfony/dom-crawler/UriResolver.php
index 5ff22452..be64f525 100644
--- a/vendor/symfony/dom-crawler/UriResolver.php
+++ b/vendor/symfony/dom-crawler/UriResolver.php
@@ -70,7 +70,7 @@ public static function resolve(string $uri, ?string $baseUri): string
}
// relative path
- $path = parse_url(substr($baseUri, \strlen($baseUriCleaned)), \PHP_URL_PATH) ?? '';
+ $path = parse_url(substr($baseUri, \strlen($baseUriCleaned)), \PHP_URL_PATH);
$path = self::canonicalizePath(substr($path, 0, strrpos($path, '/')).'/'.$uri);
return $baseUriCleaned.('' === $path || '/' !== $path[0] ? '/' : '').$path;
diff --git a/vendor/symfony/dom-crawler/composer.json b/vendor/symfony/dom-crawler/composer.json
index f89432da..6d113dcb 100644
--- a/vendor/symfony/dom-crawler/composer.json
+++ b/vendor/symfony/dom-crawler/composer.json
@@ -16,14 +16,12 @@
}
],
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php80": "^1.16"
+ "symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
- "symfony/css-selector": "^4.4|^5.0|^6.0",
+ "symfony/css-selector": "^5.4|^6.0",
"masterminds/html5": "^2.6"
},
"conflict": {
diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE
deleted file mode 100644
index 0ed3a246..00000000
--- a/vendor/symfony/polyfill-php80/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2020-present Fabien Potencier
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php
deleted file mode 100644
index 362dd1a9..00000000
--- a/vendor/symfony/polyfill-php80/Php80.php
+++ /dev/null
@@ -1,115 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Polyfill\Php80;
-
-/**
- * @author Ion Bazan
- * @author Nico Oelgart
- * @author Nicolas Grekas
- *
- * @internal
- */
-final class Php80
-{
- public static function fdiv(float $dividend, float $divisor): float
- {
- return @($dividend / $divisor);
- }
-
- public static function get_debug_type($value): string
- {
- switch (true) {
- case null === $value: return 'null';
- case \is_bool($value): return 'bool';
- case \is_string($value): return 'string';
- case \is_array($value): return 'array';
- case \is_int($value): return 'int';
- case \is_float($value): return 'float';
- case \is_object($value): break;
- case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class';
- default:
- if (null === $type = @get_resource_type($value)) {
- return 'unknown';
- }
-
- if ('Unknown' === $type) {
- $type = 'closed';
- }
-
- return "resource ($type)";
- }
-
- $class = \get_class($value);
-
- if (false === strpos($class, '@')) {
- return $class;
- }
-
- return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous';
- }
-
- public static function get_resource_id($res): int
- {
- if (!\is_resource($res) && null === @get_resource_type($res)) {
- throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res)));
- }
-
- return (int) $res;
- }
-
- public static function preg_last_error_msg(): string
- {
- switch (preg_last_error()) {
- case \PREG_INTERNAL_ERROR:
- return 'Internal error';
- case \PREG_BAD_UTF8_ERROR:
- return 'Malformed UTF-8 characters, possibly incorrectly encoded';
- case \PREG_BAD_UTF8_OFFSET_ERROR:
- return 'The offset did not correspond to the beginning of a valid UTF-8 code point';
- case \PREG_BACKTRACK_LIMIT_ERROR:
- return 'Backtrack limit exhausted';
- case \PREG_RECURSION_LIMIT_ERROR:
- return 'Recursion limit exhausted';
- case \PREG_JIT_STACKLIMIT_ERROR:
- return 'JIT stack limit exhausted';
- case \PREG_NO_ERROR:
- return 'No error';
- default:
- return 'Unknown error';
- }
- }
-
- public static function str_contains(string $haystack, string $needle): bool
- {
- return '' === $needle || false !== strpos($haystack, $needle);
- }
-
- public static function str_starts_with(string $haystack, string $needle): bool
- {
- return 0 === strncmp($haystack, $needle, \strlen($needle));
- }
-
- public static function str_ends_with(string $haystack, string $needle): bool
- {
- if ('' === $needle || $needle === $haystack) {
- return true;
- }
-
- if ('' === $haystack) {
- return false;
- }
-
- $needleLength = \strlen($needle);
-
- return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
- }
-}
diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php
deleted file mode 100644
index fe6e6910..00000000
--- a/vendor/symfony/polyfill-php80/PhpToken.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Polyfill\Php80;
-
-/**
- * @author Fedonyuk Anton
- *
- * @internal
- */
-class PhpToken implements \Stringable
-{
- /**
- * @var int
- */
- public $id;
-
- /**
- * @var string
- */
- public $text;
-
- /**
- * @var int
- */
- public $line;
-
- /**
- * @var int
- */
- public $pos;
-
- public function __construct(int $id, string $text, int $line = -1, int $position = -1)
- {
- $this->id = $id;
- $this->text = $text;
- $this->line = $line;
- $this->pos = $position;
- }
-
- public function getTokenName(): ?string
- {
- if ('UNKNOWN' === $name = token_name($this->id)) {
- $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text;
- }
-
- return $name;
- }
-
- /**
- * @param int|string|array $kind
- */
- public function is($kind): bool
- {
- foreach ((array) $kind as $value) {
- if (\in_array($value, [$this->id, $this->text], true)) {
- return true;
- }
- }
-
- return false;
- }
-
- public function isIgnorable(): bool
- {
- return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true);
- }
-
- public function __toString(): string
- {
- return (string) $this->text;
- }
-
- /**
- * @return static[]
- */
- public static function tokenize(string $code, int $flags = 0): array
- {
- $line = 1;
- $position = 0;
- $tokens = token_get_all($code, $flags);
- foreach ($tokens as $index => $token) {
- if (\is_string($token)) {
- $id = \ord($token);
- $text = $token;
- } else {
- [$id, $text, $line] = $token;
- }
- $tokens[$index] = new static($id, $text, $line, $position);
- $position += \strlen($text);
- }
-
- return $tokens;
- }
-}
diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md
deleted file mode 100644
index 3816c559..00000000
--- a/vendor/symfony/polyfill-php80/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-Symfony Polyfill / Php80
-========================
-
-This component provides features added to PHP 8.0 core:
-
-- [`Stringable`](https://php.net/stringable) interface
-- [`fdiv`](https://php.net/fdiv)
-- [`ValueError`](https://php.net/valueerror) class
-- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class
-- `FILTER_VALIDATE_BOOL` constant
-- [`get_debug_type`](https://php.net/get_debug_type)
-- [`PhpToken`](https://php.net/phptoken) class
-- [`preg_last_error_msg`](https://php.net/preg_last_error_msg)
-- [`str_contains`](https://php.net/str_contains)
-- [`str_starts_with`](https://php.net/str_starts_with)
-- [`str_ends_with`](https://php.net/str_ends_with)
-- [`get_resource_id`](https://php.net/get_resource_id)
-
-More information can be found in the
-[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
-
-License
-=======
-
-This library is released under the [MIT license](LICENSE).
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
deleted file mode 100644
index 2b955423..00000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-#[Attribute(Attribute::TARGET_CLASS)]
-final class Attribute
-{
- public const TARGET_CLASS = 1;
- public const TARGET_FUNCTION = 2;
- public const TARGET_METHOD = 4;
- public const TARGET_PROPERTY = 8;
- public const TARGET_CLASS_CONSTANT = 16;
- public const TARGET_PARAMETER = 32;
- public const TARGET_ALL = 63;
- public const IS_REPEATABLE = 64;
-
- /** @var int */
- public $flags;
-
- public function __construct(int $flags = self::TARGET_ALL)
- {
- $this->flags = $flags;
- }
-}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
deleted file mode 100644
index bd1212f6..00000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) {
- class PhpToken extends Symfony\Polyfill\Php80\PhpToken
- {
- }
-}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
deleted file mode 100644
index 7c62d750..00000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (\PHP_VERSION_ID < 80000) {
- interface Stringable
- {
- /**
- * @return string
- */
- public function __toString();
- }
-}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
deleted file mode 100644
index 01c6c6c8..00000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (\PHP_VERSION_ID < 80000) {
- class UnhandledMatchError extends Error
- {
- }
-}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
deleted file mode 100644
index 783dbc28..00000000
--- a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (\PHP_VERSION_ID < 80000) {
- class ValueError extends Error
- {
- }
-}
diff --git a/vendor/symfony/polyfill-php80/bootstrap.php b/vendor/symfony/polyfill-php80/bootstrap.php
deleted file mode 100644
index e5f7dbc1..00000000
--- a/vendor/symfony/polyfill-php80/bootstrap.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-use Symfony\Polyfill\Php80 as p;
-
-if (\PHP_VERSION_ID >= 80000) {
- return;
-}
-
-if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) {
- define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN);
-}
-
-if (!function_exists('fdiv')) {
- function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); }
-}
-if (!function_exists('preg_last_error_msg')) {
- function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); }
-}
-if (!function_exists('str_contains')) {
- function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); }
-}
-if (!function_exists('str_starts_with')) {
- function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); }
-}
-if (!function_exists('str_ends_with')) {
- function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); }
-}
-if (!function_exists('get_debug_type')) {
- function get_debug_type($value): string { return p\Php80::get_debug_type($value); }
-}
-if (!function_exists('get_resource_id')) {
- function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); }
-}
diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json
deleted file mode 100644
index f1801f40..00000000
--- a/vendor/symfony/polyfill-php80/composer.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "symfony/polyfill-php80",
- "type": "library",
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
- "keywords": ["polyfill", "shim", "compatibility", "portable"],
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "require": {
- "php": ">=7.1"
- },
- "autoload": {
- "psr-4": { "Symfony\\Polyfill\\Php80\\": "" },
- "files": [ "bootstrap.php" ],
- "classmap": [ "Resources/stubs" ]
- },
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-main": "1.28-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- }
-}
diff --git a/vip-block-data-api.php b/vip-block-data-api.php
index 630a25c9..c48551cf 100644
--- a/vip-block-data-api.php
+++ b/vip-block-data-api.php
@@ -5,10 +5,10 @@
* Description: Access Gutenberg block data in JSON via the REST API.
* Author: WordPress VIP
* Text Domain: vip-block-data-api
- * Version: 1.1.0
- * Requires at least: 5.9
- * Tested up to: 6.3
- * Requires PHP: 7.4
+ * Version: 1.2.0
+ * Requires at least: 5.9.0
+ * Tested up to: 6.4
+ * Requires PHP: 8.0
* License: GPL-3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*
@@ -20,7 +20,7 @@
if ( ! defined( 'VIP_BLOCK_DATA_API_LOADED' ) ) {
define( 'VIP_BLOCK_DATA_API_LOADED', true );
- define( 'WPCOMVIP__BLOCK_DATA_API__PLUGIN_VERSION', '1.1.0' );
+ define( 'WPCOMVIP__BLOCK_DATA_API__PLUGIN_VERSION', '1.2.0' );
define( 'WPCOMVIP__BLOCK_DATA_API__REST_ROUTE', 'vip-block-data-api/v1' );
// Analytics related configs.