| 1 |
<?php |
| 2 |
/** |
| 3 |
* PHPStan bootstrap file |
| 4 |
* |
| 5 |
* This file defines constants that are normally defined in the main plugin file |
| 6 |
* to allow PHPStan to analyze the code without errors. |
| 7 |
*/ |
| 8 |
|
| 9 |
// Define plugin constants for PHPStan |
| 10 |
if (!defined('AATXT_FILE_ABSPATH')) { |
| 11 |
define('AATXT_FILE_ABSPATH', __DIR__ . '/auto-alt-text.php'); |
| 12 |
} |
| 13 |
|
| 14 |
if (!defined('AATXT_ABSPATH')) { |
| 15 |
define('AATXT_ABSPATH', __DIR__); |
| 16 |
} |
| 17 |
|
| 18 |
if (!defined('AATXT_URL')) { |
| 19 |
define('AATXT_URL', 'https://example.com/wp-content/plugins/auto-alt-text/'); |
| 20 |
} |
| 21 |
|
| 22 |
if (!defined('AATXT_LANGUAGES_RELATIVE_PATH')) { |
| 23 |
define('AATXT_LANGUAGES_RELATIVE_PATH', 'auto-alt-text/languages/'); |
| 24 |
} |
| 25 |
|
| 26 |
// Stub for the WP-CLI base class, not included in the WordPress stubs, |
| 27 |
// so PHPStan can analyze src/App/CLI/AutoAltTextCommand.php. |
| 28 |
if (!class_exists('WP_CLI_Command')) { |
| 29 |
class WP_CLI_Command |
| 30 |
{ |
| 31 |
} |
| 32 |
} |
| 33 |
|