classWordPressExtension
final class WordPressExtension
implements ExtensionInterface
WordPress's wpdb, where nearly all of the SQL an installation issues is written.
wpdb::prepare() interpolates a statement and hands it back for one of the reading or writing methods to run, so it is recognised as the place the statement text comes from rather than as a call the analyzer cannot see through. That is what keeps the familiar $wpdb->get_results($wpdb->prepare(…)) readable as the statement it is.
Methods§
public function name(): stringThe name the command line selects this extension by.
Returns
stringTest cases 1
public function description(): stringWhat the extension covers.
Returns
stringTest cases 1
public function sinks(): list<SinkSpec>The wpdb calls that carry a statement or hand one back.
Returns
list<SinkSpec>Test cases 4
FreeNamesTest::testSinkArgumentsOfNamesTheArgumentsADatabaseCallsResultDependsOncallsWordPressExtensionTest::testEverySinkIsDescribedExactlycallsWordPressExtensionTest::testPrepareHandsTheStatementBackRatherThanSendingItcallsWordPressExtensionTest::testSinksCoverInterpolatingAndIssuingAStatementcalls
Calls 6
- new SinkSpec line 56
- class-const SinkCallKind::Method() line 58
- class-const WordPressExtension::DATABASE() line 59
- class-const SinkRole::Compose() line 61
- method-call WordPressExtension::methods() line 66
- class-const SinkRole::Query() line 72
public function globals(): array<string, string>The global the handle is reached through.
Almost every statement WordPress issues is written after global $wpdb;, which says nothing about what the name holds. Declaring it here is what lets those calls be read as the database calls they are.
Returns
array<string, string>Test cases 1
Calls 1
- class-const WordPressExtension::DATABASE() line 93
public function methods(): array<string, StatementKind|null>The wpdb methods that take a statement, and the kind each implies.
Returns
array<string, StatementKind|null>Test cases 1
Called from 1
Calls 1
- class-const StatementKind::Select() line 105
Private surface 1§
Implementation details, listed for orientation only.
private const DATABASE = 'wpdb'Test cases 18§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 7
WordPressExtensionTest::testDescriptionMentionsWhatItCoverscallsWordPressExtensionTest::testEverySinkIsDescribedExactlycallsWordPressExtensionTest::testGlobalsDeclareTheHandleWordPressHandsOutcallsWordPressExtensionTest::testMethodsNameTheKindTheReadingCallsImplycallsWordPressExtensionTest::testNameIsHowTheCommandLineSelectsItcallsWordPressExtensionTest::testPrepareHandsTheStatementBackRatherThanSendingItcallsWordPressExtensionTest::testSinksCoverInterpolatingAndIssuingAStatementcalls
Other tests reaching this symbol 11
CatalogCommandTestcallsUsageTextTestcallsCallEvaluatorTestcallsFreeNamesTest::testSinkArgumentsOfNamesTheArgumentsADatabaseCallsResultDependsOncallsExpressionEvaluatorTestcallsInterpreterTestcallsExtensionRegistryTestcallsCallModelTestcallsAnalyzerTestcallsJsonReporterTestcallsTextReporterTestcalls