No need to declare constants in PHPStan bootstrap

pull/614/head
franck 2023-10-25 19:24:01 +02:00
parent 7fea0b3812
commit 1a15531703
Signed by: franck-paul
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);
});