classOptionArguments
final class OptionArguments
Reads the value of a utility option the way the server does.
Rule: PG-UTILITY-OPTION-VALUE-001. A Boolean option without a value is true. With a value, the integers 0 and 1 are false and true, and a word, a string or one of the keywords TRUE, FALSE and ON is true for true and on and false for false and off, compared without regard to case; any other value is not Boolean. An integer option takes an integer constant that fits in 32 bits: the lexer reads a larger integer as a decimal number, which is not an integer. When an option is written more than once, the last occurrence decides. Termination: one pass over a finite list. Source: https://www.postgresql.org/docs/17/sql-explain.html, https://www.postgresql.org/docs/17/sql-vacuum.html, https://www.postgresql.org/docs/17/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS-NUMERIC. Status: Implemented.
Methods§
public function boolean(UtilityOption $option): ?boolAnswers the Boolean value of an option, or null when its value is not Boolean.
Parameters
$option | UtilityOption |
Returns
?boolTest cases 2
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\OptionArguments::enabled() packages/sql-semantics-postgres/src/Rules/Utility/OptionArguments.php:88
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\OptionRules::derive() packages/sql-semantics-postgres/src/Rules/Utility/OptionRules.php:158
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:56
Calls 2
- method-call OptionArguments::integer() line 44
- function-call
strtolowerline 58
public function integer(UtilityOption $option): ?intAnswers the integer value of an option, or null when it has no value or the value is not an integer that fits in 32 bits.
Parameters
$option | UtilityOption |
Returns
?intTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\OptionArguments::boolean() packages/sql-semantics-postgres/src/Rules/Utility/OptionArguments.php:44
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::workers() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:90
public function enabled(list<UtilityOption> $options, string $name, bool $default): boolAnswers the Boolean value of the last option of a name, or a default when none is written or its value is not Boolean.
Parameters
$options | list<UtilityOption> | |
$name | string | |
$default | bool |
Returns
boolTest cases 1
Called from 11
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:86
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:97
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:98
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:103
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:60
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:61
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:66
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:67
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:69
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::combined() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:114
- method-call SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\Reindex::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Maintenance/Reindex.php:82
Calls 3
- method-call OptionRules::find() line 86
- new OptionRules line 86
- method-call OptionArguments::boolean() line 88
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 6
- new SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:85
- new SqlSemantics\Platform\PostgreSql\Rules\Utility\OptionRules::derive() packages/sql-semantics-postgres/src/Rules/Utility/OptionRules.php:158
- new SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:51
- new SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::workers() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:90
- new SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::combined() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:112
- new SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\Reindex::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Maintenance/Reindex.php:82
Method calls 14
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:86
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:97
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:98
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::checks() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:103
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\OptionRules::derive() packages/sql-semantics-postgres/src/Rules/Utility/OptionRules.php:158
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:56
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:60
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:61
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:66
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:67
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::check() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:69
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::workers() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:90
- method-call SqlSemantics\Platform\PostgreSql\Rules\Utility\VacuumChecks::combined() packages/sql-semantics-postgres/src/Rules/Utility/VacuumChecks.php:114
- method-call SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\Reindex::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Maintenance/Reindex.php:82