Skip to content

Commit

Permalink
[CS] Code Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Jan 18, 2025
1 parent e5c5e61 commit 6c15386
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build/phprectorconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
codeQuality: true,
codingStyle: true,
strictBooleans: true,
instanceOf: true,
earlyReturn: true,
//
carbon: false,
deadCode: false,
doctrineCodeQuality: false,
earlyReturn: false,
instanceOf: false,
naming: false,
phpunitCodeQuality: false,
privatization: false,
Expand Down
2 changes: 1 addition & 1 deletion make/genchangelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function stristartswith(string $haystack, string $needle): bool
function correctAuthor(string $author): string
{
if ($author === "horstoeko" || $author === "ruff" || $author === "Daniel Erling") {
$author = "HorstOeko";
return "HorstOeko";
}

return $author;
Expand Down
2 changes: 1 addition & 1 deletion make/genmethoddocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ private function fixPhpType(string $string): string
}

if ($string === '$this') {
$string = 'static';
return 'static';
}

return $string;
Expand Down
28 changes: 20 additions & 8 deletions src/ZugferdObjectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1447,19 +1447,29 @@ public function toDateTime(?string $dateTimeString, ?string $format): ?DateTime

if ($format == "102") {
return DateTime::createFromFormat("Ymd", $dateTimeString);
} elseif ($format == "101") {
}

if ($format == "101") {
return DateTime::createFromFormat("ymd", $dateTimeString);
} elseif ($format == "201") {
}

if ($format == "201") {
return DateTime::createFromFormat("ymdHi", $dateTimeString);
} elseif ($format == "202") {
}

if ($format == "202") {
return DateTime::createFromFormat("ymdHis", $dateTimeString);
} elseif ($format == "203") {
}

if ($format == "203") {
return DateTime::createFromFormat("YmdHi", $dateTimeString);
} elseif ($format == "204") {
}

if ($format == "204") {
return DateTime::createFromFormat("YmdHis", $dateTimeString);
} else {
throw new ZugferdUnknownDateFormatException($format);
}

throw new ZugferdUnknownDateFormatException($format);
}

/**
Expand Down Expand Up @@ -1715,7 +1725,9 @@ public static function isAllNullOrEmpty(array $args): bool
foreach ($args as $arg) {
if ($arg instanceof DateTime) {
return false;
} elseif (!self::isNullOrEmpty($arg)) {
}

if (!self::isNullOrEmpty($arg)) {
return false;
}
}
Expand Down

0 comments on commit 6c15386

Please sign in to comment.