Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4c484a9

Browse files
committed
added support for asymmetric visibility for static property
(has always existed)
1 parent a3901b8 commit 4c484a9

File tree

6 files changed

+45
-1
lines changed

6 files changed

+45
-1
lines changed

‎composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nette/php-generator",
3-
"description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.4 features.",
3+
"description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.",
44
"keywords": ["nette", "php", "code", "scaffolding"],
55
"homepage": "https://nette.org",
66
"license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"],
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
/**
4+
* @phpVersion 8.5
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
use Nette\PhpGenerator\ClassType;
10+
use Nette\PhpGenerator\InterfaceType;
11+
12+
require __DIR__ . '/../bootstrap.php';
13+
require __DIR__ . '/fixtures/classes.85.php';
14+
15+
$res[] = ClassType::from(Abc\Class85::class);
16+
17+
sameFile(__DIR__ . '/expected/ClassType.from.85.expect', implode("\n", $res));

‎tests/PhpGenerator/Extractor.extractAll.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ sameFile(__DIR__ . '/expected/Extractor.classes.82.expect', (string) $file);
2020
if (class_exists(PhpParser\Node\PropertyHook::class)) {
2121
$file = (new Extractor(file_get_contents(__DIR__ . '/fixtures/classes.84.php')))->extractAll();
2222
sameFile(__DIR__ . '/expected/Extractor.classes.84.expect', (string) $file);
23+
24+
$file = (new Extractor(file_get_contents(__DIR__ . '/fixtures/classes.85.php')))->extractAll();
25+
sameFile(__DIR__ . '/expected/Extractor.classes.85.expect', (string) $file);
2326
}
2427

2528
$file = (new Extractor(file_get_contents(__DIR__ . '/fixtures/enum.php')))->extractAll();
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Class85
2+
{
3+
private(set) static string $foo;
4+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Abc;
6+
7+
class Class85
8+
{
9+
private(set) static string $foo;
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Abc;
6+
7+
class Class85
8+
{
9+
private(set) static string $foo;
10+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /