classSqlBehaviorRule
final class SqlBehaviorRule
Represents a single SQL behavior rule with pattern and associated behavior.
Methods§
public function __construct(string $pattern, UnsupportedSqlBehavior $behavior)Parameters
$pattern | string | The pattern to match (prefix or regex starting with '/'). |
$behavior | UnsupportedSqlBehavior | The behavior to apply when matched. |
Calls 1
- function-call
str_starts_withline 33
public function matches(string $sql): boolCheck if the given SQL matches this rule.
Parameters
$sql | string |
Returns
boolTest cases 7
SqlBehaviorRuleTest::testComplexRegexPatternscallsSqlBehaviorRuleTest::testMatchesAnswersForTheStatementsTheRuleIsWrittenForcallsSqlBehaviorRuleTest::testPrefixDoesNotMatchNonPrefixcallsSqlBehaviorRuleTest::testPrefixMatchesCaseInsensitivecallsSqlBehaviorRuleTest::testPrefixMatchesWithLeadingWhitespacecallsSqlBehaviorRuleTest::testRegexDoesNotMatchNonMatchingcallsSqlBehaviorRuleTest::testRegexMatchescalls
public function behavior(): UnsupportedSqlBehaviorGet the behavior to apply when this rule matches.
Returns
Test cases 1
public function pattern(): stringGet the pattern.
Returns
stringTest cases 1
public function isRegex(): boolCheck if this rule uses regex matching.
Returns
boolTest cases 1
Private surface 3§
Implementation details, listed for orientation only.
private string $patternprivate bool $isRegexprivate UnsupportedSqlBehavior $behaviorTest cases 11§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 10
SqlBehaviorRuleTest::testBehaviorReturnsConfiguredValuecallsSqlBehaviorRuleTest::testComplexRegexPatternscallsSqlBehaviorRuleTest::testIsRegexDetectioncallsSqlBehaviorRuleTest::testMatchesAnswersForTheStatementsTheRuleIsWrittenForcallsSqlBehaviorRuleTest::testPatternReturnsOriginalPatterncallsSqlBehaviorRuleTest::testPrefixDoesNotMatchNonPrefixcallsSqlBehaviorRuleTest::testPrefixMatchesCaseInsensitivecallsSqlBehaviorRuleTest::testPrefixMatchesWithLeadingWhitespacecallsSqlBehaviorRuleTest::testRegexDoesNotMatchNonMatchingcallsSqlBehaviorRuleTest::testRegexMatchescalls
Other tests reaching this symbol 1
ZtdConfigTestcalls