classCallMisuse
final class CallMisuse
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.A call of a built-in function with a clause its kind of function does not take.
A window-only function needs OVER, a scalar function takes neither OVER nor FILTER nor an argument ordering, a window takes no DISTINCT, and a DISTINCT aggregate takes exactly one argument.
(new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT abs(1) OVER ()') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: abs() may not be used as a window functionProperties§
public CallMisuseRule $rulepublic Name $functionMethods§
public function __construct(public CallMisuseRule $rule, public Name $function)Parameters
$rule | CallMisuseRule | The broken rule |
$function | Name | The function name as written |
public function message(): stringDescribes the broken rule in the words of SQLite.
Returns
stringTest cases 1
Calls 7
- class-const CallMisuseRule::WindowWithoutOver() line 40
- class-const CallMisuseRule::ScalarAsWindow() line 41
- class-const CallMisuseRule::FilterWithoutAggregate() line 42
- class-const CallMisuseRule::FilterOnWindowOnly() line 43
- class-const CallMisuseRule::OrderByWithoutAggregate() line 44
- class-const CallMisuseRule::DistinctInWindow() line 45
- class-const CallMisuseRule::DistinctArguments() line 46
Test cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 14
CallChecksTest::testReportRecordsAFilterOnAWindowOnlyFunctioncallsCallChecksTest::testReportRecordsAnArgumentOrderingOutsideAnAggregatecallsCallChecksTest::testReportRecordsAScalarFunctionCalledAsAWindowOrWithFiltercallsCallChecksTest::testReportRecordsAWindowFunctionCalledWithoutOvercallsCallChecksTest::testReportRecordsDistinctInAWindowAndDistinctWithSeveralArgumentscallsCallChecksTest::testReportRecordsThroughTheDerivationcallsFunctionCallTest::testDeriveScalarReportsAFilterOnAScalarFunctioncallsFunctionCallTest::testDeriveScalarReportsAFilterOnAWindowOnlyFunctioncallsFunctionCallTest::testDeriveScalarReportsAnOrderingInsideAScalarCallcallsFunctionCallTest::testDeriveScalarReportsAScalarFunctionUsedAsAWindowcallsFunctionCallTest::testDeriveScalarReportsAWindowFunctionWithoutOvercallsFunctionCallTest::testDeriveScalarReportsDistinctInAWindowcallsFunctionCallTest::testDeriveScalarReportsDistinctWithSeveralArgumentscallsCallMisuseRuleTest::testCasesTellWhichRuleACallBreakscalls