Skip to content

Commit ef1c74b

Browse files
authored
[5.x] use promoted properties for Jobs directory (#1597)
* use promoted properties for `Jobs` directory these are very simple classes, so simplifying with promoted properties - move property comment from property to constructor * minor formatting
1 parent d3f1fc8 commit ef1c74b

File tree

3 files changed

+12
-33
lines changed

3 files changed

+12
-33
lines changed

src/Jobs/MonitorTag.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,15 @@
66

77
class MonitorTag
88
{
9-
/**
10-
* The tag to monitor.
11-
*
12-
* @var string
13-
*/
14-
public $tag;
15-
169
/**
1710
* Create a new job instance.
1811
*
19-
* @param string $tag
12+
* @param string $tag The tag to monitor.
2013
* @return void
2114
*/
22-
public function __construct($tag)
23-
{
24-
$this->tag = $tag;
15+
public function __construct(
16+
public $tag,
17+
) {
2518
}
2619

2720
/**

src/Jobs/RetryFailedJob.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,15 @@
99

1010
class RetryFailedJob
1111
{
12-
/**
13-
* The job ID.
14-
*
15-
* @var string
16-
*/
17-
public $id;
18-
1912
/**
2013
* Create a new job instance.
2114
*
22-
* @param string $id
15+
* @param string $id The job ID.
2316
* @return void
2417
*/
25-
public function __construct($id)
26-
{
27-
$this->id = $id;
18+
public function __construct(
19+
public $id,
20+
) {
2821
}
2922

3023
/**

src/Jobs/StopMonitoringTag.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,15 @@
77

88
class StopMonitoringTag
99
{
10-
/**
11-
* The tag to stop monitoring.
12-
*
13-
* @var string
14-
*/
15-
public $tag;
16-
1710
/**
1811
* Create a new job instance.
1912
*
20-
* @param string $tag
13+
* @param string $tag The tag to stop monitoring.
2114
* @return void
2215
*/
23-
public function __construct($tag)
24-
{
25-
$this->tag = $tag;
16+
public function __construct(
17+
public $tag,
18+
) {
2619
}
2720

2821
/**

0 commit comments

Comments
 (0)