Skip to content

Commit

Permalink
[TASK] Switch the code style checks on CI to PHP 8.3
Browse files Browse the repository at this point in the history
There is no such thing as a free lunch, but at least there's
a free performance gain here.

Also format the code according to the latest PHP-CS-Fixer version.
  • Loading branch information
oliverklee committed Feb 16, 2024
1 parent fadda63 commit 86df63a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
php: ["8.1"]
php: ["8.3"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
4 changes: 1 addition & 3 deletions src/Exception/ExtensionKeyMissingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@

namespace TYPO3\Tailor\Exception;

class ExtensionKeyMissingException extends \InvalidArgumentException
{
}
class ExtensionKeyMissingException extends \InvalidArgumentException {}
4 changes: 1 addition & 3 deletions src/Exception/FormDataProcessingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@

namespace TYPO3\Tailor\Exception;

class FormDataProcessingException extends \RuntimeException
{
}
class FormDataProcessingException extends \RuntimeException {}
4 changes: 1 addition & 3 deletions src/Exception/InvalidComposerJsonException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@

namespace TYPO3\Tailor\Exception;

class InvalidComposerJsonException extends \InvalidArgumentException
{
}
class InvalidComposerJsonException extends \InvalidArgumentException {}
4 changes: 1 addition & 3 deletions src/Exception/RequiredConfigurationMissing.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@

namespace TYPO3\Tailor\Exception;

class RequiredConfigurationMissing extends \InvalidArgumentException
{
}
class RequiredConfigurationMissing extends \InvalidArgumentException {}
2 changes: 1 addition & 1 deletion src/Filesystem/VersionReplacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function setVersion(string $filePath, string $pattern, int $versionPartsT
if ($fileContents === false) {
throw new \InvalidArgumentException('The file ' . $filePath . ' could not be opened', 1605741968);
}
$updatedFileContents = preg_replace_callback('/' . $pattern . '/u', static function ($matches) use ($newVersion) {
$updatedFileContents = preg_replace_callback('/' . $pattern . '/u', static function($matches) use ($newVersion) {
return str_replace($matches[1], $newVersion, $matches[0]);
}, $fileContents);
file_put_contents($filePath, $updatedFileContents);
Expand Down
4 changes: 2 additions & 2 deletions src/Service/VersionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function createZipArchiveFromPath(string $path): string

$iterator = new RecursiveDirectoryIterator($fullPath, FilesystemIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator(
new RecursiveCallbackFilterIterator($iterator, function ($current) use ($fullPath) {
new RecursiveCallbackFilterIterator($iterator, function($current) use ($fullPath) {
// @todo Find a more performant way for filtering

$filepath = $current->getRealPath();
Expand Down Expand Up @@ -204,7 +204,7 @@ protected function getVersionFilename(bool $hash = false): string
{
$filename = sprintf('%s/%s_%s.zip', $this->transactionPath, $this->extension, $this->version);

return $hash ? md5($filename): $filename;
return $hash ? md5($filename) : $filename;
}

/**
Expand Down

0 comments on commit 86df63a

Please sign in to comment.