Skip to content

Conversation

@cryptiklemur
Copy link
Contributor

No description provided.

{
$this->process = new Process([$chromeDriverBinary ?? $this->findChromeDriverBinary()], null, null, null, null);
$this->arguments = $arguments ?? $this->getDefaultArguments();
$this->options = $options ?? $this->getDefaultOptions();
Copy link
Member

Choose a reason for hiding this comment

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

Can you use array_merge to merge data by the user provided and default values (in case it's not provided). The default value can then be [].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup! was just copying args

'https' => false,
'host' => '127.0.0.1',
'port' => 9515,
'status' => '/status'
Copy link
Member

Choose a reason for hiding this comment

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

'path' (again to be compatible with parse_url)?

private function getDefaultOptions(): array
{
return [
'https' => false,
Copy link
Member

Choose a reason for hiding this comment

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

'scheme' => 'https' to respect the format of parse_url and to allow using potential exotic schemes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Way better than what I had... :D

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

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

Can you also add a mention of this new set of options in the README?

private $options;

public function __construct(?string $chromeDriverBinary = null, ?array $arguments = null)
public function __construct(?string $chromeDriverBinary = null, ?array $arguments = null, ?array $options = [])
Copy link
Member

Choose a reason for hiding this comment

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

? should now be removed.

@cryptiklemur
Copy link
Contributor Author

Not sure where this belongs in the readme. You have no examples of how to use the ChromeManager by itself.

@cryptiklemur
Copy link
Contributor Author

Please let me know where you'd like me to put this @dunglas

@dunglas dunglas merged commit 545e8b3 into symfony:master May 18, 2018
@dunglas
Copy link
Member

dunglas commented May 18, 2018

Thanks! Regarding the documentation, what do you think of adding a new « Chrome » section in the README?

dunglas pushed a commit that referenced this pull request Dec 28, 2020
* Allowing customization of host and port for ChromeManager

* Update ChromeManager.php

* Update ChromeManager.php

* Update ChromeManager.php

* Style fixes

* Removing ?
nicolas-grekas pushed a commit that referenced this pull request Jan 18, 2021
* Allowing customization of host and port for ChromeManager

* Update ChromeManager.php

* Update ChromeManager.php

* Update ChromeManager.php

* Style fixes

* Removing ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants