diff --git a/Makefile b/Makefile index 8cb48f0..5c2e22a 100644 --- a/Makefile +++ b/Makefile @@ -58,27 +58,27 @@ GENERATE=./generator/generate .PHONY=generate generate: \ - lib/Currency.php \ - lib/LocaleId.php \ - lib/Locale/HasContextTransforms.php \ - lib/TerritoryCode.php \ - lib/Units/SequenceCompanion.php \ - lib/Units/UnitsCompanion.php - -lib/Currency.php: generator/src/Command/GenerateCurrency.php + src/Currency.php \ + src/LocaleId.php \ + src/Locale/HasContextTransforms.php \ + src/TerritoryCode.php \ + src/Units/SequenceCompanion.php \ + src/Units/UnitsCompanion.php + +src/Currency.php: generator/src/Command/GenerateCurrency.php $(GENERATE) $@ -lib/LocaleId.php: generator/src/Command/GenerateLocaleId.php +src/LocaleId.php: generator/src/Command/GenerateLocaleId.php $(GENERATE) $@ -lib/Locale/HasContextTransforms.php: generator/src/Command/GenerateHasContextTransforms.php +src/Locale/HasContextTransforms.php: generator/src/Command/GenerateHasContextTransforms.php $(GENERATE) $@ -lib/Units/SequenceCompanion.php: generator/src/Command/GenerateSequenceCompanion.php +src/Units/SequenceCompanion.php: generator/src/Command/GenerateSequenceCompanion.php $(GENERATE) $@ -lib/TerritoryCode.php: generator/src/Command/GenerateTerritoryCode.php +src/TerritoryCode.php: generator/src/Command/GenerateTerritoryCode.php $(GENERATE) $@ -lib/Units/UnitsCompanion.php: generator/src/Command/GenerateUnitsCompanion.php +src/Units/UnitsCompanion.php: generator/src/Command/GenerateUnitsCompanion.php $(GENERATE) $@ diff --git a/README.md b/README.md index 6c43497..4b7fe91 100644 --- a/README.md +++ b/README.md @@ -253,11 +253,11 @@ See [CONTRIBUTING](CONTRIBUTING.md) for details. [ICanBoogie]: https://icanboogie.org/ -[FileCache]: lib/Cache/FileCache.php -[Provider]: lib/Provider.php -[WebProvider]: lib/Provider/WebProvider.php -[FailingProvider]: lib/Provider/FailingProvider.php -[Repository]: lib/Repository.php +[FileCache]: src/Cache/FileCache.php +[Provider]: src/Provider.php +[WebProvider]: src/Provider/WebProvider.php +[FailingProvider]: src/Provider/FailingProvider.php +[Repository]: src/Repository.php [2]: https://github.com/unicode-cldr [the cldr command]: https://github.com/ICanBoogie/CLDR-CLI diff --git a/composer.json b/composer.json index eebb5bc..3b04f38 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ }, "autoload": { "psr-4": { - "ICanBoogie\\CLDR\\": "lib" + "ICanBoogie\\CLDR\\": "src" } }, "autoload-dev": { diff --git a/docs/Core.md b/docs/Core.md index 6066746..c96a25c 100644 --- a/docs/Core.md +++ b/docs/Core.md @@ -125,7 +125,7 @@ echo $repository->locale_fr('fr')->context_transform( // Juin ``` -[Currency]: ../lib/Currency.php -[Locale]: ../lib/Locale.php -[Localizable]: ../lib/Localizable.php -[Territory]: ../lib/Territory.php +[Currency]: ../src/Currency.php +[Locale]: ../src/Locale.php +[Localizable]: ../src/Localizable.php +[Territory]: ../src/Territory.php diff --git a/docs/Dates.md b/docs/Dates.md index 326a809..c298fb6 100644 --- a/docs/Dates.md +++ b/docs/Dates.md @@ -275,7 +275,7 @@ echo $ldt->as_short; // 04/11/2013 20:21 -[Calendar]: ../lib/Calendar.php -[DateTimeFormatter]: ../lib/DateTimeFormatter.php -[LocalizedDateTime]: ../lib/LocalizedDateTime.php -[TimeFormatter]: ../lib/TimeFormatter.php +[Calendar]: ../src/Calendar.php +[DateTimeFormatter]: ../src/DateTimeFormatter.php +[LocalizedDateTime]: ../src/LocalizedDateTime.php +[TimeFormatter]: ../src/TimeFormatter.php diff --git a/docs/Numbers.md b/docs/Numbers.md index e387f24..86dc100 100644 --- a/docs/Numbers.md +++ b/docs/Numbers.md @@ -235,6 +235,6 @@ $cldr->plurals->rule_for(2, 'ar'); // two -[Locale]: ../lib/Locale.php -[LocalizedNumberFormatter]: ../lib/LocalizedNumberFormatter.php -[NumberFormatter]: ../lib/NumberFormatter.php +[Locale]: ../src/Locale.php +[LocalizedNumberFormatter]: ../src/LocalizedNumberFormatter.php +[NumberFormatter]: ../src/NumberFormatter.php diff --git a/docs/Supplemental.md b/docs/Supplemental.md index aba745c..d1e10bd 100644 --- a/docs/Supplemental.md +++ b/docs/Supplemental.md @@ -87,4 +87,4 @@ echo $territory->localized('ja')->name; // フランス -[Territory]: ../lib/Territory.php +[Territory]: ../src/Territory.php diff --git a/generator/src/Command/GenerateCurrency.php b/generator/src/Command/GenerateCurrency.php index f071f42..2814b19 100644 --- a/generator/src/Command/GenerateCurrency.php +++ b/generator/src/Command/GenerateCurrency.php @@ -11,10 +11,10 @@ use function ICanBoogie\CLDR\Generator\indent; -#[AsCommand('lib/Currency.php')] +#[AsCommand('src/Currency.php')] final class GenerateCurrency extends Command { - private const GENERATED_FILE = 'lib/Currency.php'; + private const GENERATED_FILE = 'src/Currency.php'; public function __construct( private readonly Repository $repository diff --git a/generator/src/Command/GenerateHasContextTransforms.php b/generator/src/Command/GenerateHasContextTransforms.php index e4a4789..5123989 100644 --- a/generator/src/Command/GenerateHasContextTransforms.php +++ b/generator/src/Command/GenerateHasContextTransforms.php @@ -12,10 +12,10 @@ use function ICanBoogie\CLDR\Generator\indent; -#[AsCommand('lib/Locale/HasContextTransforms.php')] +#[AsCommand('src/Locale/HasContextTransforms.php')] final class GenerateHasContextTransforms extends Command { - private const GENERATED_FILE = 'lib/Locale/HasContextTransforms.php'; + private const GENERATED_FILE = 'src/Locale/HasContextTransforms.php'; public function __construct( private readonly Repository $repository diff --git a/generator/src/Command/GenerateLocaleId.php b/generator/src/Command/GenerateLocaleId.php index 287149f..8da904e 100644 --- a/generator/src/Command/GenerateLocaleId.php +++ b/generator/src/Command/GenerateLocaleId.php @@ -11,10 +11,10 @@ use function ICanBoogie\CLDR\Generator\indent; -#[AsCommand('lib/LocaleId.php')] +#[AsCommand('src/LocaleId.php')] final class GenerateLocaleId extends Command { - private const GENERATED_FILE = 'lib/LocaleId.php'; + private const GENERATED_FILE = 'src/LocaleId.php'; public function __construct( private readonly Repository $repository diff --git a/generator/src/Command/GenerateSequenceCompanion.php b/generator/src/Command/GenerateSequenceCompanion.php index 6878f91..632d382 100644 --- a/generator/src/Command/GenerateSequenceCompanion.php +++ b/generator/src/Command/GenerateSequenceCompanion.php @@ -8,10 +8,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand('lib/Units/SequenceCompanion.php')] +#[AsCommand('src/Units/SequenceCompanion.php')] final class GenerateSequenceCompanion extends Command { - private const GENERATED_FILE = 'lib/Units/SequenceCompanion.php'; + private const GENERATED_FILE = 'src/Units/SequenceCompanion.php'; public function __construct( private readonly Repository $repository diff --git a/generator/src/Command/GenerateTerritoryCode.php b/generator/src/Command/GenerateTerritoryCode.php index b46f643..cdccfcf 100644 --- a/generator/src/Command/GenerateTerritoryCode.php +++ b/generator/src/Command/GenerateTerritoryCode.php @@ -10,10 +10,10 @@ use Symfony\Component\VarExporter\VarExporter; use function ICanBoogie\CLDR\Generator\indent; -#[AsCommand('lib/TerritoryCode.php')] +#[AsCommand('src/TerritoryCode.php')] final class GenerateTerritoryCode extends Command { - private const GENERATED_FILE = 'lib/TerritoryCode.php'; + private const GENERATED_FILE = 'src/TerritoryCode.php'; public function __construct( private readonly Repository $repository diff --git a/generator/src/Command/GenerateUnitsCompanion.php b/generator/src/Command/GenerateUnitsCompanion.php index ca9e33d..cf0e45f 100644 --- a/generator/src/Command/GenerateUnitsCompanion.php +++ b/generator/src/Command/GenerateUnitsCompanion.php @@ -8,10 +8,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand('lib/Units/UnitsCompanion.php')] +#[AsCommand('src/Units/UnitsCompanion.php')] final class GenerateUnitsCompanion extends Command { - private const GENERATED_FILE = 'lib/Units/UnitsCompanion.php'; + private const GENERATED_FILE = 'src/Units/UnitsCompanion.php'; public function __construct( private readonly Repository $repository diff --git a/phpcs.xml b/phpcs.xml index b78567b..fbe7551 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,7 +1,7 @@ - lib + src tests diff --git a/phpstan.neon b/phpstan.neon index 083ef98..3e7984a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,15 +1,15 @@ parameters: level: 8 paths: - - lib + - src - generator - tests scanFiles: - generator/generate excludePaths: - - lib/LocaleId.php - - lib/Units/SequenceCompanion.php - - lib/Units/UnitsCompanion.php + - src/LocaleId.php + - src/Units/SequenceCompanion.php + - src/Units/UnitsCompanion.php ignoreErrors: - '#get_.* is unused.#' - '#Method Test\\.*iterable type array#' diff --git a/phpunit.xml b/phpunit.xml index 2f1fcb6..88b4cbc 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -17,7 +17,7 @@ - ./lib + ./src diff --git a/lib/AbstractCollection.php b/src/AbstractCollection.php similarity index 100% rename from lib/AbstractCollection.php rename to src/AbstractCollection.php diff --git a/lib/AbstractSectionCollection.php b/src/AbstractSectionCollection.php similarity index 100% rename from lib/AbstractSectionCollection.php rename to src/AbstractSectionCollection.php diff --git a/lib/Cache.php b/src/Cache.php similarity index 100% rename from lib/Cache.php rename to src/Cache.php diff --git a/lib/Cache/CacheCollection.php b/src/Cache/CacheCollection.php similarity index 100% rename from lib/Cache/CacheCollection.php rename to src/Cache/CacheCollection.php diff --git a/lib/Cache/FileCache.php b/src/Cache/FileCache.php similarity index 100% rename from lib/Cache/FileCache.php rename to src/Cache/FileCache.php diff --git a/lib/Cache/RedisCache.php b/src/Cache/RedisCache.php similarity index 100% rename from lib/Cache/RedisCache.php rename to src/Cache/RedisCache.php diff --git a/lib/Cache/RuntimeCache.php b/src/Cache/RuntimeCache.php similarity index 100% rename from lib/Cache/RuntimeCache.php rename to src/Cache/RuntimeCache.php diff --git a/lib/Calendar.php b/src/Calendar.php similarity index 100% rename from lib/Calendar.php rename to src/Calendar.php diff --git a/lib/CalendarCollection.php b/src/CalendarCollection.php similarity index 100% rename from lib/CalendarCollection.php rename to src/CalendarCollection.php diff --git a/lib/CollectionTrait.php b/src/CollectionTrait.php similarity index 100% rename from lib/CollectionTrait.php rename to src/CollectionTrait.php diff --git a/lib/ContextTransforms.php b/src/ContextTransforms.php similarity index 100% rename from lib/ContextTransforms.php rename to src/ContextTransforms.php diff --git a/lib/Currency.php b/src/Currency.php similarity index 100% rename from lib/Currency.php rename to src/Currency.php diff --git a/lib/CurrencyFormatter.php b/src/CurrencyFormatter.php similarity index 100% rename from lib/CurrencyFormatter.php rename to src/CurrencyFormatter.php diff --git a/lib/CurrencyNotDefined.php b/src/CurrencyNotDefined.php similarity index 100% rename from lib/CurrencyNotDefined.php rename to src/CurrencyNotDefined.php diff --git a/lib/DateFormatter.php b/src/DateFormatter.php similarity index 100% rename from lib/DateFormatter.php rename to src/DateFormatter.php diff --git a/lib/DateTimeAccessor.php b/src/DateTimeAccessor.php similarity index 100% rename from lib/DateTimeAccessor.php rename to src/DateTimeAccessor.php diff --git a/lib/DateTimeFormatId.php b/src/DateTimeFormatId.php similarity index 100% rename from lib/DateTimeFormatId.php rename to src/DateTimeFormatId.php diff --git a/lib/DateTimeFormatLength.php b/src/DateTimeFormatLength.php similarity index 100% rename from lib/DateTimeFormatLength.php rename to src/DateTimeFormatLength.php diff --git a/lib/DateTimeFormatter.php b/src/DateTimeFormatter.php similarity index 100% rename from lib/DateTimeFormatter.php rename to src/DateTimeFormatter.php diff --git a/lib/Exception.php b/src/Exception.php similarity index 100% rename from lib/Exception.php rename to src/Exception.php diff --git a/lib/Formatter.php b/src/Formatter.php similarity index 100% rename from lib/Formatter.php rename to src/Formatter.php diff --git a/lib/GitHub/UrlResolver.php b/src/GitHub/UrlResolver.php similarity index 100% rename from lib/GitHub/UrlResolver.php rename to src/GitHub/UrlResolver.php diff --git a/lib/ListFormatter.php b/src/ListFormatter.php similarity index 100% rename from lib/ListFormatter.php rename to src/ListFormatter.php diff --git a/lib/ListType.php b/src/ListType.php similarity index 100% rename from lib/ListType.php rename to src/ListType.php diff --git a/lib/Locale.php b/src/Locale.php similarity index 100% rename from lib/Locale.php rename to src/Locale.php diff --git a/lib/Locale/HasContextTransforms.php b/src/Locale/HasContextTransforms.php similarity index 100% rename from lib/Locale/HasContextTransforms.php rename to src/Locale/HasContextTransforms.php diff --git a/lib/Locale/ListPattern.php b/src/Locale/ListPattern.php similarity index 100% rename from lib/Locale/ListPattern.php rename to src/Locale/ListPattern.php diff --git a/lib/LocaleId.php b/src/LocaleId.php similarity index 100% rename from lib/LocaleId.php rename to src/LocaleId.php diff --git a/lib/LocaleNotAvailable.php b/src/LocaleNotAvailable.php similarity index 100% rename from lib/LocaleNotAvailable.php rename to src/LocaleNotAvailable.php diff --git a/lib/Localizable.php b/src/Localizable.php similarity index 100% rename from lib/Localizable.php rename to src/Localizable.php diff --git a/lib/LocalizedCurrency.php b/src/LocalizedCurrency.php similarity index 100% rename from lib/LocalizedCurrency.php rename to src/LocalizedCurrency.php diff --git a/lib/LocalizedCurrencyFormatter.php b/src/LocalizedCurrencyFormatter.php similarity index 100% rename from lib/LocalizedCurrencyFormatter.php rename to src/LocalizedCurrencyFormatter.php diff --git a/lib/LocalizedDateTime.php b/src/LocalizedDateTime.php similarity index 100% rename from lib/LocalizedDateTime.php rename to src/LocalizedDateTime.php diff --git a/lib/LocalizedListFormatter.php b/src/LocalizedListFormatter.php similarity index 100% rename from lib/LocalizedListFormatter.php rename to src/LocalizedListFormatter.php diff --git a/lib/LocalizedLocale.php b/src/LocalizedLocale.php similarity index 100% rename from lib/LocalizedLocale.php rename to src/LocalizedLocale.php diff --git a/lib/LocalizedNumberFormatter.php b/src/LocalizedNumberFormatter.php similarity index 100% rename from lib/LocalizedNumberFormatter.php rename to src/LocalizedNumberFormatter.php diff --git a/lib/LocalizedObject.php b/src/LocalizedObject.php similarity index 100% rename from lib/LocalizedObject.php rename to src/LocalizedObject.php diff --git a/lib/LocalizedObjectWithFormatter.php b/src/LocalizedObjectWithFormatter.php similarity index 100% rename from lib/LocalizedObjectWithFormatter.php rename to src/LocalizedObjectWithFormatter.php diff --git a/lib/LocalizedTerritory.php b/src/LocalizedTerritory.php similarity index 100% rename from lib/LocalizedTerritory.php rename to src/LocalizedTerritory.php diff --git a/lib/Number.php b/src/Number.php similarity index 100% rename from lib/Number.php rename to src/Number.php diff --git a/lib/NumberFormatter.php b/src/NumberFormatter.php similarity index 100% rename from lib/NumberFormatter.php rename to src/NumberFormatter.php diff --git a/lib/NumberPattern.php b/src/NumberPattern.php similarity index 100% rename from lib/NumberPattern.php rename to src/NumberPattern.php diff --git a/lib/NumberPatternParser.php b/src/NumberPatternParser.php similarity index 100% rename from lib/NumberPatternParser.php rename to src/NumberPatternParser.php diff --git a/lib/Numbers.php b/src/Numbers.php similarity index 100% rename from lib/Numbers.php rename to src/Numbers.php diff --git a/lib/Numbers/Symbols.php b/src/Numbers/Symbols.php similarity index 100% rename from lib/Numbers/Symbols.php rename to src/Numbers/Symbols.php diff --git a/lib/Plurals.php b/src/Plurals.php similarity index 100% rename from lib/Plurals.php rename to src/Plurals.php diff --git a/lib/Plurals/Operands.php b/src/Plurals/Operands.php similarity index 100% rename from lib/Plurals/Operands.php rename to src/Plurals/Operands.php diff --git a/lib/Plurals/OperandsCache.php b/src/Plurals/OperandsCache.php similarity index 100% rename from lib/Plurals/OperandsCache.php rename to src/Plurals/OperandsCache.php diff --git a/lib/Plurals/Relation.php b/src/Plurals/Relation.php similarity index 100% rename from lib/Plurals/Relation.php rename to src/Plurals/Relation.php diff --git a/lib/Plurals/RelationCache.php b/src/Plurals/RelationCache.php similarity index 100% rename from lib/Plurals/RelationCache.php rename to src/Plurals/RelationCache.php diff --git a/lib/Plurals/Rule.php b/src/Plurals/Rule.php similarity index 100% rename from lib/Plurals/Rule.php rename to src/Plurals/Rule.php diff --git a/lib/Plurals/RuleCache.php b/src/Plurals/RuleCache.php similarity index 100% rename from lib/Plurals/RuleCache.php rename to src/Plurals/RuleCache.php diff --git a/lib/Plurals/Samples.php b/src/Plurals/Samples.php similarity index 100% rename from lib/Plurals/Samples.php rename to src/Plurals/Samples.php diff --git a/lib/Plurals/SamplesCache.php b/src/Plurals/SamplesCache.php similarity index 100% rename from lib/Plurals/SamplesCache.php rename to src/Plurals/SamplesCache.php diff --git a/lib/Provider.php b/src/Provider.php similarity index 100% rename from lib/Provider.php rename to src/Provider.php diff --git a/lib/Provider/CachedProvider.php b/src/Provider/CachedProvider.php similarity index 100% rename from lib/Provider/CachedProvider.php rename to src/Provider/CachedProvider.php diff --git a/lib/Provider/FailingProvider.php b/src/Provider/FailingProvider.php similarity index 100% rename from lib/Provider/FailingProvider.php rename to src/Provider/FailingProvider.php diff --git a/lib/Provider/WebProvider.php b/src/Provider/WebProvider.php similarity index 100% rename from lib/Provider/WebProvider.php rename to src/Provider/WebProvider.php diff --git a/lib/Repository.php b/src/Repository.php similarity index 100% rename from lib/Repository.php rename to src/Repository.php diff --git a/lib/ResourceNotFound.php b/src/ResourceNotFound.php similarity index 100% rename from lib/ResourceNotFound.php rename to src/ResourceNotFound.php diff --git a/lib/Spaces.php b/src/Spaces.php similarity index 100% rename from lib/Spaces.php rename to src/Spaces.php diff --git a/lib/Supplemental.php b/src/Supplemental.php similarity index 100% rename from lib/Supplemental.php rename to src/Supplemental.php diff --git a/lib/Supplemental/Fraction.php b/src/Supplemental/Fraction.php similarity index 100% rename from lib/Supplemental/Fraction.php rename to src/Supplemental/Fraction.php diff --git a/lib/Territory.php b/src/Territory.php similarity index 100% rename from lib/Territory.php rename to src/Territory.php diff --git a/lib/Territory/RegionCurrencies.php b/src/Territory/RegionCurrencies.php similarity index 100% rename from lib/Territory/RegionCurrencies.php rename to src/Territory/RegionCurrencies.php diff --git a/lib/Territory/RegionCurrency.php b/src/Territory/RegionCurrency.php similarity index 100% rename from lib/Territory/RegionCurrency.php rename to src/Territory/RegionCurrency.php diff --git a/lib/TerritoryCode.php b/src/TerritoryCode.php similarity index 100% rename from lib/TerritoryCode.php rename to src/TerritoryCode.php diff --git a/lib/TerritoryNotDefined.php b/src/TerritoryNotDefined.php similarity index 100% rename from lib/TerritoryNotDefined.php rename to src/TerritoryNotDefined.php diff --git a/lib/TimeFormatter.php b/src/TimeFormatter.php similarity index 100% rename from lib/TimeFormatter.php rename to src/TimeFormatter.php diff --git a/lib/UTF8Helpers.php b/src/UTF8Helpers.php similarity index 100% rename from lib/UTF8Helpers.php rename to src/UTF8Helpers.php diff --git a/lib/UnitLength.php b/src/UnitLength.php similarity index 100% rename from lib/UnitLength.php rename to src/UnitLength.php diff --git a/lib/Units.php b/src/Units.php similarity index 100% rename from lib/Units.php rename to src/Units.php diff --git a/lib/Units/NumberPerUnit.php b/src/Units/NumberPerUnit.php similarity index 100% rename from lib/Units/NumberPerUnit.php rename to src/Units/NumberPerUnit.php diff --git a/lib/Units/NumberWithUnit.php b/src/Units/NumberWithUnit.php similarity index 100% rename from lib/Units/NumberWithUnit.php rename to src/Units/NumberWithUnit.php diff --git a/lib/Units/Sequence.php b/src/Units/Sequence.php similarity index 100% rename from lib/Units/Sequence.php rename to src/Units/Sequence.php diff --git a/lib/Units/SequenceCompanion.php b/src/Units/SequenceCompanion.php similarity index 100% rename from lib/Units/SequenceCompanion.php rename to src/Units/SequenceCompanion.php diff --git a/lib/Units/Unit.php b/src/Units/Unit.php similarity index 100% rename from lib/Units/Unit.php rename to src/Units/Unit.php diff --git a/lib/Units/UnitsCompanion.php b/src/Units/UnitsCompanion.php similarity index 100% rename from lib/Units/UnitsCompanion.php rename to src/Units/UnitsCompanion.php diff --git a/lib/Warmable.php b/src/Warmable.php similarity index 100% rename from lib/Warmable.php rename to src/Warmable.php