Skip to content

Commit

Permalink
Revert "feat: Mark all declarations as internal (#882)" (#928)
Browse files Browse the repository at this point in the history
This reverts commit 7dbccc0.
  • Loading branch information
theofidry committed Dec 7, 2023
1 parent 2f4a55b commit dc2120a
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 378 deletions.
223 changes: 0 additions & 223 deletions specs/misc/internal-declarations.php

This file was deleted.

12 changes: 1 addition & 11 deletions src/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ final class Configuration
* @param array<string, array{string, string}> $excludedFilesWithContents Array of tuple
* with the first argument being the file path and
* the second its contents
* @param bool $tagDeclarationsAsInternal Whether a @internal tag should be added to the symbols declarations.
*/
public function __construct(
private ?string $path,
Expand All @@ -47,8 +46,7 @@ public function __construct(
private array $filesWithContents,
private array $excludedFilesWithContents,
private Patcher $patcher,
private SymbolsConfiguration $symbolsConfiguration,
private bool $tagDeclarationsAsInternal,
private SymbolsConfiguration $symbolsConfiguration
) {
self::validatePrefix($prefix);

Expand Down Expand Up @@ -84,7 +82,6 @@ public function withPrefix(string $prefix): self
$this->excludedFilesWithContents,
$this->patcher,
$this->symbolsConfiguration,
$this->tagDeclarationsAsInternal,
);
}

Expand All @@ -109,7 +106,6 @@ public function withFilesWithContents(array $filesWithContents): self
$this->excludedFilesWithContents,
$this->patcher,
$this->symbolsConfiguration,
$this->tagDeclarationsAsInternal,
);
}

Expand Down Expand Up @@ -139,7 +135,6 @@ public function withPatcher(Patcher $patcher): self
$this->excludedFilesWithContents,
$patcher,
$this->symbolsConfiguration,
$this->tagDeclarationsAsInternal,
);
}

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

public function shouldTagDeclarationsAsInternal(): bool
{
return $this->tagDeclarationsAsInternal;
}

private static function validatePrefix(string $prefix): void
{
if (1 !== preg_match(self::PREFIX_PATTERN, $prefix)) {
Expand Down
2 changes: 0 additions & 2 deletions src/Configuration/ConfigurationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public function create(?string $path = null, array $paths = []): Configuration
$finders = self::retrieveFinders($config);
$filesFromPaths = self::retrieveFilesFromPaths($paths);
$filesWithContents = self::retrieveFilesWithContents(chain($filesFromPaths, ...$finders));
$tagDeclarationsAsInternal = $config[ConfigurationKeys::TAG_DECLARATIONS_AS_INTERNAL] ?? true;

return new Configuration(
$path,
Expand All @@ -106,7 +105,6 @@ public function create(?string $path = null, array $paths = []): Configuration
self::retrieveFilesWithContents($excludedFiles),
new PatcherChain($patchers),
$symbolsConfiguration,
$tagDeclarationsAsInternal,
);
}

Expand Down
2 changes: 0 additions & 2 deletions src/Configuration/ConfigurationKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ final class ConfigurationKeys
public const EXCLUDED_FILES_KEYWORD = 'exclude-files';
public const FINDER_KEYWORD = 'finders';
public const PATCHERS_KEYWORD = 'patchers';
public const TAG_DECLARATIONS_AS_INTERNAL = 'tag-declarations-as-internal';

public const EXPOSE_GLOBAL_CONSTANTS_KEYWORD = 'expose-global-constants';
public const EXPOSE_GLOBAL_CLASSES_KEYWORD = 'expose-global-classes';
Expand All @@ -47,7 +46,6 @@ final class ConfigurationKeys
self::EXCLUDED_FILES_KEYWORD,
self::FINDER_KEYWORD,
self::PATCHERS_KEYWORD,
self::TAG_DECLARATIONS_AS_INTERNAL,
self::EXPOSE_GLOBAL_CONSTANTS_KEYWORD,
self::EXPOSE_GLOBAL_CLASSES_KEYWORD,
self::EXPOSE_GLOBAL_FUNCTIONS_KEYWORD,
Expand Down

0 comments on commit dc2120a

Please sign in to comment.