Exception
1 week ago
PluginActionLink
1 week ago
CoreModule.php
1 week ago
WorldlineProperties.php
1 week ago
WorldlineProperties.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | declare (strict_types=1); |
| 4 | namespace Syde\Vendor\Worldline\Inpsyde\WorldlineForWoocommerce\Core; |
| 5 | |
| 6 | use Syde\Vendor\Worldline\Inpsyde\Modularity\Properties\PluginProperties; |
| 7 | class WorldlineProperties extends PluginProperties |
| 8 | { |
| 9 | /** |
| 10 | * @param string $pluginMainFile |
| 11 | * |
| 12 | * @return PluginProperties |
| 13 | */ |
| 14 | public static function new(string $pluginMainFile) : PluginProperties |
| 15 | { |
| 16 | return new self($pluginMainFile); |
| 17 | } |
| 18 | public function isDebug() : bool |
| 19 | { |
| 20 | /** |
| 21 | * We do not wish to follow Modularity's default behaviour of piggybacking on WP_DEBUG. |
| 22 | * Experience tells us that there are too many production systems running |
| 23 | * with the WP_DEBUG flag enabled for whatever reason. We have no power over |
| 24 | * these systems to "fix" our plugin's behaviour, but the admins of these systems |
| 25 | * certainly do have the power to complain on our support forums. |
| 26 | * Since we desire to use debug mode for a couple of development-centric features such as |
| 27 | * loudly throwing exceptions, we need to be careful about enabling it. |
| 28 | * |
| 29 | * As a consequence, we implement our own debug flag here which pretty much guarantees |
| 30 | * it will never be used accidentally. |
| 31 | */ |
| 32 | return (bool) \getenv('WORLDLINE_DEBUG'); |
| 33 | } |
| 34 | } |
| 35 |