Skip to content

Commit

Permalink
[TASK] Make regex more explicit and change severity
Browse files Browse the repository at this point in the history
  • Loading branch information
o-ba committed Jan 12, 2021
1 parent a6b2f5b commit 4a35cd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/Command/Extension/SetExtensionVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class SetExtensionVersionCommand extends Command
{
private const EMCONF_PATTERN = '["\']version["\']\s=>\s["\']((?:[0-9]+)\.[0-9]+\.[0-9]+\s*)["\']';
private const DOCUMENTATION_VERSION_PATTERN = 'version\s*=\s*([0-9.]+)';
private const DOCUMENTATION_VERSION_PATTERN = 'version\s*=\s*([0-9]+\.[0-9]+)';
private const DOCUMENTATION_RELEASE_PATTERN = 'release\s*=\s*([0-9]+\.[0-9]+\.[0-9]+)';

protected function configure(): void
Expand Down Expand Up @@ -82,11 +82,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$documentationSettingsFile = rtrim($path, '/') . '/Documentation/Settings.cfg';
if (!file_exists($documentationSettingsFile)) {
$io->warning(
sprintf(
'Documentation version update is enabled but was not performed because the file %s does not exist.',
$documentationSettingsFile
)
$io->info(
'Documentation version update is enabled but was not performed because the file '
. $documentationSettingsFile . ' does not exist. To disable this operation use the \'--no-docs\' '
. 'option or set the \'TYPO3_DISABLE_DOCS_VERSION_UPDATE\' environment variable.'
);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Filesystem/VersionReplacerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function replaceVersionReplacesProperVersionOfDocumentationConfiguration(
$tempFile = tempnam('/tmp/', 'tailor_settings.cfg');
file_put_contents($tempFile, $docSettings);
$subject = new VersionReplacer('6.9.0');
$subject->setVersion($tempFile, 'version\s*=\s*([0-9.]+)', 2);
$subject->setVersion($tempFile, 'version\s*=\s*([0-9]+\.[0-9]+)', 2);
$contents = file_get_contents($tempFile);
self::assertStringContainsString('version=6.9', preg_replace('/\s+/', '', $contents));
unlink($tempFile);
Expand Down

0 comments on commit 4a35cd6

Please sign in to comment.