| Total Complexity | 3 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class Negotiate extends \SimpleSAML\Module\Monitor\TestSuiteFactory |
||
| 10 | { |
||
| 11 | /** @var string|null */ |
||
| 12 | private $authorization; |
||
| 13 | |||
| 14 | /** @var \KRB5NegotiateAuth */ |
||
| 15 | private $handle; |
||
| 16 | |||
| 17 | |||
| 18 | /** |
||
| 19 | * @param \SimpleSAML\Module\Monitor\TestConfiguration $configuration |
||
| 20 | * @param \SimpleSAML\Module\Monitor\TestData $testData |
||
| 21 | */ |
||
| 22 | public function __construct(TestConfiguration $configuration, TestData $testData) |
||
| 23 | { |
||
| 24 | $authSourceData = $testData->getInputItem('authSourceData'); |
||
| 25 | $serverVars = $configuration->getServerVars(); |
||
| 26 | |||
| 27 | assert(is_array($authSourceData)); |
||
| 28 | |||
| 29 | $keytab = isset($authSourceData['keytab']) ? $authSourceData['keytab'] : null; |
||
| 30 | $this->handle = new \KRB5NegotiateAuth($keytab); |
||
|
|
|||
| 31 | $this->authorization = $serverVars->get('HTTP_AUTHORIZATION'); |
||
| 32 | $this->setCategory('SPNEGO authentication source'); |
||
| 33 | |||
| 34 | parent::__construct($configuration); |
||
| 35 | } |
||
| 36 | |||
| 37 | |||
| 38 | /** |
||
| 39 | * @return void |
||
| 40 | */ |
||
| 41 | public function invokeTest(): void |
||
| 52 | } |
||
| 53 | } |
||
| 54 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.