Skip to content

Commit f504054

Browse files
committed
Add WP_FS constants and fix class-string
1 parent b931433 commit f504054

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

bootstrap.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@
3030
define('OBJECT_K', 'OBJECT_K');
3131
define('ARRAY_A', 'ARRAY_A');
3232
define('ARRAY_N', 'ARRAY_N');
33+
34+
// Constants from WP_Filesystem.
35+
define('FS_CONNECT_TIMEOUT', 30);
36+
define('FS_TIMEOUT', 30);
37+
define('FS_CHMOD_DIR', 0755);
38+
define('FS_CHMOD_FILE', 0644);

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ includes:
33
- vendor/phpstan/phpstan-strict-rules/rules.neon
44
parameters:
55
level: max
6+
# WpThemeMagicPropertiesClassReflectionExtension needs WP_Theme
7+
scanFiles:
8+
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
69
paths:
710
- bootstrap.php
811
- src/

src/Composer/FixWpStubs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function php73Polyfill(Event $event): int
2525
$io->write('Removing duplicate is_countable() ...');
2626

2727
$vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
28-
$stubsFile = $vendorDir . self::STUBSFILE;
28+
$stubsFile = sprintf('%s%s', $vendorDir, self::STUBSFILE);
2929

3030
// phpcs:ignore WordPress.WP.AlternativeFunctions
3131
$stubs = file_get_contents($stubsFile);

0 commit comments

Comments
 (0)