Skip to content

Commit 4bbbd25

Browse files
authored
[TASK] Add sunset note and migration advise to README.md (#25)
1 parent 5131622 commit 4bbbd25

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
# TYPO3 extension for PHPStan
22

3-
TYPO3 CMS class reflection extension for PHPStan & framework-specific rules
3+
> [!NOTE]
4+
> `friendsoftypo3/phpstan-typo3` is obsolete and has been retired.
5+
> The package dependency should be removed from TYPO3 project or extension development: `composer rem --dev friendsoftypo3/phpstan-typo3`.
6+
> See below for transition options.
7+
8+
## Migrating away from friendsoftypo3/phpstan-typo3 since TYPO3 core v12
9+
10+
### Switch to saschaegerer/phpstan-typo3
11+
12+
[Sascha's package saschaegerer/phpstan-typo3](https://packagist.org/packages/saschaegerer/phpstan-typo3) can be an
13+
alternative.
14+
15+
### Remove package and rely on core annotations
16+
17+
* The list of global TYPO3 specific constants shrunk over time and phpstan finds more of the remaining ones by default.
18+
phpstan may mumble about constants `LF` and `CR` not being defined. They can be made known to phpstan like this in
19+
a `phpstan.neon` config file:
20+
```
21+
parameters:
22+
bootstrapFiles:
23+
- phpstan.bootstrap.php
24+
```
25+
File `phpstan.bootstrap.php` then contains:
26+
```
27+
<?php
28+
define('LF', chr(10));
29+
define('CR', chr(13));
30+
```
31+
* `GeneralUtility::makeInstance()`, `Context->getAspect()`, `Query->execute()` and `QueryInterface->execute()`
32+
have proper method annotations since TYPO3 v12, the phpstan extension classes are not needed anymore and
33+
phpstan "understands" return values of these methods out of the box.
34+
* `ObjectManagerInterface->get()` and `ObjectManager->get()` extensions have been removed from TYPO3 since v12
35+
and are thus obsolete.
36+
37+
## TYPO3 CMS class reflection extension for PHPStan &amp; framework-specific rules
438

539
This extension provides the following features:
640

0 commit comments

Comments
 (0)