Skip to content

Commit 01f575d

Browse files
committed
More PHP features added
1 parent 2c8bc8d commit 01f575d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

guide/en/intro/upgrade-from-v2.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ and consider starting new projects on Yii 3 while keeping existing ones on Yii 2
99

1010
## PHP requirements
1111

12-
Yii3 requires PHP 8.1 or above. As a result, there are language features used that weren't used in Yii 2:
12+
Yii3 requires PHP 8.2 or above. As a result, there are language features used that weren't used in Yii 2:
1313

1414
- [Type declarations](https://www.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration)
1515
- [Return type declarations](https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration)
1616
- [Class constant visibility](https://www.php.net/manual/en/language.oop5.constants.php)
17+
- [Named arguments](https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments)
1718
- [Anonymous classes](https://www.php.net/manual/en/language.oop5.anonymous.php)
1819
- [::class](https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class)
1920
- [Generators](https://www.php.net/manual/en/language.generators.php)
2021
- [Variadic functions](https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list)
21-
- readonly
22-
- constructor property propagation
22+
- [Readonly properties](https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.readonly-properties)
23+
- [Readonly classes](https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.readonly)
24+
- [Constructor property promotion](https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion)
25+
- [Attributes](https://www.php.net/manual/en/language.attributes.php)
2326

2427
## Preliminary refactoring
2528

@@ -42,7 +45,7 @@ Since Active Record isn't the only way to work with a database in Yii 3, conside
4245
hide details of getting data and gather them in a single place. You can later redo it:
4346

4447
```php
45-
final readonly class PostRepository
48+
final readonly class PostRepository
4649
{
4750
public function getArchive()
4851
{

0 commit comments

Comments
 (0)