File tree 7 files changed +81
-5
lines changed
7 files changed +81
-5
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,9 @@ jobs:
285
285
- name : " Require composer/composer"
286
286
run : " composer require composer/composer:1.9.1 --no-interaction --no-progress --no-suggest"
287
287
288
+ - name : " Remove git placeholder configuration with jq"
289
+ run : " echo $(cat box.json | jq 'del(.git)') > box.json"
290
+
288
291
- name : " Validate configuration for humbug/box"
289
292
run : " phar/box.phar validate box.json"
290
293
Original file line number Diff line number Diff line change 8
8
"files" : [
9
9
" resource/schema.json"
10
10
],
11
+ "git" : " git" ,
11
12
"main" : " phar/composer-normalize.php" ,
12
13
"output" : " .build/phar/composer-normalize.phar"
13
14
}
Original file line number Diff line number Diff line change 17
17
" void" ,
18
18
" Composer\\ Command\\ BaseCommand" ,
19
19
" Composer\\ Composer" ,
20
+ " Composer\\ Console\\ Application" ,
20
21
" Composer\\ Factory" ,
21
22
" Composer\\ IO\\ IOInterface" ,
22
23
" Composer\\ Json\\ JsonFile" ,
Original file line number Diff line number Diff line change 11
11
* @see https://github.com/ergebnis/composer-normalize
12
12
*/
13
13
14
- use Composer \Console \ Application ;
15
- use Ergebnis \Composer \Json \ Normalizer \ ComposerJsonNormalizer ;
14
+ use Composer \Factory ;
15
+ use Ergebnis \Composer \Json ;
16
16
use Ergebnis \Composer \Normalize ;
17
17
use Ergebnis \Json \Normalizer ;
18
18
use Ergebnis \Json \Printer ;
21
21
require_once __DIR__ . '/../vendor/autoload.php ' ;
22
22
23
23
$ command = new Normalize \Command \NormalizeCommand (
24
- new Composer \ Factory (),
25
- new ComposerJsonNormalizer (__DIR__ . '/../resource/schema.json ' ),
24
+ new Factory (),
25
+ new Json \ Normalizer \ ComposerJsonNormalizer (__DIR__ . '/../resource/schema.json ' ),
26
26
new Normalizer \Format \Formatter (new Printer \Printer ()),
27
27
new Diff \Differ (new Diff \Output \StrictUnifiedDiffOutputBuilder ([
28
28
'fromFile ' => 'original ' ,
29
29
'toFile ' => 'normalized ' ,
30
30
]))
31
31
);
32
32
33
- $ application = new Application ();
33
+ $ application = new Normalize \ Application ();
34
34
35
35
$ application ->add ($ command );
36
36
$ application ->setDefaultCommand ($ command ->getName ());
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ parameters:
5
5
ergebnis :
6
6
classesAllowedToBeExtended :
7
7
- Composer\Command\BaseCommand
8
+ - Composer\Console\Application
8
9
- LogicException
9
10
inferPrivatePropertyTypeFromConstructor : true
10
11
level : max
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ /**
6
+ * Copyright (c) 2018 Andreas Möller
7
+ *
8
+ * For the full copyright and license information, please view
9
+ * the LICENSE file that was distributed with this source code.
10
+ *
11
+ * @see https://github.com/ergebnis/composer-normalize
12
+ */
13
+
14
+ namespace Ergebnis \Composer \Normalize ;
15
+
16
+ use Composer \Console ;
17
+
18
+ /**
19
+ * @internal
20
+ */
21
+ final class Application extends Console \Application
22
+ {
23
+ public function getLongVersion (): string
24
+ {
25
+ return \sprintf (
26
+ '%s <info>%s</info> with ergebnis/composer-normalize <info>@git@</info> ' ,
27
+ $ this ->getName (),
28
+ $ this ->getVersion ()
29
+ );
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ /**
6
+ * Copyright (c) 2018 Andreas Möller
7
+ *
8
+ * For the full copyright and license information, please view
9
+ * the LICENSE file that was distributed with this source code.
10
+ *
11
+ * @see https://github.com/ergebnis/composer-normalize
12
+ */
13
+
14
+ namespace Ergebnis \Composer \Normalize \Test \Unit ;
15
+
16
+ use Ergebnis \Composer \Normalize \Application ;
17
+ use PHPUnit \Framework ;
18
+
19
+ /**
20
+ * @internal
21
+ *
22
+ * @covers \Ergebnis\Composer\Normalize\Application
23
+ */
24
+ final class ApplicationTest extends Framework \TestCase
25
+ {
26
+ public function testGetLongVersionReturnsVersion (): void
27
+ {
28
+ $ composerApplication = new \Composer \Console \Application ();
29
+ $ application = new Application ();
30
+
31
+ $ expected = \sprintf (
32
+ '%s <info>%s</info> with ergebnis/composer-normalize <info>@git@</info> ' ,
33
+ $ composerApplication ->getName (),
34
+ $ composerApplication ->getVersion ()
35
+ );
36
+
37
+ self ::assertSame ($ expected , $ application ->getLongVersion ());
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments