puphpeteer icon indicating copy to clipboard operation
puphpeteer copied to clipboard

Array shapes shouldn't require all the keys to be present in PHP documentation

Open nesk opened this issue 4 years ago • 0 comments

For example, the Nesk\Puphpeteer\Resources\Page::addScriptTag() method takes an array shape:

https://github.com/rialto-php/puphpeteer/blob/a3c30bce7eb95d0c63373426cad06111d3b6bca6/src/Resources/Page.php#L33

Here, as written, all the keys are required. But if we look Puppeteer's documentation, none of the keys are required.

The documentation should be written as:

/**
 * @method \Nesk\Puphpeteer\Resources\ElementHandle addScriptTag(array{ url?: string, path?: string, content?: string, type?: string } $options)
 */

nesk avatar Feb 17 '21 19:02 nesk