Skip to content

Commit 72cffd4

Browse files
robot: pint (#24)
Automated commit by the `Format` workflow. Co-authored-by: tastendruck[bot] <191388063+tastendruck[bot]@users.noreply.github.com>
1 parent 3ef64ca commit 72cffd4

File tree

5 files changed

+25
-24
lines changed

5 files changed

+25
-24
lines changed

bin/composer-semver

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ declare(strict_types=1);
55

66
namespace TypistTech\ComposerSemVer;
77

8-
use function in_array;
9-
108
use const PHP_EOL;
119
use const PHP_SAPI;
1210

11+
use function in_array;
12+
1313
// Taken from https://box-project.github.io/box/faq/#what-is-the-canonical-way-to-write-a-cli-entry-file
14-
if (!in_array(PHP_SAPI, ['micro', 'cli', 'phpdbg', 'embed'], true)) {
15-
echo PHP_EOL . 'This app may only be invoked from a command line, got "' . PHP_SAPI . '"' . PHP_EOL;
14+
if (! in_array(PHP_SAPI, ['micro', 'cli', 'phpdbg', 'embed'], true)) {
15+
echo PHP_EOL.'This app may only be invoked from a command line, got "'.PHP_SAPI.'"'.PHP_EOL;
1616
exit(1);
1717
}
1818

19-
include $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
19+
include $_composer_autoload_path ?? __DIR__.'/../vendor/autoload.php';
2020

2121
Runner::run();

src/Application.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Application extends SymfonyConsoleApplication
2727
public function getLongVersion(): string
2828
{
2929
$longVersion = self::BANNER;
30-
$longVersion .= PHP_EOL . PHP_EOL;
30+
$longVersion .= PHP_EOL.PHP_EOL;
3131

3232
$app = sprintf(
3333
'%-15s <info>%s</info> %s',
@@ -50,43 +50,43 @@ public function getLongVersion(): string
5050
$matches['hash'],
5151
);
5252
}
53-
$longVersion .= PHP_EOL . $githubUrl;
53+
$longVersion .= PHP_EOL.$githubUrl;
5454

55-
$longVersion .= PHP_EOL . PHP_EOL . '<comment>Built with:</>';
55+
$longVersion .= PHP_EOL.PHP_EOL.'<comment>Built with:</>';
5656

5757
$semVerVersion = InstalledVersions::getPrettyVersion('composer/semver');
5858
$semVer = sprintf(
5959
'%1$-15s %2$s',
6060
'composer/semver',
6161
$semVerVersion,
6262
);
63-
$longVersion .= PHP_EOL . $semVer;
63+
$longVersion .= PHP_EOL.$semVer;
6464

6565
$semVerReleaseUrl = sprintf(
6666
'<href=https://github.com/composer/semver/releases/tag/%1$s>https://github.com/composer/semver/releases/tag/%1$s</>',
6767
$semVerVersion,
6868
);
69-
$longVersion .= PHP_EOL . $semVerReleaseUrl;
69+
$longVersion .= PHP_EOL.$semVerReleaseUrl;
7070

71-
$longVersion .= PHP_EOL . PHP_EOL . '<comment>PHP:</>';
71+
$longVersion .= PHP_EOL.PHP_EOL.'<comment>PHP:</>';
7272

7373
$phpVersion = sprintf(
7474
'%-15s %s',
7575
'Version',
7676
PHP_VERSION,
7777
);
78-
$longVersion .= PHP_EOL . $phpVersion;
78+
$longVersion .= PHP_EOL.$phpVersion;
7979

8080
$phpSapi = sprintf(
8181
'%-15s %s',
8282
'SAPI',
8383
PHP_SAPI,
8484
);
85-
$longVersion .= PHP_EOL . $phpSapi;
85+
$longVersion .= PHP_EOL.$phpSapi;
8686

87-
$longVersion .= PHP_EOL . PHP_EOL . '<comment>Support Composer SemVer:</>';
87+
$longVersion .= PHP_EOL.PHP_EOL.'<comment>Support Composer SemVer:</>';
8888

89-
$supportBlock = (new FormatterHelper())
89+
$supportBlock = (new FormatterHelper)
9090
->formatBlock(
9191
[
9292
'If you find this tool useful, please consider supporting its development.',
@@ -96,18 +96,18 @@ public function getLongVersion(): string
9696
'question',
9797
true,
9898
);
99-
$longVersion .= PHP_EOL . $supportBlock;
99+
$longVersion .= PHP_EOL.$supportBlock;
100100

101101
$sponsorUrl = sprintf(
102102
'%1$-15s <href=%2$s>%2$s</>',
103103
'GitHub Sponsor',
104104
'https://github.com/sponsors/tangrufus',
105105
);
106-
$longVersion .= PHP_EOL . PHP_EOL . $sponsorUrl;
106+
$longVersion .= PHP_EOL.PHP_EOL.$sponsorUrl;
107107

108-
$longVersion .= PHP_EOL . PHP_EOL . '<comment>Hire Tang Rufus:</>';
108+
$longVersion .= PHP_EOL.PHP_EOL.'<comment>Hire Tang Rufus:</>';
109109

110-
$hireBlock = (new FormatterHelper())
110+
$hireBlock = (new FormatterHelper)
111111
->formatBlock(
112112
[
113113
'I am looking for my next role, freelance or full-time.',
@@ -117,14 +117,14 @@ public function getLongVersion(): string
117117
'error',
118118
true,
119119
);
120-
$longVersion .= PHP_EOL . $hireBlock;
120+
$longVersion .= PHP_EOL.$hireBlock;
121121

122122
$sponsorUrl = sprintf(
123123
'%1$-15s <href=%2$s>%2$s</>',
124124
'Contact',
125125
'https://typist.tech/contact/',
126126
);
127-
$longVersion .= PHP_EOL . PHP_EOL . $sponsorUrl;
127+
$longVersion .= PHP_EOL.PHP_EOL.$sponsorUrl;
128128

129129
return $longVersion;
130130
}

src/NormalizeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class NormalizeCommand extends Command
2020
{
2121
public function __construct(
22-
public readonly VersionParser $parser = new VersionParser(),
22+
public readonly VersionParser $parser = new VersionParser,
2323
) {
2424
parent::__construct();
2525
}

src/ParseCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class ParseCommand extends Command
1919
{
2020
public function __construct(
21-
public readonly VersionParser $parser = new VersionParser(),
21+
public readonly VersionParser $parser = new VersionParser,
2222
) {
2323
parent::__construct();
2424
}

src/Runner.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
class Runner
1010
{
1111
private const string NAME = 'Composer SemVer';
12+
1213
private const string GIT_TAG = '@git-tag@';
1314

1415
public static function run(): int
1516
{
1617
$app = new Application(self::NAME, self::GIT_TAG);
1718

18-
$parser = new VersionParser();
19+
$parser = new VersionParser;
1920

2021
$app->addCommands([
2122
new NormalizeCommand($parser),

0 commit comments

Comments
 (0)