Skip to content

Commit 92145b7

Browse files
committed
Basic configuration for PHPStan
1 parent e24d55a commit 92145b7

File tree

6 files changed

+102
-0
lines changed

6 files changed

+102
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ nbactions.xml
6060

6161
# Node.js
6262
node_modules/
63+
64+
/vendor/

composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "woltlab/wcf",
3+
"type": "project",
4+
"require-dev": {
5+
"phpstan/phpstan": "^2.1"
6+
},
7+
"require": {}
8+
}

composer.lock

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

constants.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
\define('RELATIVE_WCF_DIR', '');
1616
\define('TMP_DIR', '');
1717
\define('WCF_N', 1);
18+
\define('TIME_NOW', 0);
1819
\define('WCF_OPTION_INC_PHP_SUCCESS', true);
1920

2021
// option constants

phpstan.neon

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
parameters:
2+
level: 1
3+
paths:
4+
- wcfsetup/install/files
5+
excludePaths:
6+
analyse:
7+
- wcfsetup/install/files/lib/system/api/
8+
scanFiles:
9+
- constants.php
10+
ignoreErrors:
11+
- identifier: new.static

wcfsetup/install/files/lib/system/WCF.class.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use wcf\data\page\Page;
1111
use wcf\system\application\ApplicationHandler;
1212
use wcf\system\application\IApplication;
13+
use wcf\system\benchmark\Benchmark;
1314
use wcf\system\box\BoxHandler;
1415
use wcf\system\cache\builder\CoreObjectCacheBuilder;
1516
use wcf\system\cache\builder\PackageUpdateCacheBuilder;
@@ -98,6 +99,8 @@
9899
* @author Marcel Werk
99100
* @copyright 2001-2019 WoltLab GmbH
100101
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
102+
*
103+
* @method static Benchmark getBenchmark()
101104
*/
102105
class WCF
103106
{

0 commit comments

Comments
 (0)