Compare commits
No commits in common. "4582f6a697e8a036286a50f61cd29392ae80c38d" and "54a30e683e7fb880244ac79f65e4cbd6c8326aa6" have entirely different histories.
4582f6a697
...
54a30e683e
37
phpunit.xml
37
phpunit.xml
|
@ -1,14 +1,27 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" backupGlobals="false" beStrictAboutChangesToGlobalState="true" beStrictAboutOutputDuringTests="true" bootstrap="tests/bootstrap.php" cacheResult="false" colors="true" enforceTimeLimit="true" failOnWarning="true" processIsolation="true" stopOnError="true" stopOnFailure="true" stopOnIncomplete="true" stopOnSkipped="true" stopOnRisky="true" testdox="false" timeoutForSmallTests="1" timeoutForMediumTests="10" timeoutForLargeTests="60" cacheDirectory=".phpunit.cache" backupStaticProperties="false" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="false">
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
|
||||||
<testsuites>
|
backupGlobals="false" backupStaticAttributes="false"
|
||||||
<testsuite name="tests">
|
beStrictAboutChangesToGlobalState="true" beStrictAboutOutputDuringTests="true" beStrictAboutResourceUsageDuringSmallTests="true" beStrictAboutTodoAnnotatedTests="true" beStrictAboutCoversAnnotation="false"
|
||||||
<directory>tests/</directory>
|
bootstrap="tests/bootstrap.php"
|
||||||
</testsuite>
|
cacheResult="false"
|
||||||
</testsuites>
|
colors="true"
|
||||||
<coverage/>
|
convertErrorsToExceptions="true" convertDeprecationsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true"
|
||||||
<source>
|
enforceTimeLimit="true"
|
||||||
<include>
|
failOnWarning="true"
|
||||||
<directory suffix=".php">src</directory>
|
forceCoversAnnotation="false"
|
||||||
</include>
|
processIsolation="true"
|
||||||
</source>
|
stopOnError="true" stopOnFailure="true" stopOnIncomplete="true" stopOnSkipped="true" stopOnRisky="true"
|
||||||
|
testdox="true"
|
||||||
|
timeoutForSmallTests="1" timeoutForMediumTests="10" timeoutForLargeTests="60"
|
||||||
|
verbose="true">
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="tests">
|
||||||
|
<directory>tests/</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
<coverage>
|
||||||
|
<include>
|
||||||
|
<directory suffix=".php">src</directory>
|
||||||
|
</include>
|
||||||
|
</coverage>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|
|
@ -507,7 +507,7 @@ final class NodaTimeSplitter {
|
||||||
if (strlen($datum) <= 9) return [];
|
if (strlen($datum) <= 9) return [];
|
||||||
|
|
||||||
// The year is only parse-able if it is a four digit year at the start
|
// The year is only parse-able if it is a four digit year at the start
|
||||||
if (self::is_numeric((string)\substr($datum, 0, 4)) && substr($datum, 4, 1) === '.') {
|
if (self::is_numeric((string)\substr($datum, 0, 4))) {
|
||||||
$year = \substr($datum, 0, 4);
|
$year = \substr($datum, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,21 +1114,11 @@ final class NodaTimeSplitter {
|
||||||
public static function attempt_splitting(string $datum):array {
|
public static function attempt_splitting(string $datum):array {
|
||||||
|
|
||||||
$moda = NodaTimeSplitter::is_timespan($datum);
|
$moda = NodaTimeSplitter::is_timespan($datum);
|
||||||
if (!$moda) {
|
if (!$moda) $moda = NodaTimeSplitter::is_incomplete_date($datum);
|
||||||
$moda = NodaTimeSplitter::is_incomplete_date($datum);
|
if (!$moda) $moda = NodaTimeSplitter::is_valid_date($datum);
|
||||||
}
|
if (!$moda) $moda = NodaTimeSplitter::is_valid_date_hungarian($datum);
|
||||||
if (!$moda) {
|
if (!$moda) $moda = NodaTimeSplitter::is_century($datum);
|
||||||
$moda = NodaTimeSplitter::is_valid_date($datum);
|
if (!$moda) $moda = NodaTimeSplitter::is_decade($datum);
|
||||||
}
|
|
||||||
if (!$moda) {
|
|
||||||
$moda = NodaTimeSplitter::is_valid_date_hungarian($datum);
|
|
||||||
}
|
|
||||||
if (!$moda) {
|
|
||||||
$moda = NodaTimeSplitter::is_century($datum);
|
|
||||||
}
|
|
||||||
if (!$moda) {
|
|
||||||
$moda = NodaTimeSplitter::is_decade($datum);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($moda)) {
|
if (!empty($moda)) {
|
||||||
if ((int)$moda[2] > 12 || (int)$moda[3] > 31) {
|
if ((int)$moda[2] > 12 || (int)$moda[3] > 31) {
|
||||||
|
|
|
@ -699,8 +699,6 @@ final class NodaTimeSplitterTest extends TestCase {
|
||||||
|
|
||||||
$output = NodaTimeSplitter::attempt_splitting("65497028c51eb");
|
$output = NodaTimeSplitter::attempt_splitting("65497028c51eb");
|
||||||
self::assertEquals($output, []);
|
self::assertEquals($output, []);
|
||||||
$output = NodaTimeSplitter::attempt_splitting("6552cf08b0196 test tag");
|
|
||||||
self::assertEquals($output, []);
|
|
||||||
|
|
||||||
# $output = NodaTimeSplitter::attempt_splitting("Nach 1944-1964");
|
# $output = NodaTimeSplitter::attempt_splitting("Nach 1944-1964");
|
||||||
# self::assertEquals($output, []);
|
# self::assertEquals($output, []);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user