Skip to content

Commit 0eda87b

Browse files
committed
Autoloading footnote
1 parent a3d25de commit 0eda87b

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

website/src/user-guide/autoloading.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ title: Autoloading
44

55
PHPStan needs a working autoloader to access reflection of the analysed classes. It uses Composer autoloader in the project by looking at `vendor/autoload.php` from the current working directory. Use the `autoload`/`autoload-dev` sections in `composer.json` to configure the autoloader.
66

7-
If PHPStan complains about some non-existent classes and you're sure the classes exist in the codebase and you don't want to use Composer autoloader, you can specify directories to scan and concrete files to include using `autoload_directories` and `autoload_files` parameters in the [configuration file](/config-reference).
7+
If PHPStan complains about some non-existent classes [^class-not-found] and you're sure the classes exist in the codebase and you don't want to use Composer autoloader, you can specify directories to scan and concrete files to include using `autoload_directories` and `autoload_files` parameters in the [configuration file](/config-reference).
8+
9+
[^class-not-found]: This manifests are "Class not found" message in the PHPStan's output, even when analysing the file the class is in.
810

911
`autoload_directories` is for discovering classes, interfaces, and traits, `autoload_files` is used for loading function definitions.
1012

website/src/user-guide/command-line-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Outputs a summary of available CLI options, but not as in much detail as this pa
8383
Clearing the result cache
8484
--------------
8585

86-
To clear the current state of the result cache, for example if you're developing [custom extensions](/developing-extensions/extension-types) and the result cache is getting stale too often.
86+
To clear the current state of the [result cache](/user-guide/result-cache), for example if you're developing [custom extensions](/developing-extensions/extension-types) and the result cache is getting stale too often.
8787

8888
```bash
8989
vendor/bin/phpstan clear-result-cache [options]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Result Cache
3+
---
4+
5+
PHPStan caches the result of the analysis so the subsequent runs are much faster. You should always analyse the whole project - the list of paths passed to the [`analyse` command](/user-guide/command-line-usage) should be the same to take advantage of the result cache. If the list of paths differs from run to run, the cache is rebuilt from the ground up each time.
6+
7+
The result cache is saved at `%tmpDir%/result-cache.php`. [Learn more about `tmpDir` configuration »](/config-reference#caching)
8+
9+
Result cache contents
10+
--------------
11+
12+
* The last time a full analysis of the project was performed. The full analysis is performed at least every 24 hours.
13+
* Analysis variables used to invalidate a stale cache. If any of these values change, full analysis is performed again.
14+
* PHPStan version
15+
* PHP version
16+
* Loaded PHP extensions
17+
* [Rule level](/user-guide/rule-levels)
18+
* [Configuration files](/config-reference) hashes
19+
* Analysed paths
20+
* `composer.lock` files hashes
21+
* [Stub files](/user-guide/stub-files) hashes
22+
* Errors in the last run
23+
* Dependency tree of project files. If file `A.php` was modified since the last run, `A.php` and all the files calling or otherwise referencing all the symbols in `A.php` are analysed again.
24+
25+
Clearing the result cache
26+
---------------
27+
28+
To clear the current state of the result cache, for example if you're developing [custom extensions](/developing-extensions/extension-types) and the result cache is getting stale too often, you can run the `clear-result-cache` command. [Learn more »](/user-guide/command-line-usage#clearing-the-result-cache)

website/src/user-guide/user-guide.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
"title": "Stub Files",
4444
"link": "/user-guide/stub-files"
4545
},
46+
{
47+
"title": "Result Cache",
48+
"link": "/user-guide/result-cache"
49+
},
4650
{
4751
"title": "Extension Library",
4852
"link": "/user-guide/extension-library"

0 commit comments

Comments
 (0)