Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

->form() throw exception #31644

Copy link
Copy link
Closed
Closed
Copy link
@planetchili

Description

@planetchili
Issue body actions

Symfony version(s) affected: "symfony/dom-crawler": "4.2"

Description
Getting exception thrown when calling form():
TypeError : Argument 2 passed to Symfony\Component\DomCrawler\Form::__construct() must be of the type string, null given

How to reproduce
$form = $crawler->filter('button.btn-class')->form();

Possible Solution
Making 2nd ctor param of Symfony\Component\DomCrawler\Form nullable fixes the problem:
public function __construct(\DOMElement $node, ?string $currentUri, string $method = null, string $baseHref = null)

Additional context
PHP 7.2.11 / Laravel 5.6.27 / PHPUnit 7.2.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.