Skip to content

Commit 491fcb3

Browse files
committed
test.php: add PHP 8.3 syntax
1 parent f6a5482 commit 491fcb3

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

tests/workflows/test.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,22 @@
55
*/
66
class Mock
77
{
8-
/**
9-
* @var string
10-
*/
11-
protected string $message;
8+
public const string ERROR_MSG = 'oh no!';
129

13-
/**
14-
* @param string $message
15-
*/
16-
public function __construct(string $message)
10+
public function __construct(protected string $message)
1711
{
18-
$this->message = $message;
1912
}
2013

21-
/**
22-
* @return string
23-
*/
2414
public function getMessage(): string
2515
{
2616
return $this->message;
2717
}
18+
19+
/**
20+
* This should be called on error.
21+
*/
22+
protected function error(): never
23+
{
24+
throw new Exception(self::ERROR_MSG);
25+
}
2826
}

0 commit comments

Comments
 (0)