|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
declare(strict_types=1); |
|
5
|
|
|
|
|
6
|
|
|
/* |
|
7
|
|
|
* This file is part of the composer-link plugin. |
|
8
|
|
|
* |
|
9
|
|
|
* Copyright (c) 2021-2022 Sander Visser <[email protected]>. |
|
10
|
|
|
* |
|
11
|
|
|
* For the full copyright and license information, please view the LICENSE.md |
|
12
|
|
|
* file that was distributed with this source code. |
|
13
|
|
|
* |
|
14
|
|
|
* @link https://github.com/SanderSander/composer-link |
|
15
|
|
|
*/ |
|
16
|
|
|
|
|
17
|
|
|
namespace ComposerLink\Config; |
|
18
|
|
|
|
|
19
|
|
|
use Composer\Config\ConfigSourceInterface; |
|
20
|
|
|
|
|
21
|
|
|
class MemoryConfigSource implements ConfigSourceInterface |
|
22
|
|
|
{ |
|
23
|
|
|
public function addRepository(string $name, $config, bool $append = true): void |
|
24
|
|
|
{ |
|
25
|
|
|
// TODO: Implement addRepository() method. |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
public function removeRepository(string $name): void |
|
29
|
|
|
{ |
|
30
|
|
|
// TODO: Implement removeRepository() method. |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public function addConfigSetting(string $name, $value): void |
|
34
|
|
|
{ |
|
35
|
|
|
// TODO: Implement addConfigSetting() method. |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
public function removeConfigSetting(string $name): void |
|
39
|
|
|
{ |
|
40
|
|
|
// TODO: Implement removeConfigSetting() method. |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
public function addProperty(string $name, $value): void |
|
44
|
|
|
{ |
|
45
|
|
|
// TODO: Implement addProperty() method. |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function removeProperty(string $name): void |
|
49
|
|
|
{ |
|
50
|
|
|
// TODO: Implement removeProperty() method. |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function addLink(string $type, string $name, string $value): void |
|
54
|
|
|
{ |
|
55
|
|
|
// TODO: Implement addLink() method. |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function removeLink(string $type, string $name): void |
|
59
|
|
|
{ |
|
60
|
|
|
// TODO: Implement removeLink() method. |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function getName(): string |
|
64
|
|
|
{ |
|
65
|
|
|
// TODO: Implement getName() method. |
|
66
|
|
|
} |
|
|
|
|
|
|
67
|
|
|
} |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: