classSpatialChecks
final class SpatialChecks
Checks a spatial reference system statement as the server does while it parses it.
Rule: MYSQL-SRS-CHECK-001. Mirrors the srs_attributes actions and PT_create_srs::make_cmd / PT_drop_srs::make_cmd of the server: the identifier is 1 to 2^32-1 (gis::srid_t); each attribute is written at most once; NAME and DEFINITION are mandatory; NAME and ORGANIZATION are not empty and neither start nor end with whitespace; no attribute holds a control character (0x00-0x1F, 0x7F); NAME holds at most 80 characters, DEFINITION 4096, ORGANIZATION 256 and DESCRIPTION 2048, counted as UTF-8 characters; the organization's identifier is at most 2^32-1. Each broken rule is one SpatialProblem; the server stops at the first. Terminates: one pass over the attributes. Source: https://dev.mysql.com/doc/refman/8.4/en/create-spatial-reference-system.html. Status: Implemented.
Methods§
public function srid(Derivation $derivation, Numeral $srid): voidReports an identifier out of range or zero.
Parameters
$derivation | Derivation | |
$srid | Numeral |
Called from 2
- method-call SqlSemantics\Platform\MySql\Statement\Server\Spatial\CreateSpatialReference::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Spatial/CreateSpatialReference.php:59
- method-call SqlSemantics\Platform\MySql\Statement\Server\Spatial\DropSpatialReference::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Spatial/DropSpatialReference.php:44
Calls 7
- new Magnitudes line 44
- method-call Magnitudes::integer() line 45
- method-call Magnitudes::atMost() line 48
- method-call Derivation::report() line 49
- new SpatialProblem line 49
- class-const SpatialRule::IdentifierOutOfRange() line 49
- class-const SpatialRule::IdentifierZero() line 51
public function attributes(Derivation $derivation, list<SpatialAttribute> $attributes): voidReports the problems of the attributes.
Parameters
$derivation | Derivation | |
$attributes | list<SpatialAttribute> |
Called from 1
Calls 7
- method-call Derivation::report() line 65
- new SpatialProblem line 65
- class-const SpatialRule::RepeatedAttribute() line 65
- method-call SpatialChecks::attribute() line 68
- class-const SpatialAttributeKind::Name() line 70
- class-const SpatialAttributeKind::Definition() line 70
- class-const SpatialRule::MissingAttribute() line 72
public function attribute(Derivation $derivation, SpatialAttribute $attribute): voidReports the problems of one attribute.
Parameters
$derivation | Derivation | |
$attribute | SpatialAttribute |
Called from 1
Calls 16
- function-call
preg_matchline 83 - class-const SpatialAttributeKind::Name() line 84
- method-call Derivation::report() line 85
- new SpatialProblem line 85
- class-const SpatialRule::BlankName() line 85
- class-const SpatialAttributeKind::Organization() line 87
- class-const SpatialRule::BlankOrganization() line 88
- class-const SpatialRule::ControlCharacter() line 91
- function-call
strlenline 93 - function-call
preg_match_allline 93 - class-const SpatialChecks::LIMITS() line 93
- class-const SpatialRule::TooLong() line 94
- new Magnitudes line 96
- method-call Magnitudes::integer() line 97
- method-call Magnitudes::atMost() line 97
- class-const SpatialRule::IdentifierOutOfRange() line 98
Private surface 1§
Implementation details, listed for orientation only.
private const LIMITS = ['NAME' => 80, 'DEFINITION' => 4096, 'ORGANIZATION' => 256, 'DESCRIPTION' => 20…Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SpatialChecksTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Statement\Server\Spatial\CreateSpatialReference::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Spatial/CreateSpatialReference.php:58
- new SqlSemantics\Platform\MySql\Statement\Server\Spatial\DropSpatialReference::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Spatial/DropSpatialReference.php:44
Method calls 3
- method-call SqlSemantics\Platform\MySql\Statement\Server\Spatial\CreateSpatialReference::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Spatial/CreateSpatialReference.php:59
- method-call SqlSemantics\Platform\MySql\Statement\Server\Spatial\CreateSpatialReference::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Spatial/CreateSpatialReference.php:60
- method-call SqlSemantics\Platform\MySql\Statement\Server\Spatial\DropSpatialReference::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Spatial/DropSpatialReference.php:44