Skip to content

Commit 1664463

Browse files
committed
dotfiles
0 parents  commit 1664463

File tree

7 files changed

+118
-0
lines changed

7 files changed

+118
-0
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.git* export-ignore
2+
/docs/ export-ignore
3+
/tests/ export-ignore
4+
/.php-cs-fixer* export-ignore
5+
/phpstan* export-ignore
6+
/phpunit* export-ignore

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.phpunit.cache/
2+
/vendor/
3+
/.php-cs-fixer.cache
4+
/composer.lock
5+
/phpstan.neon
6+
/phpunit.xml

.php-cs-fixer.dist.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
$licence = <<<'EOF'
4+
This file is part of the playwright-php/playwright package.
5+
For the full copyright and license information, please view
6+
the LICENSE file that was distributed with this source code.
7+
EOF;
8+
9+
$finder = (new PhpCsFixer\Finder())
10+
->in(__DIR__);
11+
12+
return (new PhpCsFixer\Config())
13+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
14+
->setFinder($finder)
15+
->setRiskyAllowed(true)
16+
->setRules([
17+
'@PSR12' => true,
18+
'@Symfony' => true,
19+
'no_unused_imports' => true,
20+
'array_syntax' => ['syntax' => 'short'],
21+
'declare_strict_types' => true,
22+
'header_comment' => ['header' => $licence],
23+
]);

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CHANGELOG
2+
3+
## [Unreleased]

LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
MIT License
2+
3+
Copyright (c) 2025-present Simon André & Playwright PHP
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
---
24+
25+
Third-Party Notice
26+
27+
This project depends on Playwright, an open-source project by Microsoft,
28+
licensed under Apache License 2.0 (https://github.com/microsoft/playwright/blob/main/LICENSE).
29+
"Playwright" is a trademark of Microsoft. This project is independent and not
30+
affiliated with or endorsed by Microsoft.

phpstan.dist.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
level: 10
3+
paths:
4+
- src/
5+
- tests/
6+
treatPhpDocTypesAsCertain: false

tests/Config.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the playwright-php/playwright package.
7+
* For the full copyright and license information, please view
8+
* the LICENSE file that was distributed with this source code.
9+
*/
10+
11+
namespace PlaywrightPHP\Mink\Tests;
12+
13+
use Behat\Mink\Driver\DriverInterface;
14+
use Behat\Mink\Tests\Driver\AbstractConfig;
15+
use PlaywrightPHP\Mink\Driver\PlaywrightDriver;
16+
17+
final class Config extends AbstractConfig
18+
{
19+
public static function getInstance(): self
20+
{
21+
return new self();
22+
}
23+
24+
/**
25+
* @param array{
26+
* browser?: string,
27+
* headless?: bool,
28+
* launch?: array<string, mixed>,
29+
* context?: array<string, mixed>,
30+
* } $params
31+
*/
32+
public function createDriver(array $params = []): DriverInterface
33+
{
34+
$browser = $params['browser'] ?? getenv('PLAYWRIGHT_BROWSER') ?: 'chromium';
35+
$headless = (bool) ($params['headless'] ?? getenv('PLAYWRIGHT_HEADLESS') ?: true);
36+
37+
return new PlaywrightDriver(
38+
browserType: $browser,
39+
headless: $headless,
40+
launchOptions: $params['launch'] ?? [],
41+
contextOptions: $params['context'] ?? [],
42+
);
43+
}
44+
}

0 commit comments

Comments
 (0)