Skip to content

Commit 2eaf322

Browse files
authored
Update ads formatting and wording; Readme: Fix typos & Mention composer-semver --version (#8)
* Update ads formatting and wording * `Readme`: Fix typos * `Readme`: Mention `composer-semver --version`
1 parent ecc1827 commit 2eaf322

File tree

2 files changed

+34
-19
lines changed

2 files changed

+34
-19
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ $ composer-semver parse '~>1.2'
9090
$ echo $?
9191
1
9292

93-
$ bin/composer-semver parse --help
93+
$ composer-semver parse --help
9494
Description:
9595
Parses a constraint string and strip its ignorable parts.
9696
This is a wrapper of the Composer\Semver\VersionParser::parseConstraints() method.
@@ -111,13 +111,20 @@ Options:
111111
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
112112
```
113113

114+
### Print Bundled PHP and `composer/semver` Versions
115+
116+
```console
117+
$ composer-semver --version
118+
```
119+
114120
---
115121

116122
> [!TIP]
117123
> **Hire Tang Rufus!**
118124
>
119125
> I am looking for my next role, freelance or full-time.
120-
> If you find this tool useful, I can build you more weird PHP / Ruby / Go stuffs like this.
126+
> If you find this tool useful, I can build you more weird stuffs like this.
127+
> Let's talk if you are hiring PHP / Ruby / Go developers.
121128
>
122129
> Contact me at https://typist.tech/contact/
123130
@@ -166,7 +173,7 @@ so you can work with the package versions exactly like Composer does without ins
166173
> Let me handle them for you.
167174
> I am seeking my next job, freelance or full-time.
168175
>
169-
> If you are looking for a PHP / Ruby / Go developer,
176+
> If you are hiring PHP / Ruby / Go developers,
170177
> contact me at https://typist.tech/contact/
171178
172179
## Installation
@@ -175,7 +182,7 @@ so you can work with the package versions exactly like Composer does without ins
175182

176183
```sh
177184
brew tap typisttech/tap
178-
brew install typisttech/composer-semver
185+
brew install typisttech/tap/composer-semver
179186
```
180187

181188
### `apt-get` (Debian based distributions, for example: Ubuntu)

src/Application.php

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Composer\InstalledVersions;
88
use Symfony\Component\Console\Application as SymfonyConsoleApplication;
9+
use Symfony\Component\Console\Helper\FormatterHelper;
910

1011
class Application extends SymfonyConsoleApplication
1112
{
@@ -76,8 +77,6 @@ public function getLongVersion(): string
7677
);
7778
$longVersion .= PHP_EOL . $phpVersion;
7879

79-
// TODO: Print PHP_BUILD_DATE for PHP >=8.5.
80-
8180
$phpSapi = sprintf(
8281
'%-15s %s',
8382
'SAPI',
@@ -87,11 +86,17 @@ public function getLongVersion(): string
8786

8887
$longVersion .= PHP_EOL . PHP_EOL . '<comment>Support Composer SemVer:</>';
8988

90-
$longVersion .= PHP_EOL . <<<'SUPPORT'
91-
If you find this tool useful, please consider supporting its development.
92-
Every contribution counts, regardless how big or small.
93-
I, <href=https://typist.tech/>Tang Rufus</>, am eternally grateful to all sponsors who fund my open source journey.
94-
SUPPORT;
89+
$supportBlock = (new FormatterHelper())
90+
->formatBlock(
91+
[
92+
'If you find this tool useful, please consider supporting its development.',
93+
'Every contribution counts, regardless how big or small.',
94+
'I am eternally grateful to all sponsors who fund my open source journey.',
95+
],
96+
'question',
97+
true,
98+
);
99+
$longVersion .= PHP_EOL . $supportBlock;
95100

96101
$sponsorUrl = sprintf(
97102
'%1$-15s <href=%2$s>%2$s</>',
@@ -102,11 +107,17 @@ public function getLongVersion(): string
102107

103108
$longVersion .= PHP_EOL . PHP_EOL . '<comment>Hire Tang Rufus:</>';
104109

105-
$longVersion .= <<<'HIRE'
106-
<fg=black;bg=yellow;options=bold>
107-
I am looking for my next role!
108-
If you are looking for a backend developer to build weird PHP / Ruby / Go stuffs like this, please get in touch.</>
109-
HIRE;
110+
$hireBlock = (new FormatterHelper())
111+
->formatBlock(
112+
[
113+
'I am looking for my next role, freelance or full-time.',
114+
'If you find this tool useful, I can build you more weird stuffs like this.',
115+
"Let's talk if you are hiring PHP / Ruby / Go developers.",
116+
],
117+
'error',
118+
true,
119+
);
120+
$longVersion .= PHP_EOL . $hireBlock;
110121

111122
$sponsorUrl = sprintf(
112123
'%1$-15s <href=%2$s>%2$s</>',
@@ -115,9 +126,6 @@ public function getLongVersion(): string
115126
);
116127
$longVersion .= PHP_EOL . PHP_EOL . $sponsorUrl;
117128

118-
119-
$longVersion .= PHP_EOL;
120-
121129
return $longVersion;
122130
}
123131
}

0 commit comments

Comments
 (0)