classRecordParser
final class RecordParser
Restricted visibility: declared "@visibility ZtdQuery\Platform\MySql". Code outside that scope must not name this declaration.
Record Parser.
Methods§
public function splitRecords(string $contents, InputFormat $format): list<string>Parameters
$contents | string | |
$format | InputFormat |
Returns
list<string>Test cases 1
Called from 1
Calls 4
- method-call RecordParser::enclosureWidth() line 34
- function-call
str_repeatline 35 - function-call
substr_compareline 42 - function-call
strlenline 42
public function parseFields(string $record, InputFormat $format): list<string|null>Parameters
$record | string | |
$format | InputFormat |
Returns
list<string|null>Test cases 1
Called from 1
Calls 4
- method-call RecordParser::decodeEscape() line 81
- function-call
substr_compareline 103 - function-call
strlenline 103 - method-call RecordParser::fieldValue() line 104
public function fieldValue(
string $raw,
string $decoded,
bool $quoted,
string $enclosure,
string $escape,
): ?stringField Value for the supplied MySQL input.
Parameters
$raw | string | |
$decoded | string | |
$quoted | bool | |
$enclosure | string | |
$escape | string |
Returns
?stringTest cases 1
Called from 2
public function decodeEscape(string $byte): stringDecode MySQL LOAD DATA escape bytes, preserving unrecognized bytes.
Parameters
$byte | string |
Returns
stringTest cases 7
RecordParserTest::testDecodeEscapeCase1callsRecordParserTest::testDecodeEscapeCase2callsRecordParserTest::testDecodeEscapeCase3callsRecordParserTest::testDecodeEscapeCase4callsRecordParserTest::testDecodeEscapeCase5callsRecordParserTest::testDecodeEscapeCase6callsRecordParserTest::testDecodeEscapeCase7calls
public function enclosureWidth(?string $followingByte, bool $enclosed, string $enclosure): intA doubled enclosure inside an enclosed field is one literal enclosure token.
Parameters
$followingByte | ?string | |
$enclosed | bool | |
$enclosure | string |
Returns
intTest cases 1
Test cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 11
RecordParserTest::testDecodeEscapeCase1callsRecordParserTest::testDecodeEscapeCase2callsRecordParserTest::testDecodeEscapeCase3callsRecordParserTest::testDecodeEscapeCase4callsRecordParserTest::testDecodeEscapeCase5callsRecordParserTest::testDecodeEscapeCase6callsRecordParserTest::testDecodeEscapeCase7callsRecordParserTest::testEnclosureWidthcallsRecordParserTest::testFieldValuecallsRecordParserTest::testParseFieldscallsRecordParserTest::testSplitRecordscalls
Other tests reaching this symbol 3
MySqlSessionFactoryTestcallsMySqlLoadDataProjectorTestcallsMySqlRewriterTestcalls
Relations§
Instantiated in 2
- new ZtdQuery\Platform\MySql\Rewrite\LoadData\MySqlLoadDataProjector::project() packages/ztd-query-mysql/src/Rewrite/LoadData/MySqlLoadDataProjector.php:63
- new ZtdQuery\Platform\MySql\Rewrite\LoadData\MySqlLoadDataProjector::project() packages/ztd-query-mysql/src/Rewrite/LoadData/MySqlLoadDataProjector.php:74
Method calls 2
- method-call ZtdQuery\Platform\MySql\Rewrite\LoadData\MySqlLoadDataProjector::project() packages/ztd-query-mysql/src/Rewrite/LoadData/MySqlLoadDataProjector.php:63
- method-call ZtdQuery\Platform\MySql\Rewrite\LoadData\MySqlLoadDataProjector::project() packages/ztd-query-mysql/src/Rewrite/LoadData/MySqlLoadDataProjector.php:74