No need to declare constants in PHPStan bootstrap

This commit is contained in:
franck 2023-10-25 19:24:01 +02:00
parent 7fea0b3812
commit 1a15531703
No known key found for this signature in database
GPG key ID: BC0939B7E6CF71E7
4 changed files with 3 additions and 7 deletions

View file

@ -1,9 +1,5 @@
<?php
// Mock some global constants
define('DC_ANTISPAM_CONF_SUPER', true);
define('DC_FAIRTRACKBACKS_FORCE', true);
// Xdebug method()
// function xdebug_time_index() {}
// function xdebug_get_profiler_filename() {}

View file

@ -71,7 +71,7 @@ class Backend extends Process
},
]);
if (!DC_ANTISPAM_CONF_SUPER || App::auth()->isSuperAdmin()) {
if ((defined('DC_ANTISPAM_CONF_SUPER') && !DC_ANTISPAM_CONF_SUPER) || App::auth()->isSuperAdmin()) {
App::behavior()->addBehaviors([
'adminBlogPreferencesFormV2' => BackendBehaviors::adminBlogPreferencesForm(...),
'adminBeforeBlogSettingsUpdate' => BackendBehaviors::adminBeforeBlogSettingsUpdate(...),

View file

@ -30,7 +30,7 @@ class Frontend extends Process
return false;
}
if (DC_FAIRTRACKBACKS_FORCE) {
if (defined('DC_FAIRTRACKBACKS_FORCE') && DC_FAIRTRACKBACKS_FORCE) {
App::behavior()->addBehavior('AntispamInitFilters', function (ArrayObject $stack) {
$stack->append(AntispamFilterFairTrackbacks::class);
});

View file

@ -37,7 +37,7 @@ class Prepend extends Process
return false;
}
if (!DC_FAIRTRACKBACKS_FORCE) {
if (defined('DC_FAIRTRACKBACKS_FORCE') && !DC_FAIRTRACKBACKS_FORCE) {
App::behavior()->addBehavior('AntispamInitFilters', function (ArrayObject $stack) {
$stack->append(AntispamFilterFairTrackbacks::class);
});