WorkspacePreviewCheck::__invoke()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 3
nc 2
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lochmueller\LanguageDetection\Check;
6
7
use Lochmueller\LanguageDetection\Event\CheckLanguageDetectionEvent;
8
9
class WorkspacePreviewCheck
10
{
11
    public function __invoke(CheckLanguageDetectionEvent $event): void
12
    {
13
        $arguments = $event->getRequest()->getQueryParams();
14
        if (\array_key_exists('ADMCMD_prev', $arguments) || \array_key_exists('ADMCMD_previewWS', $arguments)) {
15
            $event->disableLanguageDetection();
16
        }
17
    }
18
}
19