Skip to content

Commit 812b8fe

Browse files
committed
Revert "feat: Mark all declarations as internal (humbug#882)"
This reverts commit 7dbccc0.
1 parent 2f4a55b commit 812b8fe

14 files changed

+7
-378
lines changed

specs/misc/internal-declarations.php

-223
This file was deleted.

src/Configuration/Configuration.php

+1-11
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ final class Configuration
3838
* @param array<string, array{string, string}> $excludedFilesWithContents Array of tuple
3939
* with the first argument being the file path and
4040
* the second its contents
41-
* @param bool $tagDeclarationsAsInternal Whether a @internal tag should be added to the symbols declarations.
4241
*/
4342
public function __construct(
4443
private ?string $path,
@@ -47,8 +46,7 @@ public function __construct(
4746
private array $filesWithContents,
4847
private array $excludedFilesWithContents,
4948
private Patcher $patcher,
50-
private SymbolsConfiguration $symbolsConfiguration,
51-
private bool $tagDeclarationsAsInternal,
49+
private SymbolsConfiguration $symbolsConfiguration
5250
) {
5351
self::validatePrefix($prefix);
5452

@@ -84,7 +82,6 @@ public function withPrefix(string $prefix): self
8482
$this->excludedFilesWithContents,
8583
$this->patcher,
8684
$this->symbolsConfiguration,
87-
$this->tagDeclarationsAsInternal,
8885
);
8986
}
9087

@@ -109,7 +106,6 @@ public function withFilesWithContents(array $filesWithContents): self
109106
$this->excludedFilesWithContents,
110107
$this->patcher,
111108
$this->symbolsConfiguration,
112-
$this->tagDeclarationsAsInternal,
113109
);
114110
}
115111

@@ -139,7 +135,6 @@ public function withPatcher(Patcher $patcher): self
139135
$this->excludedFilesWithContents,
140136
$patcher,
141137
$this->symbolsConfiguration,
142-
$this->tagDeclarationsAsInternal,
143138
);
144139
}
145140

@@ -153,11 +148,6 @@ public function getSymbolsConfiguration(): SymbolsConfiguration
153148
return $this->symbolsConfiguration;
154149
}
155150

156-
public function shouldTagDeclarationsAsInternal(): bool
157-
{
158-
return $this->tagDeclarationsAsInternal;
159-
}
160-
161151
private static function validatePrefix(string $prefix): void
162152
{
163153
if (1 !== preg_match(self::PREFIX_PATTERN, $prefix)) {

src/Configuration/ConfigurationFactory.php

-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public function create(?string $path = null, array $paths = []): Configuration
9696
$finders = self::retrieveFinders($config);
9797
$filesFromPaths = self::retrieveFilesFromPaths($paths);
9898
$filesWithContents = self::retrieveFilesWithContents(chain($filesFromPaths, ...$finders));
99-
$tagDeclarationsAsInternal = $config[ConfigurationKeys::TAG_DECLARATIONS_AS_INTERNAL] ?? true;
10099

101100
return new Configuration(
102101
$path,
@@ -106,7 +105,6 @@ public function create(?string $path = null, array $paths = []): Configuration
106105
self::retrieveFilesWithContents($excludedFiles),
107106
new PatcherChain($patchers),
108107
$symbolsConfiguration,
109-
$tagDeclarationsAsInternal,
110108
);
111109
}
112110

src/Configuration/ConfigurationKeys.php

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ final class ConfigurationKeys
2525
public const EXCLUDED_FILES_KEYWORD = 'exclude-files';
2626
public const FINDER_KEYWORD = 'finders';
2727
public const PATCHERS_KEYWORD = 'patchers';
28-
public const TAG_DECLARATIONS_AS_INTERNAL = 'tag-declarations-as-internal';
2928

3029
public const EXPOSE_GLOBAL_CONSTANTS_KEYWORD = 'expose-global-constants';
3130
public const EXPOSE_GLOBAL_CLASSES_KEYWORD = 'expose-global-classes';
@@ -47,7 +46,6 @@ final class ConfigurationKeys
4746
self::EXCLUDED_FILES_KEYWORD,
4847
self::FINDER_KEYWORD,
4948
self::PATCHERS_KEYWORD,
50-
self::TAG_DECLARATIONS_AS_INTERNAL,
5149
self::EXPOSE_GLOBAL_CONSTANTS_KEYWORD,
5250
self::EXPOSE_GLOBAL_CLASSES_KEYWORD,
5351
self::EXPOSE_GLOBAL_FUNCTIONS_KEYWORD,

0 commit comments

Comments
 (0)