mirror of
https://git.dotclear.org/dev/dotclear.git
synced 2024-12-27 04:00:13 +00:00
No need to declare constants in PHPStan bootstrap
This commit is contained in:
parent
7fea0b3812
commit
1a15531703
4 changed files with 3 additions and 7 deletions
|
@ -1,9 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Mock some global constants
|
|
||||||
define('DC_ANTISPAM_CONF_SUPER', true);
|
|
||||||
define('DC_FAIRTRACKBACKS_FORCE', true);
|
|
||||||
|
|
||||||
// Xdebug method()
|
// Xdebug method()
|
||||||
// function xdebug_time_index() {}
|
// function xdebug_time_index() {}
|
||||||
// function xdebug_get_profiler_filename() {}
|
// function xdebug_get_profiler_filename() {}
|
||||||
|
|
|
@ -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([
|
App::behavior()->addBehaviors([
|
||||||
'adminBlogPreferencesFormV2' => BackendBehaviors::adminBlogPreferencesForm(...),
|
'adminBlogPreferencesFormV2' => BackendBehaviors::adminBlogPreferencesForm(...),
|
||||||
'adminBeforeBlogSettingsUpdate' => BackendBehaviors::adminBeforeBlogSettingsUpdate(...),
|
'adminBeforeBlogSettingsUpdate' => BackendBehaviors::adminBeforeBlogSettingsUpdate(...),
|
||||||
|
|
|
@ -30,7 +30,7 @@ class Frontend extends Process
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DC_FAIRTRACKBACKS_FORCE) {
|
if (defined('DC_FAIRTRACKBACKS_FORCE') && DC_FAIRTRACKBACKS_FORCE) {
|
||||||
App::behavior()->addBehavior('AntispamInitFilters', function (ArrayObject $stack) {
|
App::behavior()->addBehavior('AntispamInitFilters', function (ArrayObject $stack) {
|
||||||
$stack->append(AntispamFilterFairTrackbacks::class);
|
$stack->append(AntispamFilterFairTrackbacks::class);
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Prepend extends Process
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DC_FAIRTRACKBACKS_FORCE) {
|
if (defined('DC_FAIRTRACKBACKS_FORCE') && !DC_FAIRTRACKBACKS_FORCE) {
|
||||||
App::behavior()->addBehavior('AntispamInitFilters', function (ArrayObject $stack) {
|
App::behavior()->addBehavior('AntispamInitFilters', function (ArrayObject $stack) {
|
||||||
$stack->append(AntispamFilterFairTrackbacks::class);
|
$stack->append(AntispamFilterFairTrackbacks::class);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue