|
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_Command_For; |
|
15
|
|
|
use Mailcode\Mailcode_Commands_Keywords; |
|
16
|
|
|
use Mailcode\Mailcode_Parser_Statement_Tokenizer_Token; |
|
17
|
|
|
use Mailcode\Mailcode_Parser_Statement_Tokenizer_Token_Number; |
|
18
|
|
|
use Mailcode\Mailcode_Parser_Statement_Tokenizer_Token_Variable; |
|
19
|
|
|
use phpDocumentor\Descriptor\Interfaces\FunctionInterface; |
|
|
|
|
|
|
20
|
|
|
use function Mailcode\t; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Command validation drop-in: checks for the presence |
|
24
|
|
|
* of the `break-at:` keyword in the command statement. |
|
25
|
|
|
* |
|
26
|
|
|
* @package Mailcode |
|
27
|
|
|
* @subpackage Validation |
|
28
|
|
|
* |
|
29
|
|
|
* @see BreakAtInterface |
|
30
|
|
|
*/ |
|
31
|
|
|
trait BreakAtTrait |
|
32
|
|
|
{ |
|
33
|
|
|
/** |
|
34
|
|
|
* @var boolean |
|
35
|
|
|
*/ |
|
36
|
|
|
private bool $breakAtEnabled = false; |
|
37
|
|
|
|
|
38
|
|
|
private ?Mailcode_Parser_Statement_Tokenizer_Token $token = null; |
|
39
|
|
|
|
|
40
|
|
|
protected function validateSyntax_break_at(): void |
|
41
|
|
|
{ |
|
42
|
|
|
$this->token = $this->requireParams()->getInfo()->getTokenForKeyword(Mailcode_Commands_Keywords::TYPE_BREAK_AT); |
|
|
|
|
|
|
43
|
|
|
|
|
44
|
|
|
$val = $this->validator->createKeyword(Mailcode_Commands_Keywords::TYPE_BREAK_AT); |
|
45
|
|
|
|
|
46
|
|
|
$this->breakAtEnabled = $val->isValid() && $this->token != null;; |
|
47
|
|
|
|
|
48
|
|
|
if ($this->breakAtEnabled) { |
|
49
|
|
|
if (!$this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number && |
|
50
|
|
|
!$this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
|
51
|
|
|
$this->validationResult->makeError( |
|
52
|
|
|
t('Invalid break-at usage'), |
|
53
|
|
|
Mailcode_Commands_Command_For::VALIDATION_BREAK_AT_WRONG_PARAMETER |
|
54
|
|
|
); |
|
55
|
|
|
return; |
|
56
|
|
|
} |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function isBreakAtEnabled(): bool |
|
61
|
|
|
{ |
|
62
|
|
|
return $this->breakAtEnabled; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function getBreakAtToken(): ?Mailcode_Parser_Statement_Tokenizer_Token |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->token; |
|
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