Skip to content

Commit 381b33f

Browse files
authored
Merge branch '1.13' into patch-11
2 parents 3c6ca8b + b10c8c1 commit 381b33f

35 files changed

+422
-87
lines changed

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
timeout_minutes: 5
3434
max_attempts: 5
35-
command: composer bin phpstan update --no-interaction --no-progress
35+
command: composer bin phpstan install --no-interaction --no-progress
3636

3737
- name: Execute PHPStan
3838
run: vendor/bin/phpstan analyze --no-progress

.github/workflows/tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
14+
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
1515
symfony: ['4', '5', '6', '7']
1616
exclude:
1717
- php: '7.4'
@@ -22,11 +22,17 @@ jobs:
2222
symfony: '7'
2323
- php: '8.1'
2424
symfony: '7'
25+
- php: '8.4'
26+
symfony: '4'
2527

2628
steps:
2729
- name: Checkout Code
2830
uses: actions/checkout@v4
2931

32+
- uses: browser-actions/setup-chrome@v1
33+
with:
34+
chrome-version: 122
35+
3036
- name: Setup PHP
3137
uses: shivammathur/setup-php@v2
3238
with:
@@ -81,4 +87,4 @@ jobs:
8187
- name: Execute PHPUnit
8288
run: vendor/bin/phpunit
8389
env:
84-
CHROME_PATH: google-chrome-stable
90+
CHROME_PATH: /opt/hostedtoolcache/setup-chrome/chromium/122.0.6261.128/x64/chrome

.gitignore

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

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
# CHANGELOG
22

33

4+
## 1.13.0 (2025-02-07)
5+
6+
* Set maximal expires value if `session=false` in `Page::setCookies`
7+
8+
9+
## 1.12.1 (2025-02-07)
10+
11+
* Fix nullable parameter definition in `AbstractBinaryInput::getRawBinary`
12+
13+
14+
## 1.12.0 (2024-12-09)
15+
16+
* Add PHP 8.4 support
17+
* Add the ability to screenshot individual elements on the page
18+
* Add `AbstractBinaryInput::getRawBinary` method
19+
* Have `Cookie` implement `IteratorAggregate`
20+
21+
422
## 1.11.0 (2024-03-17)
523

624
* Add PHP 8.3 support

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Happy browsing!
2424

2525
## Requirements
2626

27-
Requires PHP 7.4-8.3 and a Chrome/Chromium 65+ executable.
27+
Requires PHP 7.4-8.4 and a Chrome/Chromium 65+ executable.
2828

2929
Note that the library is only tested on Linux but is compatible with macOS and Windows.
3030

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^7.4.15 || ^8.0.2",
20-
"chrome-php/wrench": "^1.6",
20+
"chrome-php/wrench": "^1.7",
2121
"evenement/evenement": "^3.0.1",
2222
"monolog/monolog": "^1.27.1 || ^2.8 || ^3.2",
2323
"psr/log": "^1.1 || ^2.0 || ^3.0",

src/Browser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getConnection(): Connection
9898
*
9999
* @param string|null $script
100100
*/
101-
public function setPagePreScript(string $script = null): void
101+
public function setPagePreScript(?string $script = null): void
102102
{
103103
$this->pagePreScript = $script;
104104
}

src/Browser/BrowserProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class BrowserProcess implements LoggerAwareInterface
7878
*
7979
* @param LoggerInterface|null $logger
8080
*/
81-
public function __construct(LoggerInterface $logger = null)
81+
public function __construct(?LoggerInterface $logger = null)
8282
{
8383
// set or create logger
8484
$this->setLogger($logger ?? new NullLogger());

src/BrowserFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class BrowserFactory
5050
*/
5151
protected $options = [];
5252

53-
public function __construct(string $chromeBinary = null)
53+
public function __construct(?string $chromeBinary = null)
5454
{
5555
$this->chromeBinary = $chromeBinary ?? (new AutoDiscover())->guessChromeBinaryPath();
5656
}

src/Clip.php

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@
1313

1414
class Clip
1515
{
16+
/** @var int|float */
1617
protected $x;
18+
/** @var int|float */
1719
protected $y;
20+
/** @var int|float */
1821
protected $height;
22+
/** @var int|float */
1923
protected $width;
24+
/** @var float */
2025
protected $scale;
2126

2227
/**
23-
* Clip constructor.
24-
*
25-
* @param int $x
26-
* @param int $y
27-
* @param int $height
28-
* @param int $width
29-
* @param float $scale
28+
* @param int|float $x
29+
* @param int|float $y
30+
* @param int|float $height
31+
* @param int|float $width
32+
* @param float $scale
3033
*/
3134
public function __construct($x, $y, $width, $height, $scale = 1.0)
3235
{
@@ -38,79 +41,79 @@ public function __construct($x, $y, $width, $height, $scale = 1.0)
3841
}
3942

4043
/**
41-
* @return mixed
44+
* @return int|float
4245
*/
4346
public function getX()
4447
{
4548
return $this->x;
4649
}
4750

4851
/**
49-
* @return mixed
52+
* @return int|float
5053
*/
5154
public function getY()
5255
{
5356
return $this->y;
5457
}
5558

5659
/**
57-
* @return mixed
60+
* @return int|float
5861
*/
5962
public function getHeight()
6063
{
6164
return $this->height;
6265
}
6366

6467
/**
65-
* @return mixed
68+
* @return int|float
6669
*/
6770
public function getWidth()
6871
{
6972
return $this->width;
7073
}
7174

7275
/**
73-
* @return mixed
76+
* @return float
7477
*/
7578
public function getScale()
7679
{
7780
return $this->scale;
7881
}
7982

8083
/**
81-
* @param mixed $x
84+
* @param int|float $x
8285
*/
8386
public function setX($x): void
8487
{
8588
$this->x = $x;
8689
}
8790

8891
/**
89-
* @param mixed $y
92+
* @param int|float $y
9093
*/
9194
public function setY($y): void
9295
{
9396
$this->y = $y;
9497
}
9598

9699
/**
97-
* @param mixed $height
100+
* @param int $height
98101
*/
99102
public function setHeight($height): void
100103
{
101104
$this->height = $height;
102105
}
103106

104107
/**
105-
* @param mixed $width
108+
* @param int $width
106109
*/
107110
public function setWidth($width): void
108111
{
109112
$this->width = $width;
110113
}
111114

112115
/**
113-
* @param mixed $scale
116+
* @param float $scale
114117
*/
115118
public function setScale($scale): void
116119
{

0 commit comments

Comments
 (0)