Skip to content

Commit 6bbcaa0

Browse files
authored
Make the name more explicit (#146)
1 parent 93f5b47 commit 6bbcaa0

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

e2e/scenario11/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Installing dependencies from lock file (including require-dev)
77
Package operations: 1 install, 0 updates, 0 removals
88
- Installing bamarni/composer-bin-plugin (dev-hash): Symlinking from ../..
99
Generating autoload files
10-
[bamarni-bin] The setting "bamarni-bin.bin-links" will be set to "false" from 2.x onwards. If you wish to keep it to "true", you need to set it explicitly.
10+
[bamarni-bin] The setting "extra.bamarni-bin.bin-links" will be set to "false" from 2.x onwards. If you wish to keep it to "true", you need to set it explicitly.
1111
[bamarni-bin] The command is being forwarded.
1212
[bamarni-bin] Checking namespace vendor-bin/ns1
1313
Loading composer repositories with package information

src/Config/Config.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct(array $extra)
7272
if (!is_bool($binLinks)) {
7373
throw new InvalidBamarniComposerExtraConfig(
7474
sprintf(
75-
'Expected setting "%s.%s" to be a boolean value. Got "%s".',
75+
'Expected setting "extra.%s.%s" to be a boolean value. Got "%s".',
7676
self::EXTRA_CONFIG_KEY,
7777
self::BIN_LINKS_ENABLED,
7878
$getType($binLinks)
@@ -84,7 +84,7 @@ public function __construct(array $extra)
8484

8585
if ($binLinks && !$binLinksSetExplicitly) {
8686
$this->deprecations[] = sprintf(
87-
'The setting "%s.%s" will be set to "false" from 2.x onwards. If you wish to keep it to "true", you need to set it explicitly.',
87+
'The setting "extra.%s.%s" will be set to "false" from 2.x onwards. If you wish to keep it to "true", you need to set it explicitly.',
8888
self::EXTRA_CONFIG_KEY,
8989
self::BIN_LINKS_ENABLED
9090
);
@@ -95,7 +95,7 @@ public function __construct(array $extra)
9595
if (!is_string($targetDirectory)) {
9696
throw new InvalidBamarniComposerExtraConfig(
9797
sprintf(
98-
'Expected setting "%s.%s" to be a string. Got "%s".',
98+
'Expected setting "extra.%s.%s" to be a string. Got "%s".',
9999
self::EXTRA_CONFIG_KEY,
100100
self::TARGET_DIRECTORY,
101101
$getType($targetDirectory)
@@ -108,7 +108,7 @@ public function __construct(array $extra)
108108
if (!is_bool($forwardCommand)) {
109109
throw new InvalidBamarniComposerExtraConfig(
110110
sprintf(
111-
'Expected setting "%s.%s" to be a boolean value. Got "%s".',
111+
'Expected setting "extra.%s.%s" to be a boolean value. Got "%s".',
112112
self::EXTRA_CONFIG_KEY,
113113
self::FORWARD_COMMAND,
114114
gettype($forwardCommand)
@@ -120,7 +120,7 @@ public function __construct(array $extra)
120120

121121
if (!$forwardCommand && !$forwardCommandSetExplicitly) {
122122
$this->deprecations[] = sprintf(
123-
'The setting "%s.%s" will be set to "true" from 2.x onwards. If you wish to keep it to "false", you need to set it explicitly.',
123+
'The setting "extra.%s.%s" will be set to "true" from 2.x onwards. If you wish to keep it to "false", you need to set it explicitly.',
124124
self::EXTRA_CONFIG_KEY,
125125
self::FORWARD_COMMAND
126126
);

tests/Config/ConfigTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public function test_it_can_be_instantiated(
3636

3737
public static function provideExtraConfig(): iterable
3838
{
39-
$binLinksEnabledDeprecationMessage = 'The setting "bamarni-bin.bin-links" will be set to "false" from 2.x onwards. If you wish to keep it to "true", you need to set it explicitly.';
40-
$forwardCommandDeprecationMessage = 'The setting "bamarni-bin.forward-command" will be set to "true" from 2.x onwards. If you wish to keep it to "false", you need to set it explicitly.';
39+
$binLinksEnabledDeprecationMessage = 'The setting "extra.bamarni-bin.bin-links" will be set to "false" from 2.x onwards. If you wish to keep it to "true", you need to set it explicitly.';
40+
$forwardCommandDeprecationMessage = 'The setting "extra.bamarni-bin.forward-command" will be set to "true" from 2.x onwards. If you wish to keep it to "false", you need to set it explicitly.';
4141

4242
yield 'default values' => [
4343
[],
@@ -110,7 +110,7 @@ public static function provideInvalidExtraConfig(): iterable
110110
Config::BIN_LINKS_ENABLED => 'foo',
111111
],
112112
],
113-
'Expected setting "bamarni-bin.bin-links" to be a boolean value. Got "string".',
113+
'Expected setting "extra.bamarni-bin.bin-links" to be a boolean value. Got "string".',
114114
];
115115

116116
yield 'non string target directory' => [
@@ -120,8 +120,8 @@ public static function provideInvalidExtraConfig(): iterable
120120
],
121121
],
122122
function_exists('get_debug_type')
123-
? 'Expected setting "bamarni-bin.target-directory" to be a string. Got "bool".'
124-
: 'Expected setting "bamarni-bin.target-directory" to be a string. Got "boolean".',
123+
? 'Expected setting "extra.bamarni-bin.target-directory" to be a string. Got "bool".'
124+
: 'Expected setting "extra.bamarni-bin.target-directory" to be a string. Got "boolean".',
125125
];
126126

127127
yield 'non bool forward command' => [
@@ -130,7 +130,7 @@ function_exists('get_debug_type')
130130
Config::FORWARD_COMMAND => 'foo',
131131
],
132132
],
133-
'Expected setting "bamarni-bin.forward-command" to be a boolean value. Got "string".',
133+
'Expected setting "extra.bamarni-bin.forward-command" to be a boolean value. Got "string".',
134134
];
135135
}
136136
}

0 commit comments

Comments
 (0)