1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* File containing the {@see \Mailcode\Traits\Commands\Validation\NoTrackingTrait} trait. |
4
|
|
|
* |
5
|
|
|
* @see \Mailcode\Traits\Commands\Validation\NoTrackingTrait |
6
|
|
|
* @subpackage Validation |
7
|
|
|
* @package Mailcode |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
declare(strict_types=1); |
11
|
|
|
|
12
|
|
|
namespace Mailcode\Traits\Commands\Validation; |
13
|
|
|
|
14
|
|
|
use Mailcode\Mailcode_Commands_CommonConstants; |
15
|
|
|
use Mailcode\Mailcode_Commands_Keywords; |
16
|
|
|
use Mailcode\Mailcode_Parser_Statement_Tokenizer_Token_Variable; |
17
|
|
|
use Mailcode\Mailcode_Variables_Variable; |
18
|
|
|
use phpDocumentor\Descriptor\Interfaces\FunctionInterface; |
|
|
|
|
19
|
|
|
use function Mailcode\t; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Command validation drop-in: checks for the presence |
23
|
|
|
* of the `count:` keyword in the command statement. |
24
|
|
|
* |
25
|
|
|
* @package Mailcode |
26
|
|
|
* @subpackage Validation |
27
|
|
|
* |
28
|
|
|
* @see CountInterface |
29
|
|
|
*/ |
30
|
|
|
trait CountTrait |
31
|
|
|
{ |
32
|
|
|
/** |
33
|
|
|
* @var boolean |
34
|
|
|
*/ |
35
|
|
|
private bool $countEnabled = false; |
36
|
|
|
|
37
|
|
|
private ?Mailcode_Parser_Statement_Tokenizer_Token_Variable $token = null; |
38
|
|
|
|
39
|
|
|
protected function validateSyntax_count(): void |
40
|
|
|
{ |
41
|
|
|
$token = $this->requireParams()->getInfo()->getTokenForKeyword(Mailcode_Commands_Keywords::TYPE_COUNT); |
|
|
|
|
42
|
|
|
if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
43
|
|
|
$this->token = $token; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
$val = $this->validator->createKeyword(Mailcode_Commands_Keywords::TYPE_COUNT); |
47
|
|
|
$this->countEnabled = $val->isValid(); |
48
|
|
|
|
49
|
|
|
if ($this->countEnabled) { |
50
|
|
|
if (!$this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
51
|
|
|
$this->validationResult->makeError( |
52
|
|
|
t('Invalid count usage'), |
53
|
|
|
Mailcode_Commands_CommonConstants::VALIDATION_INVALID_COUNT_USAGE |
54
|
|
|
); |
55
|
|
|
return; |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function isCountEnabled(): bool |
61
|
|
|
{ |
62
|
|
|
return $this->countEnabled; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function getCountVariable(): ?Mailcode_Variables_Variable |
66
|
|
|
{ |
67
|
|
|
return $this->token->getVariable(); |
|
|
|
|
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
} |
71
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths