default services conflit ?
This commit is contained in:
202
old.vendor/symfony/dom-crawler/AbstractUriElement.php
Normal file
202
old.vendor/symfony/dom-crawler/AbstractUriElement.php
Normal file
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler;
|
||||
|
||||
/**
|
||||
* Any HTML element that can link to an URI.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
abstract class AbstractUriElement
|
||||
{
|
||||
/**
|
||||
* @var \DOMElement
|
||||
*/
|
||||
protected $node;
|
||||
|
||||
/**
|
||||
* @var string|null The method to use for the element
|
||||
*/
|
||||
protected $method;
|
||||
|
||||
/**
|
||||
* @var string The URI of the page where the element is embedded (or the base href)
|
||||
*/
|
||||
protected $currentUri;
|
||||
|
||||
/**
|
||||
* @param \DOMElement $node A \DOMElement instance
|
||||
* @param string|null $currentUri The URI of the page where the link is embedded (or the base href)
|
||||
* @param string|null $method The method to use for the link (GET by default)
|
||||
*
|
||||
* @throws \InvalidArgumentException if the node is not a link
|
||||
*/
|
||||
public function __construct(\DOMElement $node, string $currentUri = null, ?string $method = 'GET')
|
||||
{
|
||||
$this->setNode($node);
|
||||
$this->method = $method ? strtoupper($method) : null;
|
||||
$this->currentUri = $currentUri;
|
||||
|
||||
$elementUriIsRelative = null === parse_url(trim($this->getRawUri()), \PHP_URL_SCHEME);
|
||||
$baseUriIsAbsolute = null !== $this->currentUri && \in_array(strtolower(substr($this->currentUri, 0, 4)), ['http', 'file']);
|
||||
if ($elementUriIsRelative && !$baseUriIsAbsolute) {
|
||||
throw new \InvalidArgumentException(sprintf('The URL of the element is relative, so you must define its base URI passing an absolute URL to the constructor of the "%s" class ("%s" was passed).', __CLASS__, $this->currentUri));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the node associated with this link.
|
||||
*
|
||||
* @return \DOMElement A \DOMElement instance
|
||||
*/
|
||||
public function getNode()
|
||||
{
|
||||
return $this->node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the method associated with this link.
|
||||
*
|
||||
* @return string The method
|
||||
*/
|
||||
public function getMethod()
|
||||
{
|
||||
return $this->method ?? 'GET';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URI associated with this link.
|
||||
*
|
||||
* @return string The URI
|
||||
*/
|
||||
public function getUri()
|
||||
{
|
||||
$uri = trim($this->getRawUri());
|
||||
|
||||
// absolute URL?
|
||||
if (null !== parse_url($uri, \PHP_URL_SCHEME)) {
|
||||
return $uri;
|
||||
}
|
||||
|
||||
// empty URI
|
||||
if (!$uri) {
|
||||
return $this->currentUri;
|
||||
}
|
||||
|
||||
// an anchor
|
||||
if ('#' === $uri[0]) {
|
||||
return $this->cleanupAnchor($this->currentUri).$uri;
|
||||
}
|
||||
|
||||
$baseUri = $this->cleanupUri($this->currentUri);
|
||||
|
||||
if ('?' === $uri[0]) {
|
||||
return $baseUri.$uri;
|
||||
}
|
||||
|
||||
// absolute URL with relative schema
|
||||
if (str_starts_with($uri, '//')) {
|
||||
return preg_replace('#^([^/]*)//.*$#', '$1', $baseUri).$uri;
|
||||
}
|
||||
|
||||
$baseUri = preg_replace('#^(.*?//[^/]*)(?:\/.*)?$#', '$1', $baseUri);
|
||||
|
||||
// absolute path
|
||||
if ('/' === $uri[0]) {
|
||||
return $baseUri.$uri;
|
||||
}
|
||||
|
||||
// relative path
|
||||
$path = parse_url(substr($this->currentUri, \strlen($baseUri)), \PHP_URL_PATH);
|
||||
$path = $this->canonicalizePath(substr($path, 0, strrpos($path, '/')).'/'.$uri);
|
||||
|
||||
return $baseUri.('' === $path || '/' !== $path[0] ? '/' : '').$path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns raw URI data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract protected function getRawUri();
|
||||
|
||||
/**
|
||||
* Returns the canonicalized URI path (see RFC 3986, section 5.2.4).
|
||||
*
|
||||
* @param string $path URI path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function canonicalizePath($path)
|
||||
{
|
||||
if ('' === $path || '/' === $path) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
if (str_ends_with($path, '.')) {
|
||||
$path .= '/';
|
||||
}
|
||||
|
||||
$output = [];
|
||||
|
||||
foreach (explode('/', $path) as $segment) {
|
||||
if ('..' === $segment) {
|
||||
array_pop($output);
|
||||
} elseif ('.' !== $segment) {
|
||||
$output[] = $segment;
|
||||
}
|
||||
}
|
||||
|
||||
return implode('/', $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets current \DOMElement instance.
|
||||
*
|
||||
* @param \DOMElement $node A \DOMElement instance
|
||||
*
|
||||
* @throws \LogicException If given node is not an anchor
|
||||
*/
|
||||
abstract protected function setNode(\DOMElement $node);
|
||||
|
||||
/**
|
||||
* Removes the query string and the anchor from the given uri.
|
||||
*/
|
||||
private function cleanupUri(string $uri): string
|
||||
{
|
||||
return $this->cleanupQuery($this->cleanupAnchor($uri));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the query string from the uri.
|
||||
*/
|
||||
private function cleanupQuery(string $uri): string
|
||||
{
|
||||
if (false !== $pos = strpos($uri, '?')) {
|
||||
return substr($uri, 0, $pos);
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the anchor from the uri.
|
||||
*/
|
||||
private function cleanupAnchor(string $uri): string
|
||||
{
|
||||
if (false !== $pos = strpos($uri, '#')) {
|
||||
return substr($uri, 0, $pos);
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
||||
}
|
||||
80
old.vendor/symfony/dom-crawler/CHANGELOG.md
Normal file
80
old.vendor/symfony/dom-crawler/CHANGELOG.md
Normal file
@@ -0,0 +1,80 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
4.4.0
|
||||
-----
|
||||
|
||||
* Added `Form::getName()` method.
|
||||
* Added `Crawler::matches()` method.
|
||||
* Added `Crawler::closest()` method.
|
||||
* Added `Crawler::outerHtml()` method.
|
||||
* Added an argument to the `Crawler::text()` method to opt-in normalizing whitespaces.
|
||||
|
||||
4.3.0
|
||||
-----
|
||||
|
||||
* Added PHPUnit constraints: `CrawlerSelectorAttributeValueSame`, `CrawlerSelectorExists`, `CrawlerSelectorTextContains`
|
||||
and `CrawlerSelectorTextSame`
|
||||
* Added return of element name (`_name`) in `extract()` method.
|
||||
* Added ability to return a default value in `text()` and `html()` instead of throwing an exception when node is empty.
|
||||
* When available, the [html5-php library](https://github.com/Masterminds/html5-php) is used to
|
||||
parse HTML added to a Crawler for better support of HTML5 tags.
|
||||
|
||||
4.2.0
|
||||
-----
|
||||
|
||||
* The `$currentUri` constructor argument of the `AbstractUriElement`, `Link` and
|
||||
`Image` classes is now optional.
|
||||
* The `Crawler::children()` method will have a new `$selector` argument in version 5.0,
|
||||
not defining it is deprecated.
|
||||
|
||||
3.1.0
|
||||
-----
|
||||
|
||||
* All the URI parsing logic have been abstracted in the `AbstractUriElement` class.
|
||||
The `Link` class is now a child of `AbstractUriElement`.
|
||||
* Added an `Image` class to crawl images and parse their `src` attribute,
|
||||
and `selectImage`, `image`, `images` methods in the `Crawler` (the image version of the equivalent `link` methods).
|
||||
|
||||
2.5.0
|
||||
-----
|
||||
|
||||
* [BC BREAK] The default value for checkbox and radio inputs without a value attribute have changed
|
||||
from '1' to 'on' to match the HTML specification.
|
||||
* [BC BREAK] The typehints on the `Link`, `Form` and `FormField` classes have been changed from
|
||||
`\DOMNode` to `DOMElement`. Using any other type of `DOMNode` was triggering fatal errors in previous
|
||||
versions. Code extending these classes will need to update the typehints when overwriting these methods.
|
||||
|
||||
2.4.0
|
||||
-----
|
||||
|
||||
* `Crawler::addXmlContent()` removes the default document namespace again if it's an only namespace.
|
||||
* added support for automatic discovery and explicit registration of document
|
||||
namespaces for `Crawler::filterXPath()` and `Crawler::filter()`
|
||||
* improved content type guessing in `Crawler::addContent()`
|
||||
* [BC BREAK] `Crawler::addXmlContent()` no longer removes the default document
|
||||
namespace
|
||||
|
||||
2.3.0
|
||||
-----
|
||||
|
||||
* added Crawler::html()
|
||||
* [BC BREAK] Crawler::each() and Crawler::reduce() now return Crawler instances instead of DomElement instances
|
||||
* added schema relative URL support to links
|
||||
* added support for HTML5 'form' attribute
|
||||
|
||||
2.2.0
|
||||
-----
|
||||
|
||||
* added a way to set raw path to the file in FileFormField - necessary for
|
||||
simulating HTTP requests
|
||||
|
||||
2.1.0
|
||||
-----
|
||||
|
||||
* added support for the HTTP PATCH method
|
||||
* refactored the Form class internals to support multi-dimensional fields
|
||||
(the public API is backward compatible)
|
||||
* added a way to get parsing errors for Crawler::addHtmlContent() and
|
||||
Crawler::addXmlContent() via libxml functions
|
||||
* added support for submitting a form without a submit button
|
||||
1332
old.vendor/symfony/dom-crawler/Crawler.php
Normal file
1332
old.vendor/symfony/dom-crawler/Crawler.php
Normal file
File diff suppressed because it is too large
Load Diff
318
old.vendor/symfony/dom-crawler/Field/ChoiceFormField.php
Normal file
318
old.vendor/symfony/dom-crawler/Field/ChoiceFormField.php
Normal file
@@ -0,0 +1,318 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Field;
|
||||
|
||||
/**
|
||||
* ChoiceFormField represents a choice form field.
|
||||
*
|
||||
* It is constructed from an HTML select tag, or an HTML checkbox, or radio inputs.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class ChoiceFormField extends FormField
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $type;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $multiple;
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $options;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $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()
|
||||
{
|
||||
// don't send a value for unchecked checkboxes
|
||||
if (\in_array($this->type, ['checkbox', 'radio']) && null === $this->value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current selected option is disabled.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isDisabled()
|
||||
{
|
||||
if (parent::isDisabled() && 'select' === $this->type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($this->options as $option) {
|
||||
if ($option['value'] == $this->value && $option['disabled']) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string|array $value The value of the field
|
||||
*/
|
||||
public function select($value)
|
||||
{
|
||||
$this->setValue($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ticks a checkbox.
|
||||
*
|
||||
* @throws \LogicException When the type provided is not correct
|
||||
*/
|
||||
public function tick()
|
||||
{
|
||||
if ('checkbox' !== $this->type) {
|
||||
throw new \LogicException(sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
|
||||
}
|
||||
|
||||
$this->setValue(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unticks a checkbox.
|
||||
*
|
||||
* @throws \LogicException When the type provided is not correct
|
||||
*/
|
||||
public function untick()
|
||||
{
|
||||
if ('checkbox' !== $this->type) {
|
||||
throw new \LogicException(sprintf('You cannot untick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
|
||||
}
|
||||
|
||||
$this->setValue(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string|array|bool $value The value of the field
|
||||
*
|
||||
* @throws \InvalidArgumentException When value type provided is not correct
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
if ('checkbox' === $this->type && false === $value) {
|
||||
// uncheck
|
||||
$this->value = null;
|
||||
} elseif ('checkbox' === $this->type && true === $value) {
|
||||
// check
|
||||
$this->value = $this->options[0]['value'];
|
||||
} else {
|
||||
if (\is_array($value)) {
|
||||
if (!$this->multiple) {
|
||||
throw new \InvalidArgumentException(sprintf('The value for "%s" cannot be an array.', $this->name));
|
||||
}
|
||||
|
||||
foreach ($value as $v) {
|
||||
if (!$this->containsOption($v, $this->options)) {
|
||||
throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $v, implode('", "', $this->availableOptionValues())));
|
||||
}
|
||||
}
|
||||
} elseif (!$this->containsOption($value, $this->options)) {
|
||||
throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $value, implode('", "', $this->availableOptionValues())));
|
||||
}
|
||||
|
||||
if ($this->multiple) {
|
||||
$value = (array) $value;
|
||||
}
|
||||
|
||||
if (\is_array($value)) {
|
||||
$this->value = $value;
|
||||
} else {
|
||||
parent::setValue($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a choice to the current ones.
|
||||
*
|
||||
* @throws \LogicException When choice provided is not multiple nor radio
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function addChoice(\DOMElement $node)
|
||||
{
|
||||
if (!$this->multiple && 'radio' !== $this->type) {
|
||||
throw new \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
|
||||
}
|
||||
|
||||
$option = $this->buildOptionValue($node);
|
||||
$this->options[] = $option;
|
||||
|
||||
if ($node->hasAttribute('checked')) {
|
||||
$this->value = $option['value'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of the choice field (radio, select, or checkbox).
|
||||
*
|
||||
* @return string The type
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the field accepts multiple values.
|
||||
*
|
||||
* @return bool true if the field accepts multiple values, false otherwise
|
||||
*/
|
||||
public function isMultiple()
|
||||
{
|
||||
return $this->multiple;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the form field.
|
||||
*
|
||||
* @throws \LogicException When node type is incorrect
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
if ('input' !== $this->node->nodeName && 'select' !== $this->node->nodeName) {
|
||||
throw new \LogicException(sprintf('A ChoiceFormField can only be created from an input or select tag (%s given).', $this->node->nodeName));
|
||||
}
|
||||
|
||||
if ('input' === $this->node->nodeName && 'checkbox' !== strtolower($this->node->getAttribute('type')) && 'radio' !== strtolower($this->node->getAttribute('type'))) {
|
||||
throw new \LogicException(sprintf('A ChoiceFormField can only be created from an input tag with a type of checkbox or radio (given type is "%s").', $this->node->getAttribute('type')));
|
||||
}
|
||||
|
||||
$this->value = null;
|
||||
$this->options = [];
|
||||
$this->multiple = false;
|
||||
|
||||
if ('input' == $this->node->nodeName) {
|
||||
$this->type = strtolower($this->node->getAttribute('type'));
|
||||
$optionValue = $this->buildOptionValue($this->node);
|
||||
$this->options[] = $optionValue;
|
||||
|
||||
if ($this->node->hasAttribute('checked')) {
|
||||
$this->value = $optionValue['value'];
|
||||
}
|
||||
} else {
|
||||
$this->type = 'select';
|
||||
if ($this->node->hasAttribute('multiple')) {
|
||||
$this->multiple = true;
|
||||
$this->value = [];
|
||||
$this->name = str_replace('[]', '', $this->name);
|
||||
}
|
||||
|
||||
$found = false;
|
||||
foreach ($this->xpath->query('descendant::option', $this->node) as $option) {
|
||||
$optionValue = $this->buildOptionValue($option);
|
||||
$this->options[] = $optionValue;
|
||||
|
||||
if ($option->hasAttribute('selected')) {
|
||||
$found = true;
|
||||
if ($this->multiple) {
|
||||
$this->value[] = $optionValue['value'];
|
||||
} else {
|
||||
$this->value = $optionValue['value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if no option is selected and if it is a simple select box, take the first option as the value
|
||||
if (!$found && !$this->multiple && !empty($this->options)) {
|
||||
$this->value = $this->options[0]['value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns option value with associated disabled flag.
|
||||
*/
|
||||
private function buildOptionValue(\DOMElement $node): array
|
||||
{
|
||||
$option = [];
|
||||
|
||||
$defaultDefaultValue = 'select' === $this->node->nodeName ? '' : 'on';
|
||||
$defaultValue = (isset($node->nodeValue) && !empty($node->nodeValue)) ? $node->nodeValue : $defaultDefaultValue;
|
||||
$option['value'] = $node->hasAttribute('value') ? $node->getAttribute('value') : $defaultValue;
|
||||
$option['disabled'] = $node->hasAttribute('disabled');
|
||||
|
||||
return $option;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether given value is in the existing options.
|
||||
*
|
||||
* @param string $optionValue
|
||||
* @param array $options
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function containsOption($optionValue, $options)
|
||||
{
|
||||
if ($this->validationDisabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($options as $option) {
|
||||
if ($option['value'] == $optionValue) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of available field options.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function availableOptionValues()
|
||||
{
|
||||
$values = [];
|
||||
|
||||
foreach ($this->options as $option) {
|
||||
$values[] = $option['value'];
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the internal validation of the field.
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function disableValidation()
|
||||
{
|
||||
$this->validationDisabled = true;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
108
old.vendor/symfony/dom-crawler/Field/FileFormField.php
Normal file
108
old.vendor/symfony/dom-crawler/Field/FileFormField.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Field;
|
||||
|
||||
/**
|
||||
* FileFormField represents a file form field (an HTML file input tag).
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class FileFormField extends FormField
|
||||
{
|
||||
/**
|
||||
* Sets the PHP error code associated with the field.
|
||||
*
|
||||
* @param int $error The error code (one of UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, or UPLOAD_ERR_EXTENSION)
|
||||
*
|
||||
* @throws \InvalidArgumentException When error code doesn't exist
|
||||
*/
|
||||
public function setErrorCode($error)
|
||||
{
|
||||
$codes = [\UPLOAD_ERR_INI_SIZE, \UPLOAD_ERR_FORM_SIZE, \UPLOAD_ERR_PARTIAL, \UPLOAD_ERR_NO_FILE, \UPLOAD_ERR_NO_TMP_DIR, \UPLOAD_ERR_CANT_WRITE, \UPLOAD_ERR_EXTENSION];
|
||||
if (!\in_array($error, $codes)) {
|
||||
throw new \InvalidArgumentException(sprintf('The error code "%s" is not valid.', $error));
|
||||
}
|
||||
|
||||
$this->value = ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => $error, 'size' => 0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string $value The value of the field
|
||||
*/
|
||||
public function upload($value)
|
||||
{
|
||||
$this->setValue($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string|null $value The value of the field
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
if (null !== $value && is_readable($value)) {
|
||||
$error = \UPLOAD_ERR_OK;
|
||||
$size = filesize($value);
|
||||
$info = pathinfo($value);
|
||||
$name = $info['basename'];
|
||||
|
||||
// copy to a tmp location
|
||||
$tmp = sys_get_temp_dir().'/'.strtr(substr(base64_encode(hash('sha256', uniqid(mt_rand(), true), true)), 0, 7), '/', '_');
|
||||
if (\array_key_exists('extension', $info)) {
|
||||
$tmp .= '.'.$info['extension'];
|
||||
}
|
||||
if (is_file($tmp)) {
|
||||
unlink($tmp);
|
||||
}
|
||||
copy($value, $tmp);
|
||||
$value = $tmp;
|
||||
} else {
|
||||
$error = \UPLOAD_ERR_NO_FILE;
|
||||
$size = 0;
|
||||
$name = '';
|
||||
$value = '';
|
||||
}
|
||||
|
||||
$this->value = ['name' => $name, 'type' => '', 'tmp_name' => $value, 'error' => $error, 'size' => $size];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets path to the file as string for simulating HTTP request.
|
||||
*
|
||||
* @param string $path The path to the file
|
||||
*/
|
||||
public function setFilePath($path)
|
||||
{
|
||||
parent::setValue($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the form field.
|
||||
*
|
||||
* @throws \LogicException When node type is incorrect
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
if ('input' !== $this->node->nodeName) {
|
||||
throw new \LogicException(sprintf('A FileFormField can only be created from an input tag (%s given).', $this->node->nodeName));
|
||||
}
|
||||
|
||||
if ('file' !== strtolower($this->node->getAttribute('type'))) {
|
||||
throw new \LogicException(sprintf('A FileFormField can only be created from an input tag with a type of file (given type is "%s").', $this->node->getAttribute('type')));
|
||||
}
|
||||
|
||||
$this->setValue(null);
|
||||
}
|
||||
}
|
||||
133
old.vendor/symfony/dom-crawler/Field/FormField.php
Normal file
133
old.vendor/symfony/dom-crawler/Field/FormField.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Field;
|
||||
|
||||
/**
|
||||
* FormField is the abstract class for all form fields.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
abstract class FormField
|
||||
{
|
||||
/**
|
||||
* @var \DOMElement
|
||||
*/
|
||||
protected $node;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
/**
|
||||
* @var \DOMDocument
|
||||
*/
|
||||
protected $document;
|
||||
/**
|
||||
* @var \DOMXPath
|
||||
*/
|
||||
protected $xpath;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $disabled;
|
||||
|
||||
/**
|
||||
* @param \DOMElement $node The node associated with this field
|
||||
*/
|
||||
public function __construct(\DOMElement $node)
|
||||
{
|
||||
$this->node = $node;
|
||||
$this->name = $node->getAttribute('name');
|
||||
$this->xpath = new \DOMXPath($node->ownerDocument);
|
||||
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the label tag associated to the field or null if none.
|
||||
*
|
||||
* @return \DOMElement|null
|
||||
*/
|
||||
public function getLabel()
|
||||
{
|
||||
$xpath = new \DOMXPath($this->node->ownerDocument);
|
||||
|
||||
if ($this->node->hasAttribute('id')) {
|
||||
$labels = $xpath->query(sprintf('descendant::label[@for="%s"]', $this->node->getAttribute('id')));
|
||||
if ($labels->length > 0) {
|
||||
return $labels->item(0);
|
||||
}
|
||||
}
|
||||
|
||||
$labels = $xpath->query('ancestor::label[1]', $this->node);
|
||||
|
||||
return $labels->length > 0 ? $labels->item(0) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the field.
|
||||
*
|
||||
* @return string The name of the field
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the field.
|
||||
*
|
||||
* @return string|array The value of the field
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the field.
|
||||
*
|
||||
* @param string|array|bool|null $value The value of the field
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = (string) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current field is disabled.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isDisabled()
|
||||
{
|
||||
return $this->node->hasAttribute('disabled');
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the form field.
|
||||
*/
|
||||
abstract protected function initialize();
|
||||
}
|
||||
46
old.vendor/symfony/dom-crawler/Field/InputFormField.php
Normal file
46
old.vendor/symfony/dom-crawler/Field/InputFormField.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Field;
|
||||
|
||||
/**
|
||||
* InputFormField represents an input form field (an HTML input tag).
|
||||
*
|
||||
* For inputs with type of file, checkbox, or radio, there are other more
|
||||
* specialized classes (cf. FileFormField and ChoiceFormField).
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class InputFormField extends FormField
|
||||
{
|
||||
/**
|
||||
* Initializes the form field.
|
||||
*
|
||||
* @throws \LogicException When node type is incorrect
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
if ('input' !== $this->node->nodeName && 'button' !== $this->node->nodeName) {
|
||||
throw new \LogicException(sprintf('An InputFormField can only be created from an input or button tag (%s given).', $this->node->nodeName));
|
||||
}
|
||||
|
||||
$type = strtolower($this->node->getAttribute('type'));
|
||||
if ('checkbox' === $type) {
|
||||
throw new \LogicException('Checkboxes should be instances of ChoiceFormField.');
|
||||
}
|
||||
|
||||
if ('file' === $type) {
|
||||
throw new \LogicException('File inputs should be instances of FileFormField.');
|
||||
}
|
||||
|
||||
$this->value = $this->node->getAttribute('value');
|
||||
}
|
||||
}
|
||||
37
old.vendor/symfony/dom-crawler/Field/TextareaFormField.php
Normal file
37
old.vendor/symfony/dom-crawler/Field/TextareaFormField.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Field;
|
||||
|
||||
/**
|
||||
* TextareaFormField represents a textarea form field (an HTML textarea tag).
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class TextareaFormField extends FormField
|
||||
{
|
||||
/**
|
||||
* Initializes the form field.
|
||||
*
|
||||
* @throws \LogicException When node type is incorrect
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
if ('textarea' !== $this->node->nodeName) {
|
||||
throw new \LogicException(sprintf('A TextareaFormField can only be created from a textarea tag (%s given).', $this->node->nodeName));
|
||||
}
|
||||
|
||||
$this->value = '';
|
||||
foreach ($this->node->childNodes as $node) {
|
||||
$this->value .= $node->wholeText;
|
||||
}
|
||||
}
|
||||
}
|
||||
507
old.vendor/symfony/dom-crawler/Form.php
Normal file
507
old.vendor/symfony/dom-crawler/Form.php
Normal file
@@ -0,0 +1,507 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler;
|
||||
|
||||
use Symfony\Component\DomCrawler\Field\ChoiceFormField;
|
||||
use Symfony\Component\DomCrawler\Field\FormField;
|
||||
|
||||
/**
|
||||
* Form represents an HTML form.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class Form extends Link implements \ArrayAccess
|
||||
{
|
||||
/**
|
||||
* @var \DOMElement
|
||||
*/
|
||||
private $button;
|
||||
|
||||
/**
|
||||
* @var FormFieldRegistry
|
||||
*/
|
||||
private $fields;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $baseHref;
|
||||
|
||||
/**
|
||||
* @param \DOMElement $node A \DOMElement instance
|
||||
* @param string|null $currentUri The URI of the page where the form is embedded
|
||||
* @param string|null $method The method to use for the link (if null, it defaults to the method defined by the form)
|
||||
* @param string|null $baseHref The URI of the <base> used for relative links, but not for empty action
|
||||
*
|
||||
* @throws \LogicException if the node is not a button inside a form tag
|
||||
*/
|
||||
public function __construct(\DOMElement $node, string $currentUri = null, string $method = null, string $baseHref = null)
|
||||
{
|
||||
parent::__construct($node, $currentUri, $method);
|
||||
$this->baseHref = $baseHref;
|
||||
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the form node associated with this form.
|
||||
*
|
||||
* @return \DOMElement A \DOMElement instance
|
||||
*/
|
||||
public function getFormNode()
|
||||
{
|
||||
return $this->node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the fields.
|
||||
*
|
||||
* @param array $values An array of field values
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValues(array $values)
|
||||
{
|
||||
foreach ($values as $name => $value) {
|
||||
$this->fields->set($name, $value);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the field values.
|
||||
*
|
||||
* The returned array does not include file fields (@see getFiles).
|
||||
*
|
||||
* @return array An array of field values
|
||||
*/
|
||||
public function getValues()
|
||||
{
|
||||
$values = [];
|
||||
foreach ($this->fields->all() as $name => $field) {
|
||||
if ($field->isDisabled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$field instanceof Field\FileFormField && $field->hasValue()) {
|
||||
$values[$name] = $field->getValue();
|
||||
}
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the file field values.
|
||||
*
|
||||
* @return array An array of file field values
|
||||
*/
|
||||
public function getFiles()
|
||||
{
|
||||
if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$files = [];
|
||||
|
||||
foreach ($this->fields->all() as $name => $field) {
|
||||
if ($field->isDisabled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($field instanceof Field\FileFormField) {
|
||||
$files[$name] = $field->getValue();
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the field values as PHP.
|
||||
*
|
||||
* This method converts fields with the array notation
|
||||
* (like foo[bar] to arrays) like PHP does.
|
||||
*
|
||||
* @return array An array of field values
|
||||
*/
|
||||
public function getPhpValues()
|
||||
{
|
||||
$values = [];
|
||||
foreach ($this->getValues() as $name => $value) {
|
||||
$qs = http_build_query([$name => $value], '', '&');
|
||||
if (!empty($qs)) {
|
||||
parse_str($qs, $expandedValue);
|
||||
$varName = substr($name, 0, \strlen(key($expandedValue)));
|
||||
$values = array_replace_recursive($values, [$varName => current($expandedValue)]);
|
||||
}
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the file field values as PHP.
|
||||
*
|
||||
* This method converts fields with the array notation
|
||||
* (like foo[bar] to arrays) like PHP does.
|
||||
* The returned array is consistent with the array for field values
|
||||
* (@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 An array of file field values
|
||||
*/
|
||||
public function getPhpFiles()
|
||||
{
|
||||
$values = [];
|
||||
foreach ($this->getFiles() as $name => $value) {
|
||||
$qs = http_build_query([$name => $value], '', '&');
|
||||
if (!empty($qs)) {
|
||||
parse_str($qs, $expandedValue);
|
||||
$varName = substr($name, 0, \strlen(key($expandedValue)));
|
||||
|
||||
array_walk_recursive(
|
||||
$expandedValue,
|
||||
function (&$value, $key) {
|
||||
if (ctype_digit($value) && ('size' === $key || 'error' === $key)) {
|
||||
$value = (int) $value;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reset($expandedValue);
|
||||
|
||||
$values = array_replace_recursive($values, [$varName => current($expandedValue)]);
|
||||
}
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URI of the form.
|
||||
*
|
||||
* 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 The URI
|
||||
*/
|
||||
public function getUri()
|
||||
{
|
||||
$uri = parent::getUri();
|
||||
|
||||
if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) {
|
||||
$query = parse_url($uri, \PHP_URL_QUERY);
|
||||
$currentParameters = [];
|
||||
if ($query) {
|
||||
parse_str($query, $currentParameters);
|
||||
}
|
||||
|
||||
$queryString = http_build_query(array_merge($currentParameters, $this->getValues()), '', '&');
|
||||
|
||||
$pos = strpos($uri, '?');
|
||||
$base = false === $pos ? $uri : substr($uri, 0, $pos);
|
||||
$uri = rtrim($base.'?'.$queryString, '?');
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
||||
|
||||
protected function getRawUri()
|
||||
{
|
||||
// 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')) {
|
||||
return $this->button->getAttribute('formaction');
|
||||
}
|
||||
|
||||
return $this->node->getAttribute('action');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the form method.
|
||||
*
|
||||
* If no method is defined in the form, GET is returned.
|
||||
*
|
||||
* @return string The method
|
||||
*/
|
||||
public function getMethod()
|
||||
{
|
||||
if (null !== $this->method) {
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
// If the form was created from a button rather than the form node, check for HTML5 method override
|
||||
if ($this->button !== $this->node && $this->button->getAttribute('formmethod')) {
|
||||
return strtoupper($this->button->getAttribute('formmethod'));
|
||||
}
|
||||
|
||||
return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the form name.
|
||||
*
|
||||
* If no name is defined on the form, an empty string is returned.
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->node->getAttribute('name');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the named field exists.
|
||||
*
|
||||
* @param string $name The field name
|
||||
*
|
||||
* @return bool true if the field exists, false otherwise
|
||||
*/
|
||||
public function has($name)
|
||||
{
|
||||
return $this->fields->has($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a field from the form.
|
||||
*
|
||||
* @param string $name The field name
|
||||
*/
|
||||
public function remove($name)
|
||||
{
|
||||
$this->fields->remove($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a named field.
|
||||
*
|
||||
* @param string $name The field name
|
||||
*
|
||||
* @return FormField|FormField[]|FormField[][] The value of the field
|
||||
*
|
||||
* @throws \InvalidArgumentException When field is not present in this form
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
return $this->fields->get($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a named field.
|
||||
*/
|
||||
public function set(FormField $field)
|
||||
{
|
||||
$this->fields->add($field);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fields.
|
||||
*
|
||||
* @return FormField[]
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
return $this->fields->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the named field exists.
|
||||
*
|
||||
* @param string $name The field name
|
||||
*
|
||||
* @return bool true if the field exists, false otherwise
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetExists($name)
|
||||
{
|
||||
return $this->has($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of a field.
|
||||
*
|
||||
* @param string $name The field name
|
||||
*
|
||||
* @return FormField|FormField[]|FormField[][] The value of the field
|
||||
*
|
||||
* @throws \InvalidArgumentException if the field does not exist
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($name)
|
||||
{
|
||||
return $this->fields->get($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of a field.
|
||||
*
|
||||
* @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)
|
||||
{
|
||||
$this->fields->set($name, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a field from the form.
|
||||
*
|
||||
* @param string $name The field name
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetUnset($name)
|
||||
{
|
||||
$this->fields->remove($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables validation.
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function disableValidation()
|
||||
{
|
||||
foreach ($this->fields->all() as $field) {
|
||||
if ($field instanceof Field\ChoiceFormField) {
|
||||
$field->disableValidation();
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the node for the form.
|
||||
*
|
||||
* Expects a 'submit' button \DOMElement and finds the corresponding form element, or the form element itself.
|
||||
*
|
||||
* @throws \LogicException If given node is not a button or input or does not have a form ancestor
|
||||
*/
|
||||
protected function setNode(\DOMElement $node)
|
||||
{
|
||||
$this->button = $node;
|
||||
if ('button' === $node->nodeName || ('input' === $node->nodeName && \in_array(strtolower($node->getAttribute('type')), ['submit', 'button', 'image']))) {
|
||||
if ($node->hasAttribute('form')) {
|
||||
// if the node has the HTML5-compliant 'form' attribute, use it
|
||||
$formId = $node->getAttribute('form');
|
||||
$form = $node->ownerDocument->getElementById($formId);
|
||||
if (null === $form) {
|
||||
throw new \LogicException(sprintf('The selected node has an invalid form attribute (%s).', $formId));
|
||||
}
|
||||
$this->node = $form;
|
||||
|
||||
return;
|
||||
}
|
||||
// we loop until we find a form ancestor
|
||||
do {
|
||||
if (null === $node = $node->parentNode) {
|
||||
throw new \LogicException('The selected node does not have a form ancestor.');
|
||||
}
|
||||
} while ('form' !== $node->nodeName);
|
||||
} elseif ('form' !== $node->nodeName) {
|
||||
throw new \LogicException(sprintf('Unable to submit on a "%s" tag.', $node->nodeName));
|
||||
}
|
||||
|
||||
$this->node = $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds form elements related to this form.
|
||||
*
|
||||
* Creates an internal copy of the submitted 'button' element and
|
||||
* the form node or the entire document depending on whether we need
|
||||
* to find non-descendant elements through HTML5 'form' attribute.
|
||||
*/
|
||||
private function initialize()
|
||||
{
|
||||
$this->fields = new FormFieldRegistry();
|
||||
|
||||
$xpath = new \DOMXPath($this->node->ownerDocument);
|
||||
|
||||
// add submitted button if it has a valid name
|
||||
if ('form' !== $this->button->nodeName && $this->button->hasAttribute('name') && $this->button->getAttribute('name')) {
|
||||
if ('input' == $this->button->nodeName && 'image' == strtolower($this->button->getAttribute('type'))) {
|
||||
$name = $this->button->getAttribute('name');
|
||||
$this->button->setAttribute('value', '0');
|
||||
|
||||
// temporarily change the name of the input node for the x coordinate
|
||||
$this->button->setAttribute('name', $name.'.x');
|
||||
$this->set(new Field\InputFormField($this->button));
|
||||
|
||||
// temporarily change the name of the input node for the y coordinate
|
||||
$this->button->setAttribute('name', $name.'.y');
|
||||
$this->set(new Field\InputFormField($this->button));
|
||||
|
||||
// restore the original name of the input node
|
||||
$this->button->setAttribute('name', $name);
|
||||
} else {
|
||||
$this->set(new Field\InputFormField($this->button));
|
||||
}
|
||||
}
|
||||
|
||||
// find form elements corresponding to the current form
|
||||
if ($this->node->hasAttribute('id')) {
|
||||
// corresponding elements are either descendants or have a matching HTML5 form attribute
|
||||
$formId = Crawler::xpathLiteral($this->node->getAttribute('id'));
|
||||
|
||||
$fieldNodes = $xpath->query(sprintf('( descendant::input[@form=%s] | descendant::button[@form=%1$s] | descendant::textarea[@form=%1$s] | descendant::select[@form=%1$s] | //form[@id=%1$s]//input[not(@form)] | //form[@id=%1$s]//button[not(@form)] | //form[@id=%1$s]//textarea[not(@form)] | //form[@id=%1$s]//select[not(@form)] )[not(ancestor::template)]', $formId));
|
||||
foreach ($fieldNodes as $node) {
|
||||
$this->addField($node);
|
||||
}
|
||||
} else {
|
||||
// do the xpath query with $this->node as the context node, to only find descendant elements
|
||||
// however, descendant elements with form attribute are not part of this form
|
||||
$fieldNodes = $xpath->query('( descendant::input[not(@form)] | descendant::button[not(@form)] | descendant::textarea[not(@form)] | descendant::select[not(@form)] )[not(ancestor::template)]', $this->node);
|
||||
foreach ($fieldNodes as $node) {
|
||||
$this->addField($node);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->baseHref && '' !== $this->node->getAttribute('action')) {
|
||||
$this->currentUri = $this->baseHref;
|
||||
}
|
||||
}
|
||||
|
||||
private function addField(\DOMElement $node)
|
||||
{
|
||||
if (!$node->hasAttribute('name') || !$node->getAttribute('name')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$nodeName = $node->nodeName;
|
||||
if ('select' == $nodeName || 'input' == $nodeName && 'checkbox' == strtolower($node->getAttribute('type'))) {
|
||||
$this->set(new Field\ChoiceFormField($node));
|
||||
} elseif ('input' == $nodeName && 'radio' == strtolower($node->getAttribute('type'))) {
|
||||
// there may be other fields with the same name that are no choice
|
||||
// fields already registered (see https://github.com/symfony/symfony/issues/11689)
|
||||
if ($this->has($node->getAttribute('name')) && $this->get($node->getAttribute('name')) instanceof ChoiceFormField) {
|
||||
$this->get($node->getAttribute('name'))->addChoice($node);
|
||||
} else {
|
||||
$this->set(new Field\ChoiceFormField($node));
|
||||
}
|
||||
} elseif ('input' == $nodeName && 'file' == strtolower($node->getAttribute('type'))) {
|
||||
$this->set(new Field\FileFormField($node));
|
||||
} elseif ('input' == $nodeName && !\in_array(strtolower($node->getAttribute('type')), ['submit', 'button', 'image'])) {
|
||||
$this->set(new Field\InputFormField($node));
|
||||
} elseif ('textarea' == $nodeName) {
|
||||
$this->set(new Field\TextareaFormField($node));
|
||||
}
|
||||
}
|
||||
}
|
||||
180
old.vendor/symfony/dom-crawler/FormFieldRegistry.php
Normal file
180
old.vendor/symfony/dom-crawler/FormFieldRegistry.php
Normal file
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler;
|
||||
|
||||
use Symfony\Component\DomCrawler\Field\FormField;
|
||||
|
||||
/**
|
||||
* This is an internal class that must not be used directly.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class FormFieldRegistry
|
||||
{
|
||||
private $fields = [];
|
||||
|
||||
private $base = '';
|
||||
|
||||
/**
|
||||
* Adds a field to the registry.
|
||||
*/
|
||||
public function add(FormField $field)
|
||||
{
|
||||
$segments = $this->getSegments($field->getName());
|
||||
|
||||
$target = &$this->fields;
|
||||
while ($segments) {
|
||||
if (!\is_array($target)) {
|
||||
$target = [];
|
||||
}
|
||||
$path = array_shift($segments);
|
||||
if ('' === $path) {
|
||||
$target = &$target[];
|
||||
} else {
|
||||
$target = &$target[$path];
|
||||
}
|
||||
}
|
||||
$target = $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a field based on the fully qualifed name and its children from the registry.
|
||||
*/
|
||||
public function remove(string $name)
|
||||
{
|
||||
$segments = $this->getSegments($name);
|
||||
$target = &$this->fields;
|
||||
while (\count($segments) > 1) {
|
||||
$path = array_shift($segments);
|
||||
if (!\is_array($target) || !\array_key_exists($path, $target)) {
|
||||
return;
|
||||
}
|
||||
$target = &$target[$path];
|
||||
}
|
||||
unset($target[array_shift($segments)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the field based on the fully qualifed name and its children.
|
||||
*
|
||||
* @return FormField|FormField[]|FormField[][] The value of the field
|
||||
*
|
||||
* @throws \InvalidArgumentException if the field does not exist
|
||||
*/
|
||||
public function &get(string $name)
|
||||
{
|
||||
$segments = $this->getSegments($name);
|
||||
$target = &$this->fields;
|
||||
while ($segments) {
|
||||
$path = array_shift($segments);
|
||||
if (!\is_array($target) || !\array_key_exists($path, $target)) {
|
||||
throw new \InvalidArgumentException(sprintf('Unreachable field "%s".', $path));
|
||||
}
|
||||
$target = &$target[$path];
|
||||
}
|
||||
|
||||
return $target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether the form has the given field based on the fully qualified name.
|
||||
*
|
||||
* @return bool Whether the form has the given field
|
||||
*/
|
||||
public function has(string $name): bool
|
||||
{
|
||||
try {
|
||||
$this->get($name);
|
||||
|
||||
return true;
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$target = &$this->get($name);
|
||||
if ((!\is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
|
||||
$target->setValue($value);
|
||||
} elseif (\is_array($value)) {
|
||||
$registry = new static();
|
||||
$registry->base = $name;
|
||||
$registry->fields = $value;
|
||||
foreach ($registry->all() as $k => $v) {
|
||||
$this->set($k, $v);
|
||||
}
|
||||
} else {
|
||||
throw new \InvalidArgumentException(sprintf('Cannot set value on a compound field "%s".', $name));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of field with their value.
|
||||
*
|
||||
* @return FormField[] The list of fields as [string] Fully qualified name => (mixed) value)
|
||||
*/
|
||||
public function all(): array
|
||||
{
|
||||
return $this->walk($this->fields, $this->base);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a PHP array in a list of fully qualified name / value.
|
||||
*/
|
||||
private function walk(array $array, ?string $base = '', array &$output = []): array
|
||||
{
|
||||
foreach ($array as $k => $v) {
|
||||
$path = empty($base) ? $k : sprintf('%s[%s]', $base, $k);
|
||||
if (\is_array($v)) {
|
||||
$this->walk($v, $path, $output);
|
||||
} else {
|
||||
$output[$path] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits a field name into segments as a web browser would do.
|
||||
*
|
||||
* getSegments('base[foo][3][]') = ['base', 'foo, '3', ''];
|
||||
*
|
||||
* @return string[] The list of segments
|
||||
*/
|
||||
private function getSegments(string $name): array
|
||||
{
|
||||
if (preg_match('/^(?P<base>[^[]+)(?P<extra>(\[.*)|$)/', $name, $m)) {
|
||||
$segments = [$m['base']];
|
||||
while (!empty($m['extra'])) {
|
||||
$extra = $m['extra'];
|
||||
if (preg_match('/^\[(?P<segment>.*?)\](?P<extra>.*)$/', $extra, $m)) {
|
||||
$segments[] = $m['segment'];
|
||||
} else {
|
||||
$segments[] = $extra;
|
||||
}
|
||||
}
|
||||
|
||||
return $segments;
|
||||
}
|
||||
|
||||
return [$name];
|
||||
}
|
||||
}
|
||||
37
old.vendor/symfony/dom-crawler/Image.php
Normal file
37
old.vendor/symfony/dom-crawler/Image.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler;
|
||||
|
||||
/**
|
||||
* Image represents an HTML image (an HTML img tag).
|
||||
*/
|
||||
class Image extends AbstractUriElement
|
||||
{
|
||||
public function __construct(\DOMElement $node, string $currentUri = null)
|
||||
{
|
||||
parent::__construct($node, $currentUri, 'GET');
|
||||
}
|
||||
|
||||
protected function getRawUri()
|
||||
{
|
||||
return $this->node->getAttribute('src');
|
||||
}
|
||||
|
||||
protected function setNode(\DOMElement $node)
|
||||
{
|
||||
if ('img' !== $node->nodeName) {
|
||||
throw new \LogicException(sprintf('Unable to visualize a "%s" tag.', $node->nodeName));
|
||||
}
|
||||
|
||||
$this->node = $node;
|
||||
}
|
||||
}
|
||||
19
old.vendor/symfony/dom-crawler/LICENSE
Normal file
19
old.vendor/symfony/dom-crawler/LICENSE
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2004-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.
|
||||
34
old.vendor/symfony/dom-crawler/Link.php
Normal file
34
old.vendor/symfony/dom-crawler/Link.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler;
|
||||
|
||||
/**
|
||||
* Link represents an HTML link (an HTML a, area or link tag).
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class Link extends AbstractUriElement
|
||||
{
|
||||
protected function getRawUri()
|
||||
{
|
||||
return $this->node->getAttribute('href');
|
||||
}
|
||||
|
||||
protected function setNode(\DOMElement $node)
|
||||
{
|
||||
if ('a' !== $node->nodeName && 'area' !== $node->nodeName && 'link' !== $node->nodeName) {
|
||||
throw new \LogicException(sprintf('Unable to navigate from a "%s" tag.', $node->nodeName));
|
||||
}
|
||||
|
||||
$this->node = $node;
|
||||
}
|
||||
}
|
||||
13
old.vendor/symfony/dom-crawler/README.md
Normal file
13
old.vendor/symfony/dom-crawler/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
DomCrawler Component
|
||||
====================
|
||||
|
||||
The DomCrawler component eases DOM navigation for HTML and XML documents.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
* [Documentation](https://symfony.com/doc/current/components/dom_crawler.html)
|
||||
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
|
||||
* [Report issues](https://github.com/symfony/symfony/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/symfony/pulls)
|
||||
in the [main Symfony repository](https://github.com/symfony/symfony)
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Test\Constraint;
|
||||
|
||||
use PHPUnit\Framework\Constraint\Constraint;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
|
||||
final class CrawlerSelectorAttributeValueSame extends Constraint
|
||||
{
|
||||
private $selector;
|
||||
private $attribute;
|
||||
private $expectedText;
|
||||
|
||||
public function __construct(string $selector, string $attribute, string $expectedText)
|
||||
{
|
||||
$this->selector = $selector;
|
||||
$this->attribute = $attribute;
|
||||
$this->expectedText = $expectedText;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return sprintf('has a node matching selector "%s" with attribute "%s" of value "%s"', $this->selector, $this->attribute, $this->expectedText);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Crawler $crawler
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($crawler): bool
|
||||
{
|
||||
$crawler = $crawler->filter($this->selector);
|
||||
if (!\count($crawler)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->expectedText === trim($crawler->attr($this->attribute) ?? '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Crawler $crawler
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($crawler): string
|
||||
{
|
||||
return 'the Crawler '.$this->toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Test\Constraint;
|
||||
|
||||
use PHPUnit\Framework\Constraint\Constraint;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
|
||||
final class CrawlerSelectorExists extends Constraint
|
||||
{
|
||||
private $selector;
|
||||
|
||||
public function __construct(string $selector)
|
||||
{
|
||||
$this->selector = $selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return sprintf('matches selector "%s"', $this->selector);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Crawler $crawler
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($crawler): bool
|
||||
{
|
||||
return 0 < \count($crawler->filter($this->selector));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Crawler $crawler
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($crawler): string
|
||||
{
|
||||
return 'the Crawler '.$this->toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Test\Constraint;
|
||||
|
||||
use PHPUnit\Framework\Constraint\Constraint;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
|
||||
final class CrawlerSelectorTextContains extends Constraint
|
||||
{
|
||||
private $selector;
|
||||
private $expectedText;
|
||||
private $hasNode = false;
|
||||
private $nodeText;
|
||||
|
||||
public function __construct(string $selector, string $expectedText)
|
||||
{
|
||||
$this->selector = $selector;
|
||||
$this->expectedText = $expectedText;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
if ($this->hasNode) {
|
||||
return sprintf('the text "%s" of the node matching selector "%s" contains "%s"', $this->nodeText, $this->selector, $this->expectedText);
|
||||
}
|
||||
|
||||
return sprintf('the Crawler has a node matching selector "%s"', $this->selector);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Crawler $crawler
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($crawler): bool
|
||||
{
|
||||
$crawler = $crawler->filter($this->selector);
|
||||
if (!\count($crawler)) {
|
||||
$this->hasNode = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->hasNode = true;
|
||||
$this->nodeText = $crawler->text(null, true);
|
||||
|
||||
return false !== mb_strpos($this->nodeText, $this->expectedText);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Crawler $crawler
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($crawler): string
|
||||
{
|
||||
return $this->toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DomCrawler\Test\Constraint;
|
||||
|
||||
use PHPUnit\Framework\Constraint\Constraint;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
|
||||
final class CrawlerSelectorTextSame extends Constraint
|
||||
{
|
||||
private $selector;
|
||||
private $expectedText;
|
||||
|
||||
public function __construct(string $selector, string $expectedText)
|
||||
{
|
||||
$this->selector = $selector;
|
||||
$this->expectedText = $expectedText;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return sprintf('has a node matching selector "%s" with content "%s"', $this->selector, $this->expectedText);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Crawler $crawler
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($crawler): bool
|
||||
{
|
||||
$crawler = $crawler->filter($this->selector);
|
||||
if (!\count($crawler)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->expectedText === trim($crawler->text(null, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Crawler $crawler
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($crawler): string
|
||||
{
|
||||
return 'the Crawler '.$this->toString();
|
||||
}
|
||||
}
|
||||
41
old.vendor/symfony/dom-crawler/composer.json
Normal file
41
old.vendor/symfony/dom-crawler/composer.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
"type": "library",
|
||||
"description": "Eases DOM navigation for HTML and XML documents",
|
||||
"keywords": [],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.1.3",
|
||||
"symfony/polyfill-ctype": "~1.8",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/css-selector": "^3.4|^4.0|^5.0",
|
||||
"masterminds/html5": "^2.6"
|
||||
},
|
||||
"conflict": {
|
||||
"masterminds/html5": "<2.6"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/css-selector": ""
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Component\\DomCrawler\\": "" },
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
Reference in New Issue
Block a user