diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..85ff30c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +*.php text eol=lf +*.phpt text eol=lf +/composer.lock export-ignore +/.github/ export-ignore +/tests export-ignore +/tools export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.php-cs-fixer.php export-ignore +/baseline.xml export-ignore +/phpstan.neon export-ignore +/phpunit.xml export-ignore \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..07c5e96 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,33 @@ + +

Change Log

+
+

Added

+ +

Fixed

+ +

Changed

+ +

Removed

+ +

Deprecated

+ +

Security

+ +
+
+ +

Description

+ + \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..12f28b4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/changelog-release.yml b/.github/workflows/changelog-release.yml new file mode 100644 index 0000000..bb9608a --- /dev/null +++ b/.github/workflows/changelog-release.yml @@ -0,0 +1,31 @@ +name: "Changelog - Release Unreleased" + +################################################################### +# WARNING - THIS ACTION WILL PUSH COMMIT DIRECTLY INTO REPOSITORY # +################################################################### + +on: + push: + tags: + - '*' + +jobs: + changelog-release-unreleased: + name: "Update Changelog - Release Unreleased" + + runs-on: "ubuntu-latest" + + steps: + - name: "Get tag name" + id: "tag-name" + run: | + tag=$(echo ${{ github.event.ref }} | cut -c11-) + echo "::set-output name=tag::$tag" + + - name: "Update CHANGELOG" + uses: "docker://aeonphp/automation:latest" + env: + AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + entrypoint: "/composer/vendor/bin/automation" + args: "changelog:release:unreleased ${{ github.repository }} CHANGELOG.md ${{ steps.tag-name.outputs.tag }} --github-file-changelog-update" diff --git a/.github/workflows/changelog-update.yml b/.github/workflows/changelog-update.yml new file mode 100644 index 0000000..f00f848 --- /dev/null +++ b/.github/workflows/changelog-update.yml @@ -0,0 +1,38 @@ +name: "Changelog - Update Unreleased" + +################################################################### +# WARNING - THIS ACTION WILL PUSH COMMIT DIRECTLY INTO REPOSITORY # +################################################################### + +on: + push: + branches: + - 5.x + +jobs: + changelog-update-unreleased: + name: "Changelog - Update Unreleased" + + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Restore Automation cache" + uses: "actions/cache@v4" + with: + path: | + cache + key: "${{ runner.os }}-automation-${{ hashFiles('**/CHANGELOG.md') }}" + restore-keys: | + ${{ runner.os }}-automation- + + - name: "Update CHANGELOG" + uses: "docker://aeonphp/automation:latest" + env: + AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + EON_AUTOMATION_CACHE_DIR: "/github/workspace/cache" + with: + entrypoint: "/composer/vendor/bin/automation" + args: "changelog:generate ${{ github.repository }} --github-file-update-path=CHANGELOG.md --skip-from=\"dependabot[bot]\" --skip-from=\"aeon-automation\"" diff --git a/.github/workflows/pull-request-description-check.yml b/.github/workflows/pull-request-description-check.yml new file mode 100644 index 0000000..f624146 --- /dev/null +++ b/.github/workflows/pull-request-description-check.yml @@ -0,0 +1,20 @@ +name: "Pull Request Description Check" + +on: + pull_request: + types: ["opened", "edited", "reopened", "ready_for_review"] + +jobs: + pull-request-description-check: + name: "Pull Request Description" + + runs-on: "ubuntu-latest" + + steps: + - name: "Pull Request Description - Check" + uses: "docker://aeonphp/automation:latest" + env: + AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + entrypoint: "/composer/vendor/bin/automation" + args: "pull-request:description:check ${{ github.repository }} ${{ github.event.pull_request.number }} --skip-from=\"dependabot[bot]\"" \ No newline at end of file diff --git a/.github/workflows/release-description-update.yml b/.github/workflows/release-description-update.yml new file mode 100644 index 0000000..c2db558 --- /dev/null +++ b/.github/workflows/release-description-update.yml @@ -0,0 +1,25 @@ +name: "Release - Description Update" + +######################################################### +# WARNING - THIS ACTION WILL UPDATE RELEASE DESCRIPTION # +######################################################### + +on: + release: + types: + - created + +jobs: + release-description-update: + name: "Release - Description Update" + + runs-on: "ubuntu-latest" + + steps: + - name: "Update CHANGELOG" + uses: "docker://aeonphp/automation:latest" + env: + AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + entrypoint: "/composer/vendor/bin/automation" + args: "changelog:generate ${{ github.repository }} --tag=${{ github.event.release.tag_name }} --github-release-update --skip-from=\"dependabot[bot]\" --skip-from=\"aeon-automation\"" diff --git a/.github/workflows/static-analyze.yml b/.github/workflows/static-analyze.yml new file mode 100644 index 0000000..f637e81 --- /dev/null +++ b/.github/workflows/static-analyze.yml @@ -0,0 +1,65 @@ +name: "Static Analyze" + +on: + pull_request: + push: + branches: + - "5.x" + schedule: + - cron: '0 8 * * *' + +jobs: + compatibility: + name: "Static Analyze" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "locked" + php-version: + - "8.3" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + tools: composer:v2 + + - name: "Get Composer Cache Directory" + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: "Cache Composer dependencies" + uses: "actions/cache@v4" + with: + path: | + ${{ steps.composer-cache.outputs.dir }} + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.lock') }}" + restore-keys: | + php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Static Analyze" + run: "composer static:analyze" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..9a8e097 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,69 @@ +name: "Tests" + +on: + pull_request: + push: + branches: + - "5.x" + schedule: + - cron: '0 8 * * *' + +jobs: + compatibility: + name: "Tests" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "locked" + - "lowest" + - "highest" + php-version: + - "8.3" + - "8.4" + - "8.5" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + tools: composer:v2 + + - name: "Get Composer Cache Directory" + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: "Cache Composer dependencies" + uses: "actions/cache@v4" + with: + path: | + ${{ steps.composer-cache.outputs.dir }} + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.lock') }}" + restore-keys: | + php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Tests" + run: "composer test" diff --git a/.gitignore b/.gitignore index 4cda1c1..c2ab8cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor/ bin/ -composer.lock \ No newline at end of file +var/ +composer.lock diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..66ddb29 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,224 @@ +files() + ->in([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]); + +if (!\file_exists(__DIR__ . '/var')) { + \mkdir(__DIR__ . '/var'); +} + +/** + * This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist + * and slightly adjusted. + */ +$config = new PhpCsFixer\Config(); + +return $config + ->setRiskyAllowed(true) + ->setCacheFile(__DIR__.'/var/.php_cs.cache') + ->setRules([ + 'align_multiline_comment' => true, + 'array_indentation' => true, + 'array_syntax' => ['syntax' => 'short'], + 'blank_line_after_namespace' => true, + 'blank_line_before_statement' => [ + 'statements' => [ + 'break', + 'continue', + 'declare', + 'default', + 'do', + 'exit', + 'for', + 'foreach', + 'goto', + 'if', + 'include', + 'include_once', + 'require', + 'require_once', + 'return', + 'switch', + 'throw', + 'try', + 'while', + ], + ], + 'braces' => true, + 'cast_spaces' => true, + 'class_attributes_separation' => ['elements' => ['const'=>'one', 'method'=>'one', 'property'=>'one']], + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, + 'compact_nullable_typehint' => true, + 'concat_space' => ['spacing' => 'one'], + 'constant_case' => true, + 'declare_equal_normalize' => ['space' => 'none'], + 'declare_strict_types' => true, + 'dir_constant' => true, + 'elseif' => true, + 'encoding' => true, + 'echo_tag_syntax' => true, + 'explicit_indirect_variable' => true, + 'explicit_string_variable' => true, + 'full_opening_tag' => true, + 'fully_qualified_strict_types' => true, + 'function_typehint_space' => true, + 'function_declaration' => true, + 'global_namespace_import' => [ + 'import_classes' => false, + 'import_constants' => false, + 'import_functions' => false, + ], + 'heredoc_to_nowdoc' => true, + 'increment_style' => [ + 'style' => PhpCsFixer\Fixer\Operator\IncrementStyleFixer::STYLE_POST, + ], + 'indentation_type' => true, + 'is_null' => true, + 'line_ending' => true, + 'list_syntax' => ['syntax' => 'short'], + 'logical_operators' => true, + 'lowercase_keywords' => true, + 'lowercase_static_reference' => true, + 'magic_constant_casing' => true, + 'magic_method_casing' => true, + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], + 'modernize_types_casting' => false, + 'multiline_comment_opening_closing' => true, + 'multiline_whitespace_before_semicolons' => true, + 'native_constant_invocation' => false, + 'native_function_casing' => false, + 'native_function_invocation' => ['include'=>['@all']], + 'native_function_type_declaration_casing' => true, + 'new_with_braces' => false, + 'no_alias_functions' => true, + 'no_alternative_syntax' => true, + 'no_blank_lines_after_class_opening' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_blank_lines_before_namespace' => false, + 'no_closing_tag' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_homoglyph_names' => true, + 'no_leading_import_slash' => true, + 'no_leading_namespace_whitespace' => true, + 'no_mixed_echo_print' => ['use' => 'print'], + 'no_multiline_whitespace_around_double_arrow' => true, + 'no_null_property_initialization' => true, + 'no_php4_constructor' => true, + 'no_short_bool_cast' => true, + 'no_singleline_whitespace_before_semicolons' => true, + 'no_spaces_after_function_name' => true, + 'no_spaces_around_offset' => true, + 'no_spaces_inside_parenthesis' => true, + 'no_superfluous_elseif' => true, + 'no_superfluous_phpdoc_tags' => false, + 'no_trailing_comma_in_list_call' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_trailing_whitespace' => true, + 'no_trailing_whitespace_in_comment' => true, + 'no_unneeded_control_parentheses' => true, + 'no_unneeded_curly_braces' => true, + 'no_unneeded_final_method' => true, + 'no_unreachable_default_argument_value' => true, + 'no_unset_on_property' => true, + 'no_unused_imports' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'no_whitespace_before_comma_in_array' => true, + 'no_whitespace_in_blank_line' => true, + 'non_printable_character' => true, + 'normalize_index_brace' => true, + 'object_operator_without_whitespace' => true, + 'ordered_class_elements' => [ + 'order' => [ + 'use_trait', + 'constant_public', + 'constant_protected', + 'constant_private', + 'property_public_static', + 'property_protected_static', + 'property_private_static', + 'property_public', + 'property_protected', + 'property_private', + 'construct', + 'method_public_static', + 'destruct', + 'magic', + 'phpunit', + 'method_public', + 'method_protected', + 'method_private', + 'method_protected_static', + 'method_private_static', + ], + ], + 'ordered_imports' => [ + 'imports_order' => [ + PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CONST, + PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_FUNCTION, + PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CLASS, + ] + ], + 'ordered_interfaces' => [ + 'direction' => 'ascend', + 'order' => 'alpha', + ], + 'phpdoc_add_missing_param_annotation' => false, + 'phpdoc_align' => ['align' => 'left'], + 'phpdoc_annotation_without_dot' => true, + 'phpdoc_indent' => true, + 'phpdoc_no_access' => true, + 'phpdoc_no_empty_return' => true, + 'phpdoc_no_package' => true, + 'phpdoc_order' => true, + 'phpdoc_return_self_reference' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_summary' => true, + 'phpdoc_to_comment' => false, + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_types' => ['groups' => ['simple', 'meta']], + 'phpdoc_types_order' => true, + 'phpdoc_var_without_name' => true, + 'pow_to_exponentiation' => true, + 'protected_to_private' => true, + 'return_assignment' => true, + 'return_type_declaration' => ['space_before' => 'one'], + 'self_accessor' => true, + 'self_static_accessor' => true, + 'semicolon_after_instruction' => true, + 'set_type_to_cast' => true, + 'short_scalar_cast' => true, + 'simple_to_complex_string_variable' => true, + 'simplified_null_return' => false, + 'single_blank_line_at_eof' => true, + 'single_import_per_statement' => true, + 'single_line_after_imports' => true, + 'single_quote' => true, + 'standardize_not_equals' => true, + 'strict_param' => true, + 'ternary_to_null_coalescing' => true, + 'trailing_comma_in_multiline' => true, + 'trim_array_spaces' => true, + 'unary_operator_spaces' => true, + 'visibility_required' => [ + 'elements' => [ + 'const', + 'method', + 'property', + ], + ], + 'void_return' => true, + 'whitespace_after_comma_in_array' => true, + ]) + ->setFinder($finder); \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 27cece7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: php - -matrix: - include: - - php: 5.3 - env: DEPENDENCIES='low' - - php: 5.3 - - php: 5.4 - - php: 5.5 - - php: 5.6 - - php: hhvm - allow_failures: - - env: DEPENDENCIES='low' - -before_install: - - composer self-update - -install: - - export COMPOSER_ROOT_VERSION=dev-master - - if [ "$DEPENDENCIES" != "low" ]; then composer update; fi; - - if [ "$DEPENDENCIES" == "low" ]; then composer update --prefer-lowest; fi; - -script: - - ./bin/phpspec run --format=pretty diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7f89e8d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,414 @@ +## [5.0.3] - 2025-12-11 + +### Added +- [#149](https://github.com/coduo/php-humanizer/pull/149) - **Symfony 8+ support** - [@bpolaszek](https://github.com/bpolaszek) +- [#149](https://github.com/coduo/php-humanizer/pull/149) - **PHP 8.5 support** - [@bpolaszek](https://github.com/bpolaszek) + +### Changed +- [#141](https://github.com/coduo/php-humanizer/pull/141) - **Update action cache from @v2 to @v4 in Github Action workflows** - [@norberttech](https://github.com/norberttech) + +### Fixed +- [#149](https://github.com/coduo/php-humanizer/pull/149) - **Incorrect nullable types as of PHP 8.4** - [@bpolaszek](https://github.com/bpolaszek) +- [#139](https://github.com/coduo/php-humanizer/pull/139) - **Readme typo** - [@WatheqAlshowaiter](https://github.com/WatheqAlshowaiter) + +### Removed +- [#149](https://github.com/coduo/php-humanizer/pull/149) - **Removed `composer.lock` from git and added it to `.gitignore` (lock file not required in packages, helps CI to pass)** - [@bpolaszek](https://github.com/bpolaszek) + +## [5.0.2] - 2025-02-06 + +### Added +- [#138](https://github.com/coduo/php-humanizer/pull/138) - **Add Swedish translations** - [@adevade](https://github.com/adevade) + +## [5.0.1] - 2025-01-25 + +### Fixed +- [76e7b6](https://github.com/coduo/php-humanizer/commit/76e7b6a7bec97e095b14e7dbfb7aa19ae1cb7fc9) - **failing tests** - [@norberttech](https://github.com/norberttech) + +### Updated +- [fb621f](https://github.com/coduo/php-humanizer/commit/fb621fda3e73428af8bba55f697c51daf002580b) - **project to PHP 8.4** - [@norberttech](https://github.com/norberttech) + +### Removed +- [#136](https://github.com/coduo/php-humanizer/pull/136) - **symfony/yaml dependency** - [@norberttech](https://github.com/norberttech) + +## [5.0.0] - 2024-04-11 + +### Added +- [#133](https://github.com/coduo/php-humanizer/pull/133) - **Slovak translation added for Oxford and Datetime** - [@jerony-mo](https://github.com/jerony-mo) +- [#133](https://github.com/coduo/php-humanizer/pull/133) - **Czech translation added for Oxford and Datetime** - [@jerony-mo](https://github.com/jerony-mo) + +### Changed +- [#131](https://github.com/coduo/php-humanizer/pull/131) - **Using the assertSame to make assert equals restricted.** - [@peter279k](https://github.com/peter279k) + +### Fixed +- [90efee](https://github.com/coduo/php-humanizer/commit/90efee54b12d083d7d4ec62d52cdb7f2a5c9641d) - **development tools dependencies configuration** - [@norberttech](https://github.com/norberttech) +- [fe058c](https://github.com/coduo/php-humanizer/commit/fe058ca2ecb9aa90f8c688a25a9327b7c2050156) - **static analyze github workflow php version** - [@norberttech](https://github.com/norberttech) +- [#132](https://github.com/coduo/php-humanizer/pull/132) - **Fix the CI status badge URL.** - [@peter279k](https://github.com/peter279k) + +### Updated +- [b18a11](https://github.com/coduo/php-humanizer/commit/b18a11af5c694d8041fe585d687a6d5c4b8f78db) - **README.md** - [@norberttech](https://github.com/norberttech) +- [c5023f](https://github.com/coduo/php-humanizer/commit/c5023fa601eca56a39f23e9a8274d80f4a4a6c6a) - **project to latest versio of php and dependencies** - [@norberttech](https://github.com/norberttech) + +## [4.0.3] - 2022-06-07 + +### Added +- [#129](https://github.com/coduo/php-humanizer/pull/129) - **support for PHP 8.1 and symfony 6 dependencies** - [@norberttech](https://github.com/norberttech) + +### Changed +- [57c6ed](https://github.com/coduo/php-humanizer/commit/57c6ed978f48dc810e5e4540cbec022c57fecb3c) - **Delete FUNDING.yml** - [@norberttech](https://github.com/norberttech) + +### Updated +- [3107e2](https://github.com/coduo/php-humanizer/commit/3107e2b6a568726f4cd40a23847ce1e305c99c95) - **static-analyze.yml** - [@norberttech](https://github.com/norberttech) +- [6a369d](https://github.com/coduo/php-humanizer/commit/6a369d9f17855736c5f38261f6765d084e177da2) - **tests.yml** - [@norberttech](https://github.com/norberttech) + +## [4.0.2] - 2021-06-20 + +### Changed +- [fb264c](https://github.com/coduo/php-humanizer/commit/fb264c8fbfb94f7a10272ac9fca576d8aa053b4a) - **Aeon Calendar dependency** - [@norberttech](https://github.com/norberttech) +- [#126](https://github.com/coduo/php-humanizer/pull/126) - **Using the `assertTrue` to assert expected is `true`.** - [@peter279k](https://github.com/peter279k) +- [#126](https://github.com/coduo/php-humanizer/pull/126) - **Using the `assertFalse` to assert expected is `false`.** - [@peter279k](https://github.com/peter279k) + +## [4.0.1] - 2021-02-27 + +### Fixed +- [#125](https://github.com/coduo/php-humanizer/pull/125) - **humanization of time unit less than 1 second** - [@norberttech](https://github.com/norberttech) + +## [4.0.0] - 2021-02-25 + +### Added +- [0533da](https://github.com/coduo/php-humanizer/commit/0533da67e2a0ff97a8f504ebc8de469eaca150f1) - **more strict php cs fixer rules** - [@norberttech](https://github.com/norberttech) +- [#123](https://github.com/coduo/php-humanizer/pull/123) - **Relative/Time Unit humanizer** - [@norberttech](https://github.com/norberttech) +- [#123](https://github.com/coduo/php-humanizer/pull/123) - **TimePeriod humanizer** - [@norberttech](https://github.com/norberttech) +- [#123](https://github.com/coduo/php-humanizer/pull/123) - **Support for \DateTimeInterface instead of legacy \DateTime in all DateTimeHumanizers** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **phpstan with highest possible requirements** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **psalm with highest possible requirements** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **arguments and return type hinting** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **PHP 8.0 support** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **More precise CS fixer rules** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **Full change log** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **integration with aeon-php/automation** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **Github actions integration** - [@norberttech](https://github.com/norberttech) +- [#120](https://github.com/coduo/php-humanizer/pull/120) - **test for azerbaijani language** - [@4t87ux8](https://github.com/4t87ux8) +- [#119](https://github.com/coduo/php-humanizer/pull/119) - **support azerbaijani language** - [@4t87ux8](https://github.com/4t87ux8) + +### Changed +- [#124](https://github.com/coduo/php-humanizer/pull/124) - **load Translator only once for given locale** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **minimum required PHP version ^7.4** - [@norberttech](https://github.com/norberttech) +- [#118](https://github.com/coduo/php-humanizer/pull/118) - **create azerbaijani translation** - [@4t87ux8](https://github.com/4t87ux8) +- [fa52e6](https://github.com/coduo/php-humanizer/commit/fa52e6223eef2f19fbd0a290432b5a878317dca2) - **Fixxed issue with symfony translator dependency, upgraded php, phpunit and phpspec dependencies** - [@norberttech](https://github.com/norberttech) +- [f989a9](https://github.com/coduo/php-humanizer/commit/f989a91d2d90f5d4bf4922ab9fec1674e7fe024e) - **Create FUNDING.yml** - [@norberttech](https://github.com/norberttech) +- [142689](https://github.com/coduo/php-humanizer/commit/142689763a6aafdd9f1dfbb48db9807bbe027acc) - **Update README.md** - [@norberttech](https://github.com/norberttech) +- [6255e0](https://github.com/coduo/php-humanizer/commit/6255e022c0ff8767cae6cdb4552d13f5f0df0d65) - **Moved php-cs-fixer to dev dependency where it belongs to** - [@norberttech](https://github.com/norberttech) +- [4d62db](https://github.com/coduo/php-humanizer/commit/4d62dba187d89bc8276ff6e5364d2dd9a3f2ad5f) - **Migrated from travis-ci.org to travis-ci.com** - [@norberttech](https://github.com/norberttech) +- [dc528e](https://github.com/coduo/php-humanizer/commit/dc528ebcef31b793e1dd24dbe90f14039361fad1) - **Update README.md** - [@norberttech](https://github.com/norberttech) +- [1b2787](https://github.com/coduo/php-humanizer/commit/1b2787d28282247b3fe68cd5b9f6bf80f304fa63) - **dev-master branch aliast** - [@norberttech](https://github.com/norberttech) + +### Fixed +- [16074f](https://github.com/coduo/php-humanizer/commit/16074feea40f8d96e2a31d8d18e24425149a6086) - **missing .php_cs configuration file** - [@norberttech](https://github.com/norberttech) +- [4de08d](https://github.com/coduo/php-humanizer/commit/4de08de0b2463cfc498612a89189385b5de4f66d) - **updating changelog workflow** - [@norberttech](https://github.com/norberttech) +- [fc3a04](https://github.com/coduo/php-humanizer/commit/fc3a043f6e03bc29e86d0cd58ae3a6b7daf40d69) - **travis configuration** - [@norberttech](https://github.com/norberttech) +- [#115](https://github.com/coduo/php-humanizer/pull/115) - **composer autoloading deprecation notice; Support symfony 5** - [@brianwozeniak](https://github.com/brianwozeniak) + +### Removed +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **phpspec** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **symfony/config dependency** - [@norberttech](https://github.com/norberttech) +- [#122](https://github.com/coduo/php-humanizer/pull/122) - **travis CI integration** - [@norberttech](https://github.com/norberttech) +- [83a180](https://github.com/coduo/php-humanizer/commit/83a1805da9a28a98a0bb932a5236becd44ea79b6) - **php 8.0 from matrix** - [@norberttech](https://github.com/norberttech) + +## [3.0.2] - 2019-04-29 + +### Changed +- [9d83e5](https://github.com/coduo/php-humanizer/commit/9d83e509dacfd26250ee4c6b0f195affb08cb1e2) - **Moved php-cs-fixer to dev dependency where it belongs to** - [@norberttech](https://github.com/norberttech) + +## [3.0.1] - 2019-04-20 + +### Changed +- [380428](https://github.com/coduo/php-humanizer/commit/38042820e9ee7ccc76d66f9c480fe8b7f0e8aaf0) - **Update README.md** - [@norberttech](https://github.com/norberttech) + +## [3.0.0] - 2019-04-20 + +### Added +- [17a5ab](https://github.com/coduo/php-humanizer/commit/17a5ab5243ae1eec2e3d39388bf611088b8fd5e7) - **missing translations** - [@norberttech](https://github.com/norberttech) +- [#86](https://github.com/coduo/php-humanizer/pull/86) - **test case with 0 at the end of the number** - [@norberttech](https://github.com/norberttech) +- [#84](https://github.com/coduo/php-humanizer/pull/84) - **PFIGS ordinals** - [@martinbutt](https://github.com/martinbutt) + +### Changed +- [1b2787](https://github.com/coduo/php-humanizer/commit/1b2787d28282247b3fe68cd5b9f6bf80f304fa63) - **dev-master branch aliast** - [@norberttech](https://github.com/norberttech) +- [14ab74](https://github.com/coduo/php-humanizer/commit/14ab746762acd1856ddd386023128f23935ef119) - **CS Fixes** - [@norberttech](https://github.com/norberttech) +- [9edceb](https://github.com/coduo/php-humanizer/commit/9edceb2d21fa879e91072308b8bbe3503a346bd2) - **CS Fixes** - [@norberttech](https://github.com/norberttech) +- [#112](https://github.com/coduo/php-humanizer/pull/112) - **Upgraded thunderer/shortcode dependency to ^0.7** - [@thunderer](https://github.com/thunderer) +- [#111](https://github.com/coduo/php-humanizer/pull/111) - **Allow later versions of symfony packages** - [@brianwozeniak](https://github.com/brianwozeniak) +- [#91](https://github.com/coduo/php-humanizer/pull/91) - **Sanity check for NumberFormatter when intl is not installed** - [@thunderer](https://github.com/thunderer) +- [#40](https://github.com/coduo/php-humanizer/pull/40) - **Romanian translations** - [@a-ungurianu](https://github.com/a-ungurianu) +- [#106](https://github.com/coduo/php-humanizer/pull/106) - **[master] Add translation: zh_TW** - [@jfcherng](https://github.com/jfcherng) +- [#104](https://github.com/coduo/php-humanizer/pull/104) - **Feature/update** - [@norberttech](https://github.com/norberttech) +- [#89](https://github.com/coduo/php-humanizer/pull/89) - **remove unnecessary echo** - [@vinicius73](https://github.com/vinicius73) +- [#87](https://github.com/coduo/php-humanizer/pull/87) - **Force $binaryPrefixes array ordering on 32-bit systems, fixes #83** - [@Forst](https://github.com/Forst) +- [5cd850](https://github.com/coduo/php-humanizer/commit/5cd850b49b1ca30811f24c5c1a9b0d6e4cac9fba) - **Update composer.json** - [@norberttech](https://github.com/norberttech) +- [#85](https://github.com/coduo/php-humanizer/pull/85) - **Support Japanese language** - [@serima](https://github.com/serima) + +### Fixed +- [9b52c5](https://github.com/coduo/php-humanizer/commit/9b52c5dc42f10ff60f4827ff9a736b3a1a18f0e4) - **README.md** - [@norberttech](https://github.com/norberttech) +- [#80](https://github.com/coduo/php-humanizer/pull/80) - **russian translation** - [@dizzy7](https://github.com/dizzy7) + +## [2.0.1] - 2019-02-25 + +### Changed +- [#107](https://github.com/coduo/php-humanizer/pull/107) - **[2.0] Add translation: zh_TW** - [@jfcherng](https://github.com/jfcherng) + +### Fixed +- [#108](https://github.com/coduo/php-humanizer/pull/108) - **travis configuration for 2.0 branch** - [@norberttech](https://github.com/norberttech) + +## [2.0.0-beta] - 2016-02-21 + +### Added +- [#78](https://github.com/coduo/php-humanizer/pull/78) - **ext-inl to composer suggest** - [@norberttech](https://github.com/norberttech) +- [#68](https://github.com/coduo/php-humanizer/pull/68) - **composer cache folder and move to new infrastructure** - [@norberttech](https://github.com/norberttech) + +### Changed +- [e85d69](https://github.com/coduo/php-humanizer/commit/e85d6905a097f9ba6b2165d9998749eb113d0289) - **Merge pull request #78 from norzechowicz/suggest-intl** - [@norzechowicz](https://github.com/norzechowicz) +- [#75](https://github.com/coduo/php-humanizer/pull/75) - **Cleanup before stable release** - [@norberttech](https://github.com/norberttech) +- [f5831e](https://github.com/coduo/php-humanizer/commit/f5831e3be54ca85c9fc14ee5da00b2d6ba1143bb) - **Merge pull request #75 from norzechowicz/cleanup** - [@norzechowicz](https://github.com/norzechowicz) +- [#73](https://github.com/coduo/php-humanizer/pull/73) - **improve strategy to handle prefix-ordinal** - [@isnani](https://github.com/isnani) +- [6ec963](https://github.com/coduo/php-humanizer/commit/6ec963fb1c8ecee66feb0228ca5626f1c1ca09f8) - **Merge pull request #73 from isnani/improve-ordinal-strategy** - [@norzechowicz](https://github.com/norzechowicz) +- [#70](https://github.com/coduo/php-humanizer/pull/70) - **Cleanup** - [@norberttech](https://github.com/norberttech) +- [dac4b4](https://github.com/coduo/php-humanizer/commit/dac4b43390f320b82728f1e5e0ad45f7c68d591e) - **Merge pull request #70 from norzechowicz/cleanup** - [@norzechowicz](https://github.com/norzechowicz) +- [#69](https://github.com/coduo/php-humanizer/pull/69) - **Renamed all facades in order to support php7** - [@norberttech](https://github.com/norberttech) +- [b7214c](https://github.com/coduo/php-humanizer/commit/b7214ce3e0511d5172568aff4a4572a0d80762a1) - **Merge pull request #69 from norzechowicz/php7-support** - [@norzechowicz](https://github.com/norzechowicz) +- [3f252e](https://github.com/coduo/php-humanizer/commit/3f252ef1a717a841dac1316f835494ef82104cde) - **master branch alias** - [@norberttech](https://github.com/norberttech) +- [ae6020](https://github.com/coduo/php-humanizer/commit/ae602062f4500488dcbd119b3560a1bdd4fe2699) - **Merge pull request #68 from norzechowicz/travis-ci** - [@norzechowicz](https://github.com/norzechowicz) +- [7c7e79](https://github.com/coduo/php-humanizer/commit/7c7e79dabc0989dbaf485d46c00d9d836c929f8a) - **Merge pull request #67 from nwatth/thai-translation** - [@norzechowicz](https://github.com/norzechowicz) +- [#67](https://github.com/coduo/php-humanizer/pull/67) - **Thai translation** - [@nwatth](https://github.com/nwatth) + +## [1.0.9] - 2015-12-02 + +### Added +- [#54](https://github.com/coduo/php-humanizer/pull/54) - **Ukrainian to the list of languages** - [@Borales](https://github.com/Borales) +- [d2904a](https://github.com/coduo/php-humanizer/commit/d2904ae1e1ebd79c7b8224aa31bd5aec8d9575a4) - **composer.phar into .gitignore** - [@norberttech](https://github.com/norberttech) +- [#26](https://github.com/coduo/php-humanizer/pull/26) - **Spanish translation.** - [@orestes](https://github.com/orestes) +- [#53](https://github.com/coduo/php-humanizer/pull/53) - **Chinese Simplified (zh_CN)** - [@arrowrowe](https://github.com/arrowrowe) + +### Changed +- [#65](https://github.com/coduo/php-humanizer/pull/65) - **Oxford french translation** - [@percymamedy](https://github.com/percymamedy) +- [b36457](https://github.com/coduo/php-humanizer/commit/b364572a7a73bed0be62a7d2df382fb1ab35cd2a) - **Merge pull request #65 from percymamedy/master** - [@norzechowicz](https://github.com/norzechowicz) +- [#66](https://github.com/coduo/php-humanizer/pull/66) - **Danish translation** - [@hyperpanic](https://github.com/hyperpanic) +- [7599dd](https://github.com/coduo/php-humanizer/commit/7599dd847f6b72c6c41f9458cfd92092200644e9) - **Merge pull request #66 from radiosignal/danish-translation** - [@norzechowicz](https://github.com/norzechowicz) +- [#61](https://github.com/coduo/php-humanizer/pull/61) - **Shortcode removal utilities** - [@thunderer](https://github.com/thunderer) +- [6bed68](https://github.com/coduo/php-humanizer/commit/6bed6804a97b0489af80ea229616d26a7224b33a) - **Merge pull request #61 from thunderer/string-shortcode-removal** - [@norzechowicz](https://github.com/norzechowicz) +- [a78a55](https://github.com/coduo/php-humanizer/commit/a78a552671dc51f4393b2806097250d0163eee2f) - **Merge pull request #64 from ddmler/master** - [@norzechowicz](https://github.com/norzechowicz) +- [#64](https://github.com/coduo/php-humanizer/pull/64) - **German translation** - [@ddmler](https://github.com/ddmler) +- [3eb227](https://github.com/coduo/php-humanizer/commit/3eb227e710726d04b1905dfc2422370d716611d5) - **Merge pull request #46 from doenietzomoeilijk/master** - [@norzechowicz](https://github.com/norzechowicz) +- [#46](https://github.com/coduo/php-humanizer/pull/46) - **Refactor Number into separate languages** - [@doenietzomoeilijk](https://github.com/doenietzomoeilijk) +- [a68dc7](https://github.com/coduo/php-humanizer/commit/a68dc7326b1991161e423812d454bf51f4c15d5e) - **Update README.md** - [@norzechowicz](https://github.com/norzechowicz) +- [3bcb4b](https://github.com/coduo/php-humanizer/commit/3bcb4b6c204a1d042517bb93e39f45cef1fe8615) - **Merge pull request #54 from Borales/master** - [@norzechowicz](https://github.com/norzechowicz) +- [#58](https://github.com/coduo/php-humanizer/pull/58) - **Remove composer.phar file** - [@vinkla](https://github.com/vinkla) +- [216c9b](https://github.com/coduo/php-humanizer/commit/216c9bbd1f173213a5137306faf5a8a04cab315e) - **Merge pull request #55 from hjason/master** - [@norzechowicz](https://github.com/norzechowicz) +- [5c9bb3](https://github.com/coduo/php-humanizer/commit/5c9bb3393a682126bb8d2d51fcdc77476eef2b83) - **Merge pull request #26 from orestes/es-translation** - [@norzechowicz](https://github.com/norzechowicz) +- [34ef53](https://github.com/coduo/php-humanizer/commit/34ef53fbd42ee7d33999ca4896ea17c2a1cc8a30) - **Update README.md** - [@norzechowicz](https://github.com/norzechowicz) +- [51ea67](https://github.com/coduo/php-humanizer/commit/51ea6720069d822a9b9ef8797d708b7205123517) - **Merge pull request #53 from dyweb/master** - [@norzechowicz](https://github.com/norzechowicz) + +### Fixed +- [73e99d](https://github.com/coduo/php-humanizer/commit/73e99d096f9f1bc4f66fbb13fc0a3a6f620f4eea) - **StringTest** - [@hjason2042@gmail.com](#) + +## [1.0.8] - 2015-11-06 + +### Added +- [#52](https://github.com/coduo/php-humanizer/pull/52) - **Indonesian language** - [@naprirfan](https://github.com/naprirfan) +- [#41](https://github.com/coduo/php-humanizer/pull/41) - **russian. Add prefix at format difference.** - [@sam002](https://github.com/sam002) +- [#51](https://github.com/coduo/php-humanizer/pull/51) - **possibility to pass forbidden words into humanizer** - [@norberttech](https://github.com/norberttech) +- [#49](https://github.com/coduo/php-humanizer/pull/49) - **support for multiple character separators at string humanizer** - [@drgomesp](https://github.com/drgomesp) +- [#27](https://github.com/coduo/php-humanizer/pull/27) - **Bulgarian translation** - [@lpopov](https://github.com/lpopov) +- [f65309](https://github.com/coduo/php-humanizer/commit/f6530941c4fb5c109aa593229a3ea3da449b6781) - **the breakpoint in the constructor** - [@smeeckaert](https://github.com/smeeckaert) +- [798d77](https://github.com/coduo/php-humanizer/commit/798d77d6b864b2d46b4c2487f616ea044f08f92c) - **breakpoint tests** - [@smeeckaert](https://github.com/smeeckaert) +- [#38](https://github.com/coduo/php-humanizer/pull/38) - **Dutch Oxford translations.** - [@doenietzomoeilijk](https://github.com/doenietzomoeilijk) +- [#29](https://github.com/coduo/php-humanizer/pull/29) - **Norwegian translation** - [@dagaa](https://github.com/dagaa) +- [#16](https://github.com/coduo/php-humanizer/pull/16) - **Dutch translation.** - [@Ozmodiar](https://github.com/Ozmodiar) + +### Changed +- [d6e784](https://github.com/coduo/php-humanizer/commit/d6e784a86b6f2318394fd6b8af853e5180d3ab15) - **Merge pull request #52 from naprirfan/master** - [@norzechowicz](https://github.com/norzechowicz) +- [9d1732](https://github.com/coduo/php-humanizer/commit/9d17321e4259ff8376d5a779c0ad682b4394ae00) - **Merge pull request #47 from mostertb/master** - [@norzechowicz](https://github.com/norzechowicz) +- [#47](https://github.com/coduo/php-humanizer/pull/47) - **Support for optional explicit BinarySuffix precision** - [@mostertb](https://github.com/mostertb) +- [a4d68a](https://github.com/coduo/php-humanizer/commit/a4d68a956478bfe84661ca1f8a6c8984aaba741c) - **Merge pull request #41 from sam002/master** - [@norzechowicz](https://github.com/norzechowicz) +- [#30](https://github.com/coduo/php-humanizer/pull/30) - **TruncateHtml** - [@smeeckaert](https://github.com/smeeckaert) +- [0465bd](https://github.com/coduo/php-humanizer/commit/0465bd058e9b8c26bf9dc00f38fe14a8473f67b7) - **Merge branch 'master' of git://github.com/smeeckaert/php-humanizer into smeeckaert-master** - [@norberttech](https://github.com/norberttech) +- [4a6ed1](https://github.com/coduo/php-humanizer/commit/4a6ed1f15345562df1eede367112d06a9fc41ab3) - **Merge pull request #51 from norzechowicz/humanizer-forbidden-words** - [@norzechowicz](https://github.com/norzechowicz) +- [c0606e](https://github.com/coduo/php-humanizer/commit/c0606e6844a22bc5480a2527d2f043d6a52eb52a) - **Merge pull request #50 from norzechowicz/phpunit** - [@norzechowicz](https://github.com/norzechowicz) +- [#50](https://github.com/coduo/php-humanizer/pull/50) - **Moved integration tests from phpspec into phpunit** - [@norberttech](https://github.com/norberttech) +- [0a04e0](https://github.com/coduo/php-humanizer/commit/0a04e02fbf7ba37a2df8b4c3a5f0b93d0ce9f002) - **Merge pull request #49 from drgomesp/support-multiple-character-separator** - [@norzechowicz](https://github.com/norzechowicz) +- [fe8f03](https://github.com/coduo/php-humanizer/commit/fe8f03731d1349fb24df7eb3d16eeda0b5d6f633) - **Merge pull request #27 from lpopov/master** - [@norzechowicz](https://github.com/norzechowicz) +- [#44](https://github.com/coduo/php-humanizer/pull/44) - **[ADD] Support PSR-4 Composer** - [@Th3Mouk](https://github.com/Th3Mouk) +- [75825a](https://github.com/coduo/php-humanizer/commit/75825a8ca318a3d7c523d3d489dd0547ab6a6b23) - **Merge pull request #44 from Th3Mouk/patch-1** - [@norzechowicz](https://github.com/norzechowicz) +- [#42](https://github.com/coduo/php-humanizer/pull/42) - **Fixes a typo in French** - [@Gnomino](https://github.com/Gnomino) +- [5bbff0](https://github.com/coduo/php-humanizer/commit/5bbff03cebefdf95eaa4cf9c53905c703a471ae4) - **style** - [@smeeckaert](https://github.com/smeeckaert) +- [cc7a56](https://github.com/coduo/php-humanizer/commit/cc7a56a09f31a50bf32a329dea7b65c446e53631) - **refacto truncate** - [@smeeckaert](https://github.com/smeeckaert) +- [a7cb87](https://github.com/coduo/php-humanizer/commit/a7cb8781189fb13d078530a03111bef47af8d04e) - **rename breakpoint len** - [@smeeckaert](https://github.com/smeeckaert) +- [91d107](https://github.com/coduo/php-humanizer/commit/91d1079d1f6eb88ec784d66e71c88da459ae6e37) - **code style** - [@smeeckaert](https://github.com/smeeckaert) +- [dac446](https://github.com/coduo/php-humanizer/commit/dac446bb4bb0a959fb39466b3729bc97060f4449) - **refacto visibility and breakpoint** - [@smeeckaert](https://github.com/smeeckaert) +- [#34](https://github.com/coduo/php-humanizer/pull/34) - **string functions into multibyte string functions** - [@norberttech](https://github.com/norberttech) +- [#35](https://github.com/coduo/php-humanizer/pull/35) - **Oxford italian translations** - [@omissis](https://github.com/omissis) +- [#22](https://github.com/coduo/php-humanizer/pull/22) - **Oxford collection + phpcs fixer cleanup.** - [@defrag](https://github.com/defrag) +- [#33](https://github.com/coduo/php-humanizer/pull/33) - **Truncate check length of append** - [@smeeckaert](https://github.com/smeeckaert) +- [#31](https://github.com/coduo/php-humanizer/pull/31) - **Addition of Portuguese (pt) language translation (with spec tests)** - [@lightglitch](https://github.com/lightglitch) +- [8cdeae](https://github.com/coduo/php-humanizer/commit/8cdeaef54f759d7e9a93c85cbf9e6e7b63dd6e76) - **truncate html** - [@smeeckaert](https://github.com/smeeckaert) +- [#28](https://github.com/coduo/php-humanizer/pull/28) - **Addition of Afrikaans (af) language translation (with spec tests)** - [@sarelvdwalt](https://github.com/sarelvdwalt) +- [#21](https://github.com/coduo/php-humanizer/pull/21) - **More correct wording for Dutch version of "... from now".** - [@Ozmodiar](https://github.com/Ozmodiar) +- [1f9243](https://github.com/coduo/php-humanizer/commit/1f924384c5f7b8bfbced89debac2b67b78511f7a) - **Merge pull request #21 from Ozmodiar/nl-translation** - [@norzechowicz](https://github.com/norzechowicz) +- [f5dafa](https://github.com/coduo/php-humanizer/commit/f5dafa6e721f93306496d3207e646a60c5bb4283) - **Merge pull request #18 from mattallty/patch-1** - [@norzechowicz](https://github.com/norzechowicz) +- [120f11](https://github.com/coduo/php-humanizer/commit/120f118c7051bdde9e9ea1d442cce6a70dfea8d9) - **Merge pull request #19 from NoUseFreak/composer_install** - [@norzechowicz](https://github.com/norzechowicz) +- [#19](https://github.com/coduo/php-humanizer/pull/19) - **Update composer installation instructions.** - [@NoUseFreak](https://github.com/NoUseFreak) +- [158714](https://github.com/coduo/php-humanizer/commit/1587145004b2f97b0562d359ef7c6d46e96295de) - **Merge pull request #16 from Ozmodiar/nl-translation** - [@norzechowicz](https://github.com/norzechowicz) +- [e49510](https://github.com/coduo/php-humanizer/commit/e49510dfd6e381489cfc5976b5683dba5d5e73da) - **Merge pull request #17 from Ozmodiar/readme-parenthesis** - [@norzechowicz](https://github.com/norzechowicz) + +### Fixed +- [3c3b83](https://github.com/coduo/php-humanizer/commit/3c3b830fad0f6e436a08b3f1adf20334a6a77604) - **doc** - [@smeeckaert](https://github.com/smeeckaert) +- [#18](https://github.com/coduo/php-humanizer/pull/18) - **typo in french translation** - [@mattallty](https://github.com/mattallty) +- [#17](https://github.com/coduo/php-humanizer/pull/17) - **parenthesis.** - [@Ozmodiar](https://github.com/Ozmodiar) + +## [1.0.7] - 2015-10-26 + +### Added +- [#15](https://github.com/coduo/php-humanizer/pull/15) - **spec for Italian translations** - [@norberttech](https://github.com/norberttech) +- [#14](https://github.com/coduo/php-humanizer/pull/14) - **italian translations.** - [@omissis](https://github.com/omissis) + +### Changed +- [a23b8e](https://github.com/coduo/php-humanizer/commit/a23b8e5b32a1b41e8e0d653a2de77ca090f47f8d) - **Merge pull request #15 from norzechowicz/italian-translations-spec** - [@norzechowicz](https://github.com/norzechowicz) +- [0db6f5](https://github.com/coduo/php-humanizer/commit/0db6f5d73b46bf8864b3dfc4823b29aeb97dd326) - **Merge pull request #14 from omissis/italian-translations** - [@norzechowicz](https://github.com/norzechowicz) +- [d05a54](https://github.com/coduo/php-humanizer/commit/d05a5494266fe5bc13e64aaa3c85cb58919fc63f) - **Update README.md** - [@norzechowicz](https://github.com/norzechowicz) + +## [1.0.6] - 2015-10-26 + +### Changed +- [8d7fff](https://github.com/coduo/php-humanizer/commit/8d7fff6382f60b278ddb069d9088d9d35ce26540) - **Rename difference.pt_br.yml to difference.pt_BR.yml** - [@norzechowicz](https://github.com/norzechowicz) + +## [1.0.4] - 2015-10-26 + +### Added +- [#10](https://github.com/coduo/php-humanizer/pull/10) - **translation for Portuguese - Brazil** - [@IgorDePaula](https://github.com/IgorDePaula) +- [c6a594](https://github.com/coduo/php-humanizer/commit/c6a594a57ea3687cb199183b56a232761a81f736) - **specs for FR translations** - [@norberttech](https://github.com/norberttech) + +### Changed +- [6051e8](https://github.com/coduo/php-humanizer/commit/6051e89f3bacd816dced8b3d1cb3a07c1b9b0336) - **Merge pull request #12 from marcamon2013/master** - [@norzechowicz](https://github.com/norzechowicz) +- [#12](https://github.com/coduo/php-humanizer/pull/12) - **Translation file added** - [@jebog](https://github.com/jebog) +- [#13](https://github.com/coduo/php-humanizer/pull/13) - **create turkish translation** - [@cnkt](https://github.com/cnkt) +- [e007db](https://github.com/coduo/php-humanizer/commit/e007dbcccdf56ae2021f13b300f78e2fca628d5b) - **Merge pull request #13 from cnkt/master** - [@norzechowicz](https://github.com/norzechowicz) + +### Fixed +- [8754ad](https://github.com/coduo/php-humanizer/commit/8754ad1f0e680d547c4197cc48d13d7f0b6ab766) - **Translator Builder regexp, added spec and updated readme for pt_BR translation** - [@norberttech](https://github.com/norberttech) +- [38bc22](https://github.com/coduo/php-humanizer/commit/38bc22377a66d24d3ebda915afa09e83cf3d8581) - **typo in TR translations and added spec** - [@norberttech](https://github.com/norberttech) + +## [1.0.3] - 2015-10-24 + +### Added +- [9c6a59](https://github.com/coduo/php-humanizer/commit/9c6a59981ca6902644c7c35c8deea1cbc994d7c7) - **German locale specs** - [@norberttech](https://github.com/norberttech) + +### Changed +- [a91217](https://github.com/coduo/php-humanizer/commit/a91217819c7c1d3a0f6a41182784b98681cb6f83) - **Update README.md** - [@norzechowicz](https://github.com/norzechowicz) +- [c227c3](https://github.com/coduo/php-humanizer/commit/c227c3bfe343ce8322daee67bfb8116add20af1e) - **Rename difference-de.yml to difference.de.yml** - [@norzechowicz](https://github.com/norzechowicz) + +## [1.0.2] - 2015-10-24 + +### Added +- [#11](https://github.com/coduo/php-humanizer/pull/11) - **german translation** - [@tbreuss](https://github.com/tbreuss) + +### Changed +- [9cb14a](https://github.com/coduo/php-humanizer/commit/9cb14aa8c77d6dc6aaff87770680251c993c0b79) - **Merge pull request #11 from tbreuss/master** - [@norzechowicz](https://github.com/norzechowicz) + +## [1.0.1] - 2015-07-14 + +### Changed +- [#9](https://github.com/coduo/php-humanizer/pull/9) - **Test lowest version of dependencies** - [@norberttech](https://github.com/norberttech) +- [97fee0](https://github.com/coduo/php-humanizer/commit/97fee0dbe7999c4305a3de686f9fdc6b3502796e) - **Merge pull request #9 from norzechowicz/test-lowest-dependencies** - [@norzechowicz](https://github.com/norzechowicz) +- [d97917](https://github.com/coduo/php-humanizer/commit/d979178d45d631d9acd98394b90be3ff345c8c02) - **Update README.md** - [@defrag](https://github.com/defrag) +- [80500c](https://github.com/coduo/php-humanizer/commit/80500c5c50e45f0346af394e3031307923d59b5f) - **Update README.md** - [@defrag](https://github.com/defrag) +- [59a604](https://github.com/coduo/php-humanizer/commit/59a6045a716ec63bfb335ea326ce4ee82cf5a4f7) - **Update README.md** - [@defrag](https://github.com/defrag) + +## [1.0.0] - 2014-06-12 + +### Added +- [#8](https://github.com/coduo/php-humanizer/pull/8) - **missing require for symfony/yaml in composer.json** - [@dedik](https://github.com/dedik) +- [#4](https://github.com/coduo/php-humanizer/pull/4) - **truncate operation** - [@norberttech](https://github.com/norberttech) +- [#3](https://github.com/coduo/php-humanizer/pull/3) - **roman converters** - [@defrag](https://github.com/defrag) +- [#1](https://github.com/coduo/php-humanizer/pull/1) - **number and oridinalize** - [@defrag](https://github.com/defrag) +- [192a29](https://github.com/coduo/php-humanizer/commit/192a29e78fb2fe8595da1a43580a0a2f7914399c) - **travis configuration** - [@norberttech](https://github.com/norberttech) + +### Changed +- [b5a504](https://github.com/coduo/php-humanizer/commit/b5a504fec092d6d41391a1de6db09eb756e51895) - **Merge pull request #8 from dedik/master** - [@norberttech](https://github.com/norberttech) +- [673cc6](https://github.com/coduo/php-humanizer/commit/673cc617a158c83056ae7d1647467ef771a4fdbf) - **Update README.md** - [@defrag](https://github.com/defrag) +- [e5906b](https://github.com/coduo/php-humanizer/commit/e5906b5ea334a52960fab67f465246079fe971e3) - **Update README.md** - [@defrag](https://github.com/defrag) +- [43ba95](https://github.com/coduo/php-humanizer/commit/43ba95d307ae00d480393cce368491f62deee4f7) - **Merge pull request #7 from defrag/precise-date-fix** - [@norberttech](https://github.com/norberttech) +- [#6](https://github.com/coduo/php-humanizer/pull/6) - **Precise diffs** - [@defrag](https://github.com/defrag) +- [08b9d1](https://github.com/coduo/php-humanizer/commit/08b9d1b4f35d3f5846fb187248548d2148a261e5) - **Merge pull request #6 from defrag/precise-diff** - [@norberttech](https://github.com/norberttech) +- [7438be](https://github.com/coduo/php-humanizer/commit/7438be84cdc9831215bf99f83601ce3c4abfeb1e) - **Merge pull request #5 from norzechowicz/time** - [@defrag](https://github.com/defrag) +- [#5](https://github.com/coduo/php-humanizer/pull/5) - **[WIP] Introduce time difference humanizer** - [@norberttech](https://github.com/norberttech) +- [618179](https://github.com/coduo/php-humanizer/commit/618179735f5583ca8d425a8ccf375ce0afd22e55) - **Merge pull request #4 from norzechowicz/truncate** - [@defrag](https://github.com/defrag) +- [711775](https://github.com/coduo/php-humanizer/commit/71177557d8d4bc7b95e10170c34cd176a8287e38) - **Moved library to Coduo organization** - [@norberttech](https://github.com/norberttech) +- [6815c6](https://github.com/coduo/php-humanizer/commit/6815c651a7570802ccc5beaf3e6408e6abab1caa) - **Merge pull request #3 from defrag/roman** - [@norberttech](https://github.com/norberttech) +- [cee3c3](https://github.com/coduo/php-humanizer/commit/cee3c34860042bb93ce73d39ea32fd6b9acef3d1) - **Update readme** - [@norberttech](https://github.com/norberttech) +- [fda9db](https://github.com/coduo/php-humanizer/commit/fda9db3ef94591e80d627517390c42d688021d7a) - **Merge remote-tracking branch 'origin/master'** - [@norberttech](https://github.com/norberttech) +- [fd51e9](https://github.com/coduo/php-humanizer/commit/fd51e914d98d28943a34a3fea9237f4a8c6c7e90) - **Metric suffix** - [@norberttech](https://github.com/norberttech) +- [7b7d4e](https://github.com/coduo/php-humanizer/commit/7b7d4e4453211e1975f3004a74670e6ebdbecb1c) - **Merge pull request #2 from pborreli/typos** - [@norberttech](https://github.com/norberttech) +- [720bec](https://github.com/coduo/php-humanizer/commit/720becd16f48140d94a983e5eaa6c4e1b9879442) - **Update README.md** - [@norberttech](https://github.com/norberttech) +- [e62090](https://github.com/coduo/php-humanizer/commit/e62090a6ba103a63718fd17a5d6a0001f007ecac) - **Update README.md** - [@norberttech](https://github.com/norberttech) +- [d7fd45](https://github.com/coduo/php-humanizer/commit/d7fd45f39377298e35922843cfe004497898cf18) - **Binary suffix converter** - [@norberttech](https://github.com/norberttech) +- [65564e](https://github.com/coduo/php-humanizer/commit/65564e1202be4e67822e40c366dd36836bdec70a) - **Refactoring** - [@norberttech](https://github.com/norberttech) +- [58f3d5](https://github.com/coduo/php-humanizer/commit/58f3d560caba8ec66ca57ef66cc3e598ee5eb230) - **Merge pull request #1 from defrag/number** - [@norberttech](https://github.com/norberttech) +- [35d7e6](https://github.com/coduo/php-humanizer/commit/35d7e69c62e653f2f180b96597002bf143f79ec0) - **String humanize introduction** - [@norberttech](https://github.com/norberttech) +- [e2bfc6](https://github.com/coduo/php-humanizer/commit/e2bfc680b3f339f6bf2f6e39ce9a17f02eeaebbe) - **Initial commit** - [@norberttech](https://github.com/norberttech) + +### Fixed +- [#7](https://github.com/coduo/php-humanizer/pull/7) - **precise date calculations** - [@defrag](https://github.com/defrag) +- [#2](https://github.com/coduo/php-humanizer/pull/2) - **typos** - [@pborreli](https://github.com/pborreli) + +## Contributors + +- @4t87ux8 +- @a-ungurianu +- @adevade +- @arrowrowe +- @Borales +- @bpolaszek +- @brianwozeniak +- @cnkt +- @dagaa +- @ddmler +- @dedik +- @defrag +- @dizzy7 +- @doenietzomoeilijk +- @drgomesp +- @Forst +- @Gnomino +- @hjason2042@gmail.com +- @hyperpanic +- @IgorDePaula +- @isnani +- @jebog +- @jerony-mo +- @jfcherng +- @lightglitch +- @lpopov +- @martinbutt +- @mattallty +- @mostertb +- @naprirfan +- @norberttech +- @norzechowicz +- @NoUseFreak +- @nwatth +- @omissis +- @orestes +- @Ozmodiar +- @pborreli +- @percymamedy +- @peter279k +- @sam002 +- @sarelvdwalt +- @serima +- @smeeckaert +- @tbreuss +- @Th3Mouk +- @thunderer +- @vinicius73 +- @vinkla +- @WatheqAlshowaiter + +Generated by [Automation](https://github.com/aeon-php/automation) \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..6681a3f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at norbert+coduo@orzechowicz.pl. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index ee409ba..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,23 +0,0 @@ -#A quick guide to contribute to the project: - -##Installing the dev environment - -1. Fork the repo -2. Clone the repo to local -3. Install dependencies: `composer install` (this assumes you have 'composer' aliased to whereever your composer.phar lives) -4. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate: - `./bin/phpspec run --format=pretty` - -##The actual contribution - -1. Make the changes/additions to the code, committing often and making clear what you've done -2. Make sure you write tests for your code, located in the folder structure `spec/Coduo/PHPHumanizer/...` -3. Run your tests (often and while coding): `./bin/phpspec run --format=pretty` - -##Coding Standards - -Try use similar coding standards to what you see in the project to keep things clear to the contributors. If you're unsure, it's always a safe bet to fall-back to the PSR standards. - -[PSR-1: Basic Coding Standard](http://www.php-fig.org/psr/psr-1/) - -[PSR-2: Coding Style Guide](http://www.php-fig.org/psr/psr-2/) diff --git a/LICENSE b/LICENSE index 6773c8c..aac62ee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014 Michal Dabrowski, Norbert Orzechowicz +Copyright (c) 2014-2021 Michal Dabrowski, Norbert Orzechowicz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/README.md b/README.md index f7ba58a..effd462 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,18 @@ -#PHP Humanizer +# PHP Humanizer -[![Build Status](https://travis-ci.org/coduo/php-humanizer.svg?branch=master)](https://travis-ci.org/coduo/php-humanizer) +[![Tests](https://github.com/coduo/php-humanizer/actions/workflows/tests.yml/badge.svg?branch=5.x)](https://github.com/coduo/php-humanizer/actions/workflows/tests.yml) [![Latest Stable Version](https://poser.pugx.org/coduo/php-humanizer/v/stable)](https://packagist.org/packages/coduo/php-humanizer) [![Total Downloads](https://poser.pugx.org/coduo/php-humanizer/downloads)](https://packagist.org/packages/coduo/php-humanizer) [![Latest Unstable Version](https://poser.pugx.org/coduo/php-humanizer/v/unstable)](https://packagist.org/packages/coduo/php-humanizer) [![License](https://poser.pugx.org/coduo/php-humanizer/license)](https://packagist.org/packages/coduo/php-humanizer) +[Readme for 5.x version](https://github.com/coduo/php-humanizer/tree/5.x/README.md) + + + Humanize values to make them readable for regular people ;) -#Installation +# Installation Run the following command: @@ -16,18 +20,18 @@ Run the following command: composer require coduo/php-humanizer ``` -#Usage +# Usage ## Text **Humanize** ```php -use Coduo\PHPHumanizer\String; +use Coduo\PHPHumanizer\StringHumanizer; -echo String::humanize('field_name'); // "Field Name" -echo String::humanize('user_id'); // "User" -echo String::humanize('field_name', false); // "field name" +StringHumanizer::humanize('field_name'); // "Field Name" +StringHumanizer::humanize('user_id'); // "User id" +StringHumanizer::humanize('field_name', false); // "field name" ``` **Truncate** @@ -35,104 +39,148 @@ echo String::humanize('field_name', false); // "field name" Truncate string to word closest to a certain length ```php -use Coduo\PHPHumanizer\String; +use Coduo\PHPHumanizer\StringHumanizer; $text = 'Lorem ipsum dolorem si amet, lorem ipsum. Dolorem sic et nunc.'; -echo String::truncate($text, 8); // "Lorem ipsum" -echo String::truncate($text, 8, '...'); // "Lorem ipsum..." -echo String::truncate($text, 2); // "Lorem" -echo String::truncate($text, strlen($text)); // "Lorem ipsum dolorem si amet, lorem ipsum. Dolorem sic et nunc." +StringHumanizer::truncate($text, 8); // "Lorem ipsum" +StringHumanizer::truncate($text, 8, '...'); // "Lorem ipsum..." +StringHumanizer::truncate($text, 2); // "Lorem" +StringHumanizer::truncate($text, strlen($text)); // "Lorem ipsum dolorem si amet, lorem ipsum. Dolorem sic et nunc." ``` +**Truncate HTML** + +Truncate and HTML string to word closest to a certain length + +```php +use Coduo\PHPHumanizer\StringHumanizer; + +$text = '

HyperText Markup Language, commonly referred to as HTML, is the standard markup language used to create web pages.[1] Web browsers can read HTML files and render them into visible or audible web pages. HTML describes the structure of a website semantically along with cues for presentation, making it a markup language, rather than a programming language.

'; + +StringHumanizer::truncateHtml($text, 3); // "HyperText" +StringHumanizer::truncateHtml($text, 12, ''); // "HyperText Markup" +StringHumanizer::truncateHtml($text, 50, '', '...'); // "HyperText Markup Language, commonly referred to as..." +StringHumanizer::truncateHtml($text, 75, '', '...'); // 'HyperText Markup Language, commonly referred to as HTML, is the standard markup...' + +``` + +**Remove shortcodes** + +```php +$text = 'A text with [short]random[/short] [codes]words[/codes].'; +StringHumanizer::removeShortcodes($text); // "A text with ." +StringHumanizer::removeShortcodeTags($text); // "A text with random words." +``` + ## Number **Ordinalize** ```php -use Coduo\PHPHumanizer\Number; +use Coduo\PHPHumanizer\NumberHumanizer; -echo Number::ordinalize(0); // "0th" -echo Number::ordinalize(1); // "1st" -echo Number::ordinalize(2); // "2nd" -echo Number::ordinalize(23); // "23rd" -echo Number::ordinalize(1002); // "1002nd" -echo Number::ordinalize(-111); // "-111th" +NumberHumanizer::ordinalize(0); // "0th" +NumberHumanizer::ordinalize(1); // "1st" +NumberHumanizer::ordinalize(2); // "2nd" +NumberHumanizer::ordinalize(23); // "23rd" +NumberHumanizer::ordinalize(1002, 'nl'); // "1002e" +NumberHumanizer::ordinalize(-111); // "-111th" ``` **Ordinal** ```php -use Coduo\PHPHumanizer\Number; - -echo Number::ordinal(0); // "th" -echo Number::ordinal(1); // "st" -echo Number::ordinal(2); // "nd" -echo Number::ordinal(23); // "rd" -echo Number::ordinal(1002); // "nd" -echo Number::ordinal(-111); // "th" +use Coduo\PHPHumanizer\NumberHumanizer; + +NumberHumanizer::ordinal(0); // "th" +NumberHumanizer::ordinal(1); // "st" +NumberHumanizer::ordinal(2); // "nd" +NumberHumanizer::ordinal(23); // "rd" +NumberHumanizer::ordinal(1002); // "nd" +NumberHumanizer::ordinal(-111, 'nl'); // "e" ``` **Roman numbers** ```php -use Coduo\PHPHumanizer\Number; +use Coduo\PHPHumanizer\NumberHumanizer; -echo Number::toRoman(1); // "I" -echo Number::toRoman(5); // "V" -echo Number::toRoman(1300); // "MCCC" +NumberHumanizer::toRoman(1); // "I" +NumberHumanizer::toRoman(5); // "V" +NumberHumanizer::toRoman(1300); // "MCCC" -echo Number::fromRoman("MMMCMXCIX"); // 3999 -echo Number::fromRoman("V"); // 5 -echo Number::fromRoman("CXXV"); // 125 +NumberHumanizer::fromRoman("MMMCMXCIX"); // 3999 +NumberHumanizer::fromRoman("V"); // 5 +NumberHumanizer::fromRoman("CXXV"); // 125 ``` **Binary Suffix** -```php -use Coduo\PHPHumanizer\Number; +Convert a number of bytes in to the highest applicable data unit -echo Number::binarySuffix(0); // "0 bytes" -echo Number::binarySuffix(1); // "1 bytes" -echo Number::binarySuffix(1024); // "1 kB" -echo Number::binarySuffix(1025); // "1 kB" -echo Number::binarySuffix(1536); // "1.5 kB" -echo Number::binarySuffix(1048576 * 5); // "5 MB" -echo Number::binarySuffix(1073741824 * 2); // "2 GB" -echo Number::binarySuffix(1099511627776 * 3); // "3 TB" -echo Number::binarySuffix(1325899906842624); // "1.18 PB" +```php +use Coduo\PHPHumanizer\NumberHumanizer; + +NumberHumanizer::binarySuffix(0); // "0 bytes" +NumberHumanizer::binarySuffix(1); // "1 bytes" +NumberHumanizer::binarySuffix(1024); // "1 kB" +NumberHumanizer::binarySuffix(1025); // "1 kB" +NumberHumanizer::binarySuffix(1536); // "1.5 kB" +NumberHumanizer::binarySuffix(1048576 * 5); // "5 MB" +NumberHumanizer::binarySuffix(1073741824 * 2); // "2 GB" +NumberHumanizer::binarySuffix(1099511627776 * 3); // "3 TB" +NumberHumanizer::binarySuffix(1325899906842624); // "1.18 PB" ``` Number can be also formatted for specific locale ```php -use Coduo\PHPHumanizer\Number; +use Coduo\PHPHumanizer\NumberHumanizer; -echo Number::binarySuffix(1536, 'pl'); // "1,5 kB" +NumberHumanizer::binarySuffix(1536, 'pl'); // "1,5 kB" ``` -**Metric Suffix** +Number can also be humanized with a specific number of decimal places with `preciseBinarySuffix($number, $precision, $locale = 'en')` +The precision parameter must be between 0 and 3. ```php -use Coduo\PHPHumanizer\Number; +use Coduo\PHPHumanizer\NumberHumanizer; + +NumberHumanizer::preciseBinarySuffix(1024, 2); // "1.00 kB" +NumberHumanizer::preciseBinarySuffix(1325899906842624, 3); // "1.178 PB" +``` + +This function also supports locale + +```php +use Coduo\PHPHumanizer\NumberHumanizer; + +NumberHumanizer::preciseBinarySuffix(1325899906842624, 3, 'pl'); // "1,178 PB" +``` + +**Metric Suffix** -echo Number::metricSuffix(-1); // "-1" -echo Number::metricSuffix(0); // "0" -echo Number::metricSuffix(1); // "1" -echo Number::metricSuffix(101); // "101" -echo Number::metricSuffix(1000); // "1k" -echo Number::metricSuffix(1240); // "1.2k" -echo Number::metricSuffix(1240000); // "1.24M" -echo Number::metricSuffix(3500000); // "3.5M" +```php +use Coduo\PHPHumanizer\NumberHumanizer; + +NumberHumanizer::metricSuffix(-1); // "-1" +NumberHumanizer::metricSuffix(0); // "0" +NumberHumanizer::metricSuffix(1); // "1" +NumberHumanizer::metricSuffix(101); // "101" +NumberHumanizer::metricSuffix(1000); // "1k" +NumberHumanizer::metricSuffix(1240); // "1.2k" +NumberHumanizer::metricSuffix(1240000); // "1.24M" +NumberHumanizer::metricSuffix(3500000); // "3.5M" ``` Number can be also formatted for specific locale ```php -use Coduo\PHPHumanizer\Number; +use Coduo\PHPHumanizer\NumberHumanizer; -echo Number::metricSuffix(1240000, 'pl'); // "1,24M" +NumberHumanizer::metricSuffix(1240000, 'pl'); // "1,24M" ``` ## Collections @@ -140,11 +188,11 @@ echo Number::metricSuffix(1240000, 'pl'); // "1,24M" **Oxford** ```php -use Coduo\PHPHumanizer\Collection; +use Coduo\PHPHumanizer\CollectionHumanizer; -echo Collection::oxford(['Michal', 'Norbert', 'Lukasz', 'Pawel'], 2); // "Michal, Norbert, and 2 others" -echo Collection::oxford(['Michal', 'Norbert', 'Lukasz'], 2); // "Michal, Norbert, and 1 other" -echo Collection::oxford(['Michal', 'Norbert']); // "Michal and Norbert" +CollectionHumanizer::oxford(['Michal', 'Norbert', 'Lukasz', 'Pawel'], 2); // "Michal, Norbert, and 2 others" +CollectionHumanizer::oxford(['Michal', 'Norbert', 'Lukasz'], 2); // "Michal, Norbert, and 1 other" +CollectionHumanizer::oxford(['Michal', 'Norbert']); // "Michal and Norbert" ``` Oxford is using translator component, so you can use whatever string format you like. @@ -154,38 +202,55 @@ Oxford is using translator component, so you can use whatever string format you **Difference** ```php -use Coduo\PHPHumanizer\DateTime; - -echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:00:00")); // just now -echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:00:05")); // 5 seconds from now -echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:59:00")); // 1 minute ago -echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:45:00")); // 15 minutes ago -echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:15:00")); // 15 minutes from now -echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 14:00:00")); // 1 hour from now -echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 15:00:00")); // 2 hours from now -echo DateTime::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:00:00")); // 1 hour ago -echo DateTime::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-25")); // 1 day ago -echo DateTime::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-24")); // 2 days ago -echo DateTime::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-28")); // 2 days from now -echo DateTime::difference(new \DateTime("2014-04-01"), new \DateTime("2014-04-15")); // 2 weeks from now -echo DateTime::difference(new \DateTime("2014-04-15"), new \DateTime("2014-04-07")); // 1 week ago -echo DateTime::difference(new \DateTime("2014-01-01"), new \DateTime("2014-04-01")); // 3 months from now -echo DateTime::difference(new \DateTime("2014-05-01"), new \DateTime("2014-04-01")); // 1 month ago -echo DateTime::difference(new \DateTime("2015-05-01"), new \DateTime("2014-04-01")); // 1 year ago -echo DateTime::difference(new \DateTime("2014-05-01"), new \DateTime("2016-04-01")); // 2 years from now +use Coduo\PHPHumanizer\DateTimeHumanizer; + +DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:00:00")); // just now +DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:00:05")); // 5 seconds from now +DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:59:00")); // 1 minute ago +DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:45:00")); // 15 minutes ago +DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:15:00")); // 15 minutes from now +DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 14:00:00")); // 1 hour from now +DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 15:00:00")); // 2 hours from now +DateTimeHumanizer::difference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:00:00")); // 1 hour ago +DateTimeHumanizer::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-25")); // 1 day ago +DateTimeHumanizer::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-24")); // 2 days ago +DateTimeHumanizer::difference(new \DateTime("2014-04-26"), new \DateTime("2014-04-28")); // 2 days from now +DateTimeHumanizer::difference(new \DateTime("2014-04-01"), new \DateTime("2014-04-15")); // 2 weeks from now +DateTimeHumanizer::difference(new \DateTime("2014-04-15"), new \DateTime("2014-04-07")); // 1 week ago +DateTimeHumanizer::difference(new \DateTime("2014-01-01"), new \DateTime("2014-04-01")); // 3 months from now +DateTimeHumanizer::difference(new \DateTime("2014-05-01"), new \DateTime("2014-04-01")); // 1 month ago +DateTimeHumanizer::difference(new \DateTime("2015-05-01"), new \DateTime("2014-04-01")); // 1 year ago +DateTimeHumanizer::difference(new \DateTime("2014-05-01"), new \DateTime("2016-04-01")); // 2 years from now ``` **Precise difference** ```php -use Coduo\PHPHumanizer\DateTime; +use Coduo\PHPHumanizer\DateTimeHumanizer; -echo DateTime::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-25 11:20:00")); // 1 day, 1 hour, 40 minutes ago -echo DateTime::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2015-04-28 17:00:00")); // 1 year, 2 days, 4 hours from now -echo DateTime::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2016-04-27 13:00:00")); // 2 years, 1 day from now +DateTimeHumanizer::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-25 11:20:00")); // 1 day, 1 hour, 40 minutes ago +DateTimeHumanizer::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2015-04-28 17:00:00")); // 1 year, 2 days, 4 hours from now +DateTimeHumanizer::preciseDifference(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2016-04-27 13:00:00")); // 2 years, 1 day from now +``` + +## Aeon Calendar + +[Aeon PHP](https://aeon-php.org/) is a date&time oriented set of libraries. + +```php +use Coduo\PHPHumanizer\DateTimeHumanizer; + +$timeUnit = TimeUnit::days(2) + ->add(TimeUnit::hours(3)) + ->add(TimeUnit::minutes(25)) + ->add(TimeUnit::seconds(30)) + ->add(TimeUnit::milliseconds(200)); + +DateTimeHumanizer::timeUnit($timeUnit); // 2 days, 3 hours, 25 minutes, and 30.2 seconds ``` Currently we support following languages: +* [Azerbaijani](src/Coduo/PHPHumanizer/Resources/translations/difference.az.yml) * [English](src/Coduo/PHPHumanizer/Resources/translations/difference.en.yml) * [Polish](src/Coduo/PHPHumanizer/Resources/translations/difference.pl.yml) * [German](src/Coduo/PHPHumanizer/Resources/translations/difference.de.yml) @@ -194,6 +259,46 @@ Currently we support following languages: * [Português - Brasil](src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml) * [Italian](src/Coduo/PHPHumanizer/Resources/translations/difference.it.yml) * [Dutch](src/Coduo/PHPHumanizer/Resources/translations/difference.nl.yml) +* [Русский](src/Coduo/PHPHumanizer/Resources/translations/difference.ru.yml) +* [Norwegian](src/Coduo/PHPHumanizer/Resources/translations/difference.no.yml) +* [Afrikaans](src/Coduo/PHPHumanizer/Resources/translations/difference.af.yml) +* [Bulgarian](src/Coduo/PHPHumanizer/Resources/translations/difference.bg.yml) +* [Indonesian](src/Coduo/PHPHumanizer/Resources/translations/difference.id.yml) +* [Chinese Simplified](src/Coduo/PHPHumanizer/Resources/translations/difference.zh_CN.yml) +* [Chinese Taiwan](src/Coduo/PHPHumanizer/Resources/translations/difference.zh_TW.yml) +* [Spanish](src/Coduo/PHPHumanizer/Resources/translations/difference.es.yml) +* [Ukrainian](src/Coduo/PHPHumanizer/Resources/translations/difference.uk.yml) +* [Danish](src/Coduo/PHPHumanizer/Resources/translations/difference.da.yml) +* [Thai](src/Coduo/PHPHumanizer/Resources/translations/difference.th.yml) +* [Japanese](src/Coduo/PHPHumanizer/Resources/translations/difference.ja.yml) +* [Romanian](src/Coduo/PHPHumanizer/Resources/translations/difference.ro.yml) + +# Development + +After downloading library update dependencies: + +``` +composer update +``` + +In order to check lowest possible versions of dependencies add + +``` +composer update --prefer-lowest +```` + +Execute test suite: + +``` +composer run test +``` + +Run CS Fixer + +``` +composer run cs:php:fix +``` + # Credits diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 0000000..ab3a500 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,9 @@ +# Upgrade 1.0 to 2.0 + +* All classes are now marked as final in order to close extra extension points +* Renamed ``Coduo\PHPHumanizer\Collection`` into ``Coduo\PHPHumanizer\CollectionHumanizer`` +* Renamed ``Coduo\PHPHumanizer\DateTime`` into ``Coduo\PHPHumanizer\DateTimeHumanizer`` +* Renamed ``Coduo\PHPHumanizer\Number`` into ``Coduo\PHPHumanizer\NumberHumanizer`` +* Renamed ``Coduo\PHPHumanizer\String`` into ``Coduo\PHPHumanizer\StringHumanizer`` +* Replaced ``ordinalSuffix($number)`` method in ``Coduo\PHPHumanizer\Number\Ordinal\StrategyInterface`` with ``isPrefix()`` and ``ordinalIndicator($number)`` +* Dependency ``thunderer/shortcode`` was removed, now shortcode lib needs to be added to project \ No newline at end of file diff --git a/composer.json b/composer.json index ad08edc..ad191e7 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "coduo/php-humanizer", "type": "library", + "description": "Humanize values that are readable only for developers", "keywords": ["php", "humanize", "humanizer"], "license": "MIT", "authors": [ @@ -14,24 +15,49 @@ } ], "require": { - "php": ">=5.3.0", - "symfony/intl": "~2.3", - "symfony/config": "~2.3", - "symfony/translation": "~2.3", - "symfony/yaml": "~2.3" + "php": "~8.3 || ~8.4 || ~8.5", + "symfony/translation": "~5.4 || ~6.4 || ~7 || ~8" }, "require-dev": { - "phpspec/phpspec": "2.0.*" + "thunderer/shortcode": "^0.7", + "aeon-php/calendar": "^1.0" }, "config": { "bin-dir": "bin" }, "autoload": { - "psr-0": {"": "src"} + "psr-4": { + "": "src/" + } }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" + "autoload-dev": { + "psr-4": { + "": "tests/" } + }, + "suggest": { + "ext-intl": "Required if you are going to use humanizer with locales different than en_EN" + }, + "scripts": { + "build": [ + "@static:analyze", + "@test" + ], + "test": [ + "tools/vendor/bin/phpunit" + ], + "static:analyze": [ + "tools/vendor/bin/phpstan analyze -c phpstan.neon", + "tools/vendor/bin/php-cs-fixer fix --dry-run" + ], + "cs:php:fix": "tools/vendor/bin/php-cs-fixer fix", + "tools:install": "composer install --working-dir=./tools", + "tools:update": "composer update --working-dir=./tools", + "post-install-cmd": [ + "@tools:install" + ], + "post-update-cmd": [ + "@tools:update" + ] } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..d05e1a4 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,6 @@ +parameters: + level: max + paths: + - src + + tmpDir: var/phpstan/cache diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..9f54b7e --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,22 @@ + + + + + ./tests/ + + + + + + + + + + ./src/ + + + diff --git a/spec/Coduo/PHPHumanizer/Collection/FormatterSpec.php b/spec/Coduo/PHPHumanizer/Collection/FormatterSpec.php deleted file mode 100644 index 81164ef..0000000 --- a/spec/Coduo/PHPHumanizer/Collection/FormatterSpec.php +++ /dev/null @@ -1,48 +0,0 @@ -beConstructedWith($translator); - $translator->trans( - 'only_two', - array('%first%' => 'Michal', '%second%' => 'Norbert'), - 'oxford' - )->willReturn('Michal and Norbert'); - - $translator->transChoice( - 'comma_separated_with_limit', - 1, - array('%count%' => 1, "%list%" => 'Michal, Norbert'), - 'oxford' - )->willReturn('Michal, Norbert and 1 more'); - - $translator->trans( - 'comma_separated', - array("%list%" => 'Michal, Norbert', '%last%' => "Lukasz"), - 'oxford' - )->willReturn('Michal, Norbert and Lukasz'); - } - - function it_formats_two_elements() - { - $this->format(array("Michal", "Norbert"), null)->shouldReturn("Michal and Norbert"); - } - - function it_formats_elements_with_limit() - { - $this->format(array("Michal", "Norbert", "Lukasz"), 2)->shouldReturn("Michal, Norbert and 1 more"); - } - - function it_formats_elements_without_limit() - { - $this->format(array("Michal", "Norbert", "Lukasz"), null)->shouldReturn("Michal, Norbert and Lukasz"); - } -} diff --git a/spec/Coduo/PHPHumanizer/Collection/OxfordSpec.php b/spec/Coduo/PHPHumanizer/Collection/OxfordSpec.php deleted file mode 100644 index 0a6b56f..0000000 --- a/spec/Coduo/PHPHumanizer/Collection/OxfordSpec.php +++ /dev/null @@ -1,45 +0,0 @@ -formatter = new Formatter( - $translator->getWrappedObject() - ); - $this->beConstructedWith($this->formatter); - } - function it_returns_empty_string_when_collection_is_empty() - { - $this->format(array())->shouldReturn(''); - } - - function it_returns_collection_item_string_when_collection_has_one_element() - { - $this->format(array(new CollectionItem("Michal")))->shouldReturn('Michal'); - } -} - -class CollectionItem -{ - private $name; - - public function __construct($name) - { - $this->name = $name; - } - - public function __toString() - { - return $this->name; - } -} diff --git a/spec/Coduo/PHPHumanizer/CollectionSpec.php b/spec/Coduo/PHPHumanizer/CollectionSpec.php deleted file mode 100644 index 709b137..0000000 --- a/spec/Coduo/PHPHumanizer/CollectionSpec.php +++ /dev/null @@ -1,38 +0,0 @@ -oxford($example[0], $example[1])->shouldReturn($example[2]); - } - } - - function it_humanizes_collections_for_polish_locale() - { - $examples = array( - array(array("Michal"), null, 'Michal'), - array(array("Michal", "Norbert"), null, 'Michal i Norbert'), - array(array("Michal", "Norbert", "Lukasz"), 2, 'Michal, Norbert i 1 inny'), - array(array("Michal", "Norbert", "Lukasz", "Pawel"), 2, 'Michal, Norbert i 2 innych'), - ); - - foreach ($examples as $example) { - $this->oxford($example[0], $example[1], 'pl')->shouldReturn($example[2]); - } - } -} diff --git a/spec/Coduo/PHPHumanizer/DateTime/DifferenceSpec.php b/spec/Coduo/PHPHumanizer/DateTime/DifferenceSpec.php deleted file mode 100644 index dc41b9e..0000000 --- a/spec/Coduo/PHPHumanizer/DateTime/DifferenceSpec.php +++ /dev/null @@ -1,106 +0,0 @@ -beConstructedWith(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 12:45:00")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Minute'); - $this->getQuantity()->shouldReturn(15); - $this->isPast()->shouldReturn(true); - } - - function it_calculate_diff_between_present_and_future_date_in_minutes() - { - $this->beConstructedWith(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 13:15:00")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Minute'); - $this->getQuantity()->shouldReturn(15); - $this->isPast()->shouldReturn(false); - } - - function it_calculate_diff_between_present_and_past_date_in_hours() - { - $this->beConstructedWith(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 11:00:00")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Hour'); - $this->getQuantity()->shouldReturn(2); - $this->isPast()->shouldReturn(true); - } - - function it_calculate_diff_between_present_and_future_date_in_hours() - { - $this->beConstructedWith(new \DateTime("2014-04-26 13:00:00"), new \DateTime("2014-04-26 16:00:00")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Hour'); - $this->getQuantity()->shouldReturn(3); - $this->isPast()->shouldReturn(false); - } - - function it_calculate_diff_between_present_and_past_date_in_days() - { - $this->beConstructedWith(new \DateTime("2014-04-10"), new \DateTime("2014-04-09")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Day'); - $this->getQuantity()->shouldReturn(1); - $this->isPast()->shouldReturn(true); - } - - function it_calculate_diff_between_present_and_future_date_in_days() - { - $this->beConstructedWith(new \DateTime("2014-04-10"), new \DateTime("2014-04-11")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Day'); - $this->getQuantity()->shouldReturn(1); - $this->isPast()->shouldReturn(false); - } - - function it_calculate_diff_between_present_and_past_date_in_weeks() - { - $this->beConstructedWith(new \DateTime("2014-04-15"), new \DateTime("2014-04-01")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Week'); - $this->getQuantity()->shouldReturn(2); - $this->isPast()->shouldReturn(true); - } - - function it_calculate_diff_between_present_and_future_date_in_weeks() - { - $this->beConstructedWith(new \DateTime("2014-04-01"), new \DateTime("2014-04-15")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Week'); - $this->getQuantity()->shouldReturn(2); - $this->isPast()->shouldReturn(false); - } - - function it_calculate_diff_between_present_and_past_date_in_months() - { - $this->beConstructedWith(new \DateTime("2014-04-01"), new \DateTime("2014-03-01")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Month'); - $this->getQuantity()->shouldReturn(1); - $this->isPast()->shouldReturn(true); - } - - function it_calculate_diff_between_present_and_future_date_in_months() - { - $this->beConstructedWith(new \DateTime("2014-04-01"), new \DateTime("2014-05-01")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Month'); - $this->getQuantity()->shouldReturn(1); - $this->isPast()->shouldReturn(false); - } - - function it_calculate_diff_between_present_and_past_date_in_years() - { - $this->beConstructedWith(new \DateTime("2014-01-01"), new \DateTime("2012-01-01")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Year'); - $this->getQuantity()->shouldReturn(2); - $this->isPast()->shouldReturn(true); - } - - function it_calculate_diff_between_present_and_future_date_in_years() - { - $this->beConstructedWith(new \DateTime("2014-01-01"), new \DateTime("2015-01-01")); - $this->getUnit()->shouldReturnAnInstanceOf('Coduo\PHPHumanizer\DateTime\Unit\Year'); - $this->getQuantity()->shouldReturn(1); - $this->isPast()->shouldReturn(false); - } -} diff --git a/spec/Coduo/PHPHumanizer/DateTime/FormatterSpec.php b/spec/Coduo/PHPHumanizer/DateTime/FormatterSpec.php deleted file mode 100644 index 97e08d8..0000000 --- a/spec/Coduo/PHPHumanizer/DateTime/FormatterSpec.php +++ /dev/null @@ -1,48 +0,0 @@ -beConstructedWith($translator); - $translator->transChoice( - 'minute.past', - 10, - array('%count%' => 10), - 'difference', - 'en' - )->willReturn('10 minutes ago'); - - $translator->transChoice( - 'minute.past', - 10, - array('%count%' => 10), - 'difference', - 'pl' - )->willReturn('10 minut temu'); - } - - function it_format_datetime_diff(Difference $diff) - { - $diff->getUnit()->willReturn(new Minute()); - $diff->getQuantity()->willReturn(10); - $diff->isPast()->willReturn(true); - $this->formatDifference($diff)->shouldReturn('10 minutes ago'); - } - - function it_format_datetime_diff_for_specific_locale(Difference $diff) - { - $diff->getUnit()->willReturn(new Minute()); - $diff->getQuantity()->willReturn(10); - $diff->isPast()->willReturn(true); - $this->formatDifference($diff, 'pl')->shouldReturn('10 minut temu'); - } -} diff --git a/spec/Coduo/PHPHumanizer/DateTimeSpec.php b/spec/Coduo/PHPHumanizer/DateTimeSpec.php deleted file mode 100644 index 009cd8b..0000000 --- a/spec/Coduo/PHPHumanizer/DateTimeSpec.php +++ /dev/null @@ -1,302 +0,0 @@ -difference(new \DateTime($example[0]), new \DateTime($example[1]))->shouldReturn($example[2]); - } - } - - function it_humanize_difference_between_dates_for_pl_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 13:00:00", 'w tym momencie'), - array("2014-04-26 13:00:00", "2014-04-26 13:00:05", 'za 5 sekund'), - array("2014-04-26 13:00:00", "2014-04-26 12:59:00", 'minutę temu'), - array("2014-04-26 13:00:00", "2014-04-26 12:45:00", '15 minut temu'), - array("2014-04-26 13:00:00", "2014-04-26 13:15:00", 'za 15 minut'), - array("2014-04-26 13:00:00", "2014-04-26 14:00:00", 'za godzinę'), - array("2014-04-26 13:00:00", "2014-04-26 15:00:00", 'za 2 godziny'), - array("2014-04-26 13:00:00", "2014-04-26 12:00:00", 'godzinę temu'), - array("2014-04-26 13:00:00", "2014-04-26 15:00:00", 'za 2 godziny'), - array("2014-04-26 13:00:00", "2014-04-26 12:00:00", 'godzinę temu'), - array("2014-04-26", "2014-04-25", 'wczoraj'), - array("2014-04-26", "2014-04-24", '2 dni temu'), - array("2014-04-26", "2014-04-28", 'za 2 dni'), - array("2014-04-01", "2014-04-15", 'za 2 tygodnie'), - array("2014-04-15", "2014-04-07", 'tydzień temu'), - array("2014-01-01", "2014-04-01", 'za 3 miesiące'), - array("2014-05-01", "2014-04-01", 'miesiąc temu'), - array("2015-05-01", "2014-04-01", 'rok temu'), - array("2014-05-01", "2016-04-01", 'za 2 lata'), - array("2014-05-01", "2009-04-01", '5 lat temu'), - ); - - foreach ($examples as $example) { - $this->difference(new \DateTime($example[0]), new \DateTime($example[1]), 'pl')->shouldReturn($example[2]); - } - } - - function it_humanize_difference_between_dates_for_af_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 13:00:00", 'nou nou'), - array("2014-04-26 13:00:00", "2014-04-26 13:00:05", '5 sekondes van nou af'), - array("2014-04-26 13:00:00", "2014-04-26 12:59:00", '1 minuut gelede'), - array("2014-04-26 13:00:00", "2014-04-26 12:45:00", '15 minute gelede'), - array("2014-04-26 13:00:00", "2014-04-26 13:15:00", '15 minute van nou af'), - array("2014-04-26 13:00:00", "2014-04-26 14:00:00", '1 uur van nou af'), - array("2014-04-26 13:00:00", "2014-04-26 15:00:00", '2 ure van nou af'), - array("2014-04-26 13:00:00", "2014-04-26 12:00:00", '1 uur gelede'), - array("2014-04-26 13:00:00", "2014-04-26 11:00:00", '2 ure gelede'), - array("2014-04-26 13:00:00", "2014-04-26 12:00:00", '1 uur gelede'), - array("2014-04-26", "2014-04-25", '1 dag gelede'), - array("2014-04-26", "2014-04-24", '2 dae gelede'), - array("2014-04-26", "2014-04-28", '2 dae van nou af'), - array("2014-04-01", "2014-04-15", '2 weke van nou af'), - array("2014-04-15", "2014-04-07", '1 week gelede'), - array("2014-01-01", "2014-04-01", '3 maande van nou af'), - array("2014-05-01", "2014-04-01", '1 maand gelede'), - array("2015-05-01", "2014-04-01", '1 jaar gelede'), - array("2014-05-01", "2016-04-01", '2 jaar van nou af'), - array("2014-05-01", "2009-04-01", '5 jaar gelede'), - ); - - foreach ($examples as $example) { - $this->difference(new \DateTime($example[0]), new \DateTime($example[1]), 'af')->shouldReturn($example[2]); - } - } - - function it_humanize_difference_between_dates_for_pt_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 13:00:00", 'agora'), - array("2014-04-26 13:00:00", "2014-04-26 13:00:05", '5 segundos a partir de agora'), - array("2014-04-26 13:00:00", "2014-04-26 12:59:00", '1 minuto atrás'), - array("2014-04-26 13:00:00", "2014-04-26 12:45:00", '15 minutos atrás'), - array("2014-04-26 13:00:00", "2014-04-26 13:15:00", '15 minutos a partir de agora'), - array("2014-04-26 13:00:00", "2014-04-26 14:00:00", '1 hora a partir de agora'), - array("2014-04-26 13:00:00", "2014-04-26 15:00:00", '2 horas a partir de agora'), - array("2014-04-26 13:00:00", "2014-04-26 12:00:00", '1 hora atrás'), - array("2014-04-26", "2014-04-25", '1 dia atrás'), - array("2014-04-26", "2014-04-24", '2 dias atrás'), - array("2014-04-26", "2014-04-28", '2 dias a partir de agora'), - array("2014-04-01", "2014-04-15", '2 semanas a partir de agora'), - array("2014-04-15", "2014-04-07", '1 semana atrás'), - array("2014-01-01", "2014-04-01", '3 meses a partir de agora'), - array("2014-05-01", "2014-04-01", '1 mês atrás'), - array("2015-05-01", "2014-04-01", '1 ano atrás'), - array("2014-05-01", "2016-04-01", '2 anos a partir de agora'), - ); - - foreach ($examples as $example) { - $this->difference(new \DateTime($example[0]), new \DateTime($example[1]), 'pt')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minute, 45 seconds ago'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 hour, 40 minutes ago'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 day, 15 minutes from now'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 days, 2 hours from now'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 year, 2 days, 4 hours from now'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 days, 10 hours from now'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 day, 1 hour, 40 minutes ago'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 years, 1 day from now'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]))->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_pl_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minuta, 45 sekund temu'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 godzina, 40 minut temu'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 dzień, 15 minut od teraz'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 dni, 2 godziny od teraz'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 rok, 2 dni, 4 godziny od teraz'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 dni, 10 godzin od teraz'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 dzień, 1 godzina, 40 minut temu'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 lata, 1 dzień od teraz'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'pl')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_af_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minuut, 45 sekondes gelede'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 uur, 40 minute gelede'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 dag, 15 minute van nou af'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 dae, 2 ure van nou af'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 jaar, 2 dae, 4 ure van nou af'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 dae, 10 ure van nou af'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 dag, 1 uur, 40 minute gelede'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 jaar, 1 dag van nou af'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'af')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_de_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 Minute, 45 Sekunden vor'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 Stunde, 40 Minuten vor'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 Tag, 15 Minuten ab jetzt'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 Tage, 2 Stunden ab jetzt'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 Jahr, 2 Tage, 4 Stunden ab jetzt'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 Tage, 10 Stunden ab jetzt'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 Tag, 1 Stunde, 40 Minuten vor'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 Jahre, 1 Tag ab jetzt'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'de')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_tr_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 dakika, 45 saniye önce'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 saat, 40 dakika önce'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 gün, 15 dakika sonra'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 gün, 2 saat sonra'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 yıl, 2 gün, 4 saat sonra'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 gün, 10 saat sonra'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 gün, 1 saat, 40 dakika önce'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 yıl, 1 gün sonra'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'tr')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_fr_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minute, 45 secondes il y a'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 heure, 40 minutes il y a'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 jour, 15 minutes maintenant'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 jours, 2 heures maintenant'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 année, 2 jours, 4 heures maintenant'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 jours, 10 heures maintenant'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 jour, 1 heure, 40 minutes il y a'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 années, 1 jour maintenant'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'fr')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_pt_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minuto, 45 segundos atrás'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 hora, 40 minutos atrás'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 dia, 15 minutos a partir de agora'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 dias, 2 horas a partir de agora'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 ano, 2 dias, 4 horas a partir de agora'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 dias, 10 horas a partir de agora'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 dia, 1 hora, 40 minutos atrás'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 anos, 1 dia a partir de agora'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'pt_BR')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_pt_BR_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minuto, 45 segundos atrás'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 hora, 40 minutos atrás'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 dia, 15 minutos a partir de agora'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 dias, 2 horas a partir de agora'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 ano, 2 dias, 4 horas a partir de agora'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 dias, 10 horas a partir de agora'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 dia, 1 hora, 40 minutos atrás'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 anos, 1 dia a partir de agora'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'pt_BR')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_it_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minuto, 45 secondi fa'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 ora, 40 minuti fa'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 giorno, 15 minuti da adesso'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 giorni, 2 ore da adesso'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 anno, 2 giorni, 4 ore da adesso'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 giorni, 10 ore da adesso'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 giorno, 1 ora, 40 minuti fa'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 anni, 1 giorno da adesso'), - ); - - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'it')->shouldReturn($example[2]); - } - } - - function it_humanizes_precise_difference_between_dates_for_no_locale() - { - $examples = array( - array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minutt, 45 sekunder siden'), - array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 time, 40 minutter siden'), - array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 dag, 15 minutter fra nå'), - array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 dager, 2 timer fra nå'), - array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 år, 2 dager, 4 timer fra nå'), - array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 dager, 10 timer fra nå'), - array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 dag, 1 time, 40 minutter siden'), - array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 år, 1 dag fra nå'), - ); - foreach ($examples as $example) { - $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'no')->shouldReturn($example[2]); - } - } -} diff --git a/spec/Coduo/PHPHumanizer/NumberSpec.php b/spec/Coduo/PHPHumanizer/NumberSpec.php deleted file mode 100644 index 6acaa24..0000000 --- a/spec/Coduo/PHPHumanizer/NumberSpec.php +++ /dev/null @@ -1,112 +0,0 @@ -ordinalize(1)->shouldReturn("1st"); - $this->ordinalize(2)->shouldReturn("2nd"); - $this->ordinalize(23)->shouldReturn("23rd"); - $this->ordinalize(1002)->shouldReturn("1002nd"); - $this->ordinalize(-111)->shouldReturn("-111th"); - } - - function it_returns_ordinal_suffix() - { - $this->ordinal(1)->shouldReturn("st"); - $this->ordinal(2)->shouldReturn("nd"); - $this->ordinal(23)->shouldReturn("rd"); - $this->ordinal(1002)->shouldReturn("nd"); - $this->ordinal(-111)->shouldReturn("th"); - } - - function it_convert_number_to_string_with_binary_suffix() - { - $this->binarySuffix(-1)->shouldReturn(-1); - $this->binarySuffix(0)->shouldReturn("0 bytes"); - $this->binarySuffix(1)->shouldReturn("1 bytes"); - $this->binarySuffix(1024)->shouldReturn("1 kB"); - $this->binarySuffix(1025)->shouldReturn("1 kB"); - $this->binarySuffix(1536)->shouldReturn("1.5 kB"); - $this->binarySuffix(1048576 * 5)->shouldReturn("5 MB"); - $this->binarySuffix(1073741824 * 2)->shouldReturn("2 GB"); - $this->binarySuffix(1099511627776 * 3)->shouldReturn("3 TB"); - $this->binarySuffix(1325899906842624)->shouldReturn("1.18 PB"); - } - - function it_convert_number_to_string_with_binary_suffix_for_specific_locale() - { - $this->binarySuffix(1536, 'pl')->shouldReturn("1,5 kB"); - $this->binarySuffix(1325899906842624, 'pl')->shouldReturn("1,18 PB"); - } - - function it_throw_exception_when_converting_to_string_with_binary_suffix_non_numeric_values() - { - $this->shouldThrow(new \InvalidArgumentException("Binary suffix converter accept only numeric values.")) - ->during('binarySuffix', array('as12')); - } - - function it_convert_number_to_string_with_metric_suffix() - { - $this->metricSuffix(-1)->shouldReturn("-1"); - $this->metricSuffix(0)->shouldReturn("0"); - $this->metricSuffix(1)->shouldReturn("1"); - $this->metricSuffix(101)->shouldReturn("101"); - $this->metricSuffix(1000)->shouldReturn("1k"); - $this->metricSuffix(1240)->shouldReturn("1.2k"); - $this->metricSuffix(1240000)->shouldReturn("1.24M"); - $this->metricSuffix(3500000)->shouldReturn("3.5M"); - } - - function it_convert_number_to_string_with_metric_suffix_for_specific_locale() - { - $this->metricSuffix(1240, 'pl')->shouldReturn("1,2k"); - $this->metricSuffix(1240000, 'pl')->shouldReturn("1,24M"); - $this->metricSuffix(3500000, 'pl')->shouldReturn("3,5M"); - } - - function it_throw_exception_when_converting_to_string_with_metric_suffix_non_numeric_values() - { - $this->shouldThrow(new \InvalidArgumentException("Metric suffix converter accept only numeric values.")) - ->during('metricSuffix', array('as12')); - } - - function it_converts_numbers_to_roman() - { - $this->toRoman(1)->shouldReturn("I"); - $this->toRoman(5)->shouldReturn("V"); - $this->toRoman(9)->shouldReturn("IX"); - $this->toRoman(10)->shouldReturn("X"); - $this->toRoman(125)->shouldReturn("CXXV"); - $this->toRoman(1300)->shouldReturn("MCCC"); - $this->toRoman(3999)->shouldReturn("MMMCMXCIX"); - } - - function it_throws_exception_when_converting_number_is_out_of_range() - { - $this->shouldThrow(new \InvalidArgumentException())->during('toRoman', array(-1)); - $this->shouldThrow(new \InvalidArgumentException())->during('toRoman', array(4000)); - } - - function it_converts_roman_numbers_to_arabic() - { - $this->fromRoman("I")->shouldReturn(1); - $this->fromRoman("V")->shouldReturn(5); - $this->fromRoman("IX")->shouldReturn(9); - $this->fromRoman("CXXV")->shouldReturn(125); - $this->fromRoman("MCCC")->shouldReturn(1300); - $this->fromRoman("MMMCMXCIX")->shouldReturn(3999); - } - - function it_throws_exception_when_converting_roman_number_is_invalid() - { - $this->shouldThrow(new \InvalidArgumentException())->during('fromRoman', array(1234)); - $this->shouldThrow(new \InvalidArgumentException())->during('fromRoman', array("")); - $this->shouldThrow(new \InvalidArgumentException())->during('fromRoman', array("foobar")); - } -} diff --git a/spec/Coduo/PHPHumanizer/StringSpec.php b/spec/Coduo/PHPHumanizer/StringSpec.php deleted file mode 100644 index 0143dc2..0000000 --- a/spec/Coduo/PHPHumanizer/StringSpec.php +++ /dev/null @@ -1,48 +0,0 @@ -humanize('news_count')->shouldReturn('News count'); - } - - function it_humanize_strings_without_capitalize() - { - $this->humanize('user', false)->shouldReturn('user'); - } - - function it_humanize_string_excluding_forbidden_words() - { - $this->humanize('news_id')->shouldReturn('News'); - } - - function it_truncate_string_to_word_closest_to_a_certain_number_of_characters() - { - $text = 'Lorem ipsum dolorem si amet, lorem ipsum. Dolorem sic et nunc.'; - - $this->truncate($text, 2)->shouldReturn("Lorem"); - $this->truncate($text, 10, '...')->shouldReturn("Lorem ipsum..."); - $this->truncate($text, 30)->shouldReturn("Lorem ipsum dolorem si amet, lorem"); - $this->truncate($text, 0)->shouldReturn("Lorem"); - $this->truncate($text, 0, '...')->shouldReturn("Lorem..."); - $this->truncate($text, -2)->shouldReturn($text); - - $textShort = 'Short text'; - $this->truncate($textShort, 1, '...')->shouldReturn("Short..."); - $this->truncate($textShort, 2, '...')->shouldReturn("Short..."); - $this->truncate($textShort, 3, '...')->shouldReturn("Short..."); - $this->truncate($textShort, 4, '...')->shouldReturn("Short..."); - $this->truncate($textShort, 5, '...')->shouldReturn("Short..."); - $this->truncate($textShort, 6, '...')->shouldReturn("Short..."); - $this->truncate($textShort, 7, '...')->shouldReturn("Short text"); - $this->truncate($textShort, 8, '...')->shouldReturn("Short text"); - $this->truncate($textShort, 9, '...')->shouldReturn("Short text"); - $this->truncate($textShort, 10, '...')->shouldReturn("Short text"); - } -} diff --git a/src/Coduo/PHPHumanizer/Aeon/Calendar/Formatter.php b/src/Coduo/PHPHumanizer/Aeon/Calendar/Formatter.php new file mode 100644 index 0000000..69e23a2 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Aeon/Calendar/Formatter.php @@ -0,0 +1,46 @@ +translator = $translator; + } + + public function timeUnit(Unit $unit, string $locale = 'en') : string + { + if (!\interface_exists('\Aeon\Calendar\Gregorian\Calendar')) { + throw new \RuntimeException('Please add "aeon-php/calendar": ^1.0 to composer.json first'); + } + + $parts = []; + + foreach ((new UnitCompound($unit))->components() as $component) { + $parts[] = $this->translator->trans( + 'compound.' . $component->getUnit()->getName(), + ['%count%' => $component->getQuantity()], + 'difference', + $locale + ); + } + + return CollectionHumanizer::oxford($parts, null, $locale); + } +} diff --git a/src/Coduo/PHPHumanizer/Aeon/Calendar/UnitCompound.php b/src/Coduo/PHPHumanizer/Aeon/Calendar/UnitCompound.php new file mode 100644 index 0000000..4d30794 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Aeon/Calendar/UnitCompound.php @@ -0,0 +1,89 @@ +unit = $timeUnit; + } + + /** + * @return array + */ + public function components() : array + { + if (!\interface_exists('\Aeon\Calendar\Gregorian\Calendar')) { + throw new \RuntimeException('Please add "aeon-php/calendar": ^1.0 to composer.json first'); + } + + $unit = $this->unit; + $compoundResults = []; + + if ($unit instanceof RelativeTimeUnit) { + if ($unit->inYears()) { + $compoundResults[] = new CompoundResult(new Year(), $unit->inYears()); + } + + if ($unit->inCalendarMonths()) { + $compoundResults[] = new CompoundResult(new Month(), $unit->inCalendarMonths()); + } + + return (new DateIntervalCompound($unit->toDateInterval()))->components(); + } + + if ($unit instanceof TimeUnit) { + if ($unit->inDaysAbs() > 0) { + $compoundResults[] = new CompoundResult(new Day(), $unit->inDaysAbs()); + } + + if ($unit->inTimeHours()) { + $compoundResults[] = new CompoundResult(new Hour(), $unit->inTimeHours()); + } + + if ($unit->inTimeMinutes()) { + $compoundResults[] = new CompoundResult(new Minute(), $unit->inTimeMinutes()); + } + + if ($unit->inTimeSeconds() || $unit->inTimeMilliseconds()) { + $seconds = $unit->inTimeSeconds(); + + if ($unit->inTimeMilliseconds() > 0) { + $seconds += $unit->inTimeMilliseconds() / 1000; + } + + $compoundResults[] = new CompoundResult(new Second(), $seconds); + } elseif (!\count($compoundResults)) { + $compoundResults[] = new CompoundResult(new Second(), 0); + } + + return $compoundResults; + } + + throw new \RuntimeException('Unsupported unit type ' . \get_class($unit)); + } +} diff --git a/src/Coduo/PHPHumanizer/Collection.php b/src/Coduo/PHPHumanizer/Collection.php deleted file mode 100644 index 101e013..0000000 --- a/src/Coduo/PHPHumanizer/Collection.php +++ /dev/null @@ -1,19 +0,0 @@ -format($collection, $limit); - } -} diff --git a/src/Coduo/PHPHumanizer/Collection/Formatter.php b/src/Coduo/PHPHumanizer/Collection/Formatter.php index 4a6a699..57c62e8 100644 --- a/src/Coduo/PHPHumanizer/Collection/Formatter.php +++ b/src/Coduo/PHPHumanizer/Collection/Formatter.php @@ -1,33 +1,38 @@ translator = $translator; $this->catalogue = $catalogue; } - public function format($collection, $limit = null) + /** + * @psalm-suppress RedundantCastGivenDocblockType + * + * @param array $collection + */ + public function format(array $collection, ?int $limit = null) : string { - $count = count($collection); + $count = \count($collection); if (0 === $count) { return ''; @@ -49,54 +54,47 @@ public function format($collection, $limit = null) } /** - * @param $collection - * @param $limit - * @param $count + * @psalm-suppress RedundantCastGivenDocblockType * - * @return string + * @param array $collection */ - private function formatCommaSeparatedWithLimit($collection, $limit, $count) + private function formatCommaSeparatedWithLimit(array $collection, ?int $limit, int $count) : string { - $display = array_map(function ($element) { - return (string) $element; - }, array_slice($collection, 0, $limit)); + $display = \array_map(fn ($element) => (string) $element, \array_slice($collection, 0, $limit)); - $moreCount = $count - count($display); + $moreCount = $count - \count($display); - return $this->translator->transChoice('comma_separated_with_limit', $moreCount, array( - '%list%' => implode(', ', $display), + return $this->translator->trans('comma_separated_with_limit', [ + '%list%' => \implode(', ', $display), '%count%' => $moreCount, - ), $this->catalogue); + ], $this->catalogue); } /** - * @param $collection - * @param $count + * @psalm-suppress RedundantCastGivenDocblockType * - * @return string + * @param array $collection */ - private function formatCommaSeparated($collection, $count) + private function formatCommaSeparated(array $collection, int $count) : string { - $display = array_map(function ($element) { - return (string) $element; - }, array_slice($collection, 0, $count - 1)); - - return $this->translator->trans('comma_separated', array( - '%list%' => implode(', ', $display), - '%last%' => (string) end($collection), - ), $this->catalogue); + $display = \array_map(fn ($element) => (string) $element, \array_slice($collection, 0, $count - 1)); + + return $this->translator->trans('comma_separated', [ + '%list%' => \implode(', ', $display), + '%last%' => (string) \end($collection), + ], $this->catalogue); } /** - * @param $collection + * @psalm-suppress RedundantCastGivenDocblockType * - * @return string + * @param array $collection */ - private function formatOnlyTwo($collection) + private function formatOnlyTwo(array $collection) : string { - return $this->translator->trans('only_two', array( + return $this->translator->trans('only_two', [ '%first%' => (string) $collection[0], '%second%' => (string) $collection[1], - ), $this->catalogue); + ], $this->catalogue); } } diff --git a/src/Coduo/PHPHumanizer/Collection/Oxford.php b/src/Coduo/PHPHumanizer/Collection/Oxford.php index 47d89f2..932a297 100644 --- a/src/Coduo/PHPHumanizer/Collection/Oxford.php +++ b/src/Coduo/PHPHumanizer/Collection/Oxford.php @@ -1,20 +1,29 @@ formatter = $formatter; } - public function format($collection, $limit = null) + /** + * @param array $collection + */ + public function format(array $collection, ?int $limit = null) : string { return $this->formatter->format($collection, $limit); } diff --git a/src/Coduo/PHPHumanizer/CollectionHumanizer.php b/src/Coduo/PHPHumanizer/CollectionHumanizer.php new file mode 100644 index 0000000..7077348 --- /dev/null +++ b/src/Coduo/PHPHumanizer/CollectionHumanizer.php @@ -0,0 +1,31 @@ + $collection + */ + public static function oxford(array $collection, ?int $limit = null, string $locale = 'en') : string + { + $oxford = new Oxford( + new Formatter(Builder::build($locale)) + ); + + return $oxford->format($collection, $limit); + } +} diff --git a/src/Coduo/PHPHumanizer/DateTime.php b/src/Coduo/PHPHumanizer/DateTime.php deleted file mode 100644 index 88b6aa3..0000000 --- a/src/Coduo/PHPHumanizer/DateTime.php +++ /dev/null @@ -1,26 +0,0 @@ -formatDifference(new Difference($fromDate, $toDate), $locale); - } - - public static function preciseDifference(\DateTime $fromDate, \DateTime $toDate, $locale = 'en') - { - $formatter = new PreciseFormatter(Builder::build($locale)); - - return $formatter->formatDifference(new PreciseDifference($fromDate, $toDate), $locale); - } -} diff --git a/src/Coduo/PHPHumanizer/DateTime/DateIntervalCompound.php b/src/Coduo/PHPHumanizer/DateTime/DateIntervalCompound.php new file mode 100644 index 0000000..7cfa582 --- /dev/null +++ b/src/Coduo/PHPHumanizer/DateTime/DateIntervalCompound.php @@ -0,0 +1,57 @@ +dateInterval = $dateInterval; + } + + /** + * @return array + */ + public function components() : array + { + /* @var Unit[] $units */ + $units = [ + new Year(), + new Month(), + new Day(), + new Hour(), + new Minute(), + new Second(), + ]; + + /** @var array $compoundResults */ + $compoundResults = []; + + foreach ($units as $unit) { + if ($this->dateInterval->{$unit->getDateIntervalSymbol()} > 0) { + $compoundResults[] = new CompoundResult($unit, (int) $this->dateInterval->{$unit->getDateIntervalSymbol()}); + } + } + + return $compoundResults; + } +} diff --git a/src/Coduo/PHPHumanizer/DateTime/Difference.php b/src/Coduo/PHPHumanizer/DateTime/Difference.php index a703081..713857e 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Difference.php +++ b/src/Coduo/PHPHumanizer/DateTime/Difference.php @@ -1,5 +1,14 @@ fromDate = $fromDate; $this->toDate = $toDate; $this->calculate(); } - /** - * @return Unit - */ - public function getUnit() + public function getUnit() : Unit { return $this->unit; } - /** - * @return int - */ - public function getQuantity() + public function getQuantity() : ?int { return $this->quantity; } - private function calculate() + public function isPast() : bool + { + $diff = $this->toDate->getTimestamp() - $this->fromDate->getTimestamp(); + + return ($diff > 0) ? false : true; + } + + private function calculate() : void { - /* @var $units \Coduo\PHPHumanizer\DateTime\Unit[] */ - $units = array( + /* @var $units Unit[] */ + $units = [ new Year(), new Month(), new Week(), @@ -68,25 +69,20 @@ private function calculate() new Minute(), new Second(), new JustNow(), - ); + ]; + + $absoluteMilliSecondsDiff = \abs($this->toDate->getTimestamp() - $this->fromDate->getTimestamp()) * 1000; - $absoluteMilliSecondsDiff = abs($this->toDate->getTimestamp() - $this->fromDate->getTimestamp()) * 1000; foreach ($units as $unit) { if ($absoluteMilliSecondsDiff >= $unit->getMilliseconds()) { $this->unit = $unit; + break; } } $this->quantity = ($absoluteMilliSecondsDiff == 0) ? $absoluteMilliSecondsDiff - : (int) round($absoluteMilliSecondsDiff / $this->unit->getMilliseconds()); - } - - public function isPast() - { - $diff = $this->toDate->getTimestamp() - $this->fromDate->getTimestamp(); - - return ($diff > 0) ? false : true; + : (int) \round($absoluteMilliSecondsDiff / $this->unit->getMilliseconds()); } } diff --git a/src/Coduo/PHPHumanizer/DateTime/Difference/CompoundResult.php b/src/Coduo/PHPHumanizer/DateTime/Difference/CompoundResult.php index af77a35..45e93fd 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Difference/CompoundResult.php +++ b/src/Coduo/PHPHumanizer/DateTime/Difference/CompoundResult.php @@ -1,51 +1,45 @@ unit = $unit; - $this->quantity = $quantity; - } - /** - * @param mixed $quantity + * @param float|int $quantity */ - public function setQuantity($quantity) + public function __construct(Unit $unit, $quantity) { + $this->unit = $unit; $this->quantity = $quantity; } /** - * @return mixed + * @return float|int */ public function getQuantity() { return $this->quantity; } - /** - * @param \Coduo\PHPHumanizer\DateTime\Unit $unit - */ - public function setUnit($unit) - { - $this->unit = $unit; - } - - /** - * @return \Coduo\PHPHumanizer\DateTime\Unit - */ - public function getUnit() + public function getUnit() : Unit { return $this->unit; } diff --git a/src/Coduo/PHPHumanizer/DateTime/Formatter.php b/src/Coduo/PHPHumanizer/DateTime/Formatter.php index 8b0ec7b..cbd5897 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Formatter.php +++ b/src/Coduo/PHPHumanizer/DateTime/Formatter.php @@ -1,38 +1,34 @@ translator = $translator; } - /** - * @param Difference $difference - * @param string $locale - * - * @return string - */ - public function formatDifference(Difference $difference, $locale = 'en') + public function formatDifference(Difference $difference, string $locale = 'en') : string { - $translationKey = sprintf('%s.%s', $difference->getUnit()->getName(), $difference->isPast() ? 'past' : 'future'); + $translationKey = \sprintf('%s.%s', $difference->getUnit()->getName(), $difference->isPast() ? 'past' : 'future'); - return $this->translator->transChoice( + return $this->translator->trans( $translationKey, - $difference->getQuantity(), - array('%count%' => $difference->getQuantity()), + ['%count%' => $difference->getQuantity()], 'difference', $locale ); diff --git a/src/Coduo/PHPHumanizer/DateTime/PreciseDifference.php b/src/Coduo/PHPHumanizer/DateTime/PreciseDifference.php index 9425d8e..6c28457 100644 --- a/src/Coduo/PHPHumanizer/DateTime/PreciseDifference.php +++ b/src/Coduo/PHPHumanizer/DateTime/PreciseDifference.php @@ -1,75 +1,46 @@ fromDate = $fromDate; $this->toDate = $toDate; - $this->calculate(); + $this->compoundResults = null; } /** - * @return \Coduo\PHPHumanizer\DateTime\Difference\CompoundResult[] + * @return array */ - public function getCompoundResults() - { - return $this->compoundResults; - } - - private function calculate() + public function components() : array { - /* @var $units \Coduo\PHPHumanizer\DateTime\Unit[] */ - $units = array( - new Year(), - new Month(), - new Day(), - new Hour(), - new Minute(), - new Second(), - ); - - $diff = $this->fromDate->diff($this->toDate); - - foreach ($units as $unit) { - if ($diff->{$unit->getDateIntervalSymbol()} > 0) { - $this->units[] = $unit; - $this->compoundResults[] = new CompoundResult($unit, $diff->{$unit->getDateIntervalSymbol()}); - } + if ($this->compoundResults === null) { + $this->compoundResults = new DateIntervalCompound($this->fromDate->diff($this->toDate)); } + + return $this->compoundResults->components(); } - public function isPast() + public function isPast() : bool { $diff = $this->toDate->getTimestamp() - $this->fromDate->getTimestamp(); diff --git a/src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php b/src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php index 251a93c..7ea5f64 100644 --- a/src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php +++ b/src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php @@ -1,45 +1,62 @@ translator = $translator; } - /** - * @param PreciseDifference $difference - * @param string $locale - * - * @return string - */ - public function formatDifference(PreciseDifference $difference, $locale = 'en') + public function formatDifference(PreciseDifference $difference, string $locale = 'en') : string + { + $diff = []; + + foreach ($difference->components() as $result) { + $diff[] = $this->translator->trans( + 'compound.' . $result->getUnit()->getName(), + ['%count%' => $result->getQuantity()], + 'difference', + $locale + ); + } + + return $this->translator->trans( + 'compound.' . ($difference->isPast() ? 'past' : 'future'), + ['%value%' => \implode(', ', $diff)], + 'difference', + $locale + ); + } + + public function formatInterval(\DateInterval $dateInterval, string $locale = 'en') : string { - $diff = array(); + $parts = []; - foreach ($difference->getCompoundResults() as $result) { - $diff[] = $this->translator->transChoice( - 'compound.'.$result->getUnit()->getName(), - $result->getQuantity(), - array('%count%' => $result->getQuantity()), + foreach ((new DateIntervalCompound($dateInterval))->components() as $component) { + $parts[] = $this->translator->trans( + 'compound.' . $component->getUnit()->getName(), + ['%count%' => $component->getQuantity()], 'difference', $locale ); } - $suffix = $difference->isPast() ? 'compound.ago' : 'compound.from_now'; - return implode(', ', $diff).' '.$this->translator->trans($suffix, array(), 'difference', $locale); + return CollectionHumanizer::oxford($parts, null, $locale); } } diff --git a/src/Coduo/PHPHumanizer/DateTime/Unit.php b/src/Coduo/PHPHumanizer/DateTime/Unit.php index 75681f5..294fd38 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Unit.php +++ b/src/Coduo/PHPHumanizer/DateTime/Unit.php @@ -1,25 +1,27 @@ getMilliseconds() * 24; } - public function getDateIntervalSymbol() + public function getDateIntervalSymbol() : string { return 'd'; } diff --git a/src/Coduo/PHPHumanizer/DateTime/Unit/Hour.php b/src/Coduo/PHPHumanizer/DateTime/Unit/Hour.php index dd33269..2cd2dc0 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Unit/Hour.php +++ b/src/Coduo/PHPHumanizer/DateTime/Unit/Hour.php @@ -1,27 +1,33 @@ getMilliseconds() * 60; } - public function getDateIntervalSymbol() + public function getDateIntervalSymbol() : string { return 'h'; } diff --git a/src/Coduo/PHPHumanizer/DateTime/Unit/JustNow.php b/src/Coduo/PHPHumanizer/DateTime/Unit/JustNow.php index 97b33df..ab5ef22 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Unit/JustNow.php +++ b/src/Coduo/PHPHumanizer/DateTime/Unit/JustNow.php @@ -1,25 +1,31 @@ getMilliseconds() * 60; } - public function getDateIntervalSymbol() + public function getDateIntervalSymbol() : string { return 'i'; } diff --git a/src/Coduo/PHPHumanizer/DateTime/Unit/Month.php b/src/Coduo/PHPHumanizer/DateTime/Unit/Month.php index 8f94e68..088582c 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Unit/Month.php +++ b/src/Coduo/PHPHumanizer/DateTime/Unit/Month.php @@ -1,27 +1,33 @@ getMilliseconds() * 30; } - public function getDateIntervalSymbol() + public function getDateIntervalSymbol() : string { return 'm'; } diff --git a/src/Coduo/PHPHumanizer/DateTime/Unit/Second.php b/src/Coduo/PHPHumanizer/DateTime/Unit/Second.php index 61c95c7..f207461 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Unit/Second.php +++ b/src/Coduo/PHPHumanizer/DateTime/Unit/Second.php @@ -1,25 +1,31 @@ getMilliseconds() * 7; } - public function getDateIntervalSymbol() + public function getDateIntervalSymbol() : string { throw new \RuntimeException("Week doesn't have date interval symbol equivalent"); } diff --git a/src/Coduo/PHPHumanizer/DateTime/Unit/Year.php b/src/Coduo/PHPHumanizer/DateTime/Unit/Year.php index d2185a0..63c49df 100644 --- a/src/Coduo/PHPHumanizer/DateTime/Unit/Year.php +++ b/src/Coduo/PHPHumanizer/DateTime/Unit/Year.php @@ -1,27 +1,33 @@ getMilliseconds() * 356; } - public function getDateIntervalSymbol() + public function getDateIntervalSymbol() : string { return 'y'; } diff --git a/src/Coduo/PHPHumanizer/DateTimeHumanizer.php b/src/Coduo/PHPHumanizer/DateTimeHumanizer.php new file mode 100644 index 0000000..12e75af --- /dev/null +++ b/src/Coduo/PHPHumanizer/DateTimeHumanizer.php @@ -0,0 +1,58 @@ +formatDifference(new Difference($fromDate, $toDate), $locale); + } + + public static function preciseDifference(\DateTimeInterface $fromDate, \DateTimeInterface $toDate, string $locale = 'en') : string + { + $formatter = new PreciseFormatter(Builder::build($locale)); + + return $formatter->formatDifference(new PreciseDifference($fromDate, $toDate), $locale); + } + + public static function timeUnit(Unit $unit, string $locale = 'en') : string + { + $formatter = new Aeon\Calendar\Formatter(Builder::build($locale)); + + return $formatter->timeUnit($unit, $locale); + } + + public static function timePeriod(TimePeriod $timePeriod, string $locale = 'en') : string + { + $formatter = new Formatter(Builder::build($locale)); + + return $formatter->formatDifference(new Difference($timePeriod->start()->toDateTimeImmutable(), $timePeriod->end()->toDateTimeImmutable()), $locale); + } + + public static function timePeriodPrecise(TimePeriod $timePeriod, string $locale = 'en') : string + { + $formatter = new PreciseFormatter(Builder::build($locale)); + + return $formatter->formatDifference(new PreciseDifference($timePeriod->start()->toDateTimeImmutable(), $timePeriod->end()->toDateTimeImmutable()), $locale); + } +} diff --git a/src/Coduo/PHPHumanizer/Number.php b/src/Coduo/PHPHumanizer/Number.php deleted file mode 100644 index 560ed86..0000000 --- a/src/Coduo/PHPHumanizer/Number.php +++ /dev/null @@ -1,49 +0,0 @@ -convert(); - } - - public static function metricSuffix($number, $locale = 'en') - { - $binarySuffix = new MetricSuffix($number, $locale); - - return $binarySuffix->convert(); - } - - public static function toRoman($number) - { - $romanNumeral = new RomanNumeral(); - - return $romanNumeral->toRoman($number); - } - - public function fromRoman($number) - { - $romanNumeral = new RomanNumeral(); - - return $romanNumeral->fromRoman($number); - } -} diff --git a/src/Coduo/PHPHumanizer/Number/Ordinal.php b/src/Coduo/PHPHumanizer/Number/Ordinal.php index f1ae6be..08ae954 100644 --- a/src/Coduo/PHPHumanizer/Number/Ordinal.php +++ b/src/Coduo/PHPHumanizer/Number/Ordinal.php @@ -1,35 +1,47 @@ number = $number; + $this->strategy = Builder::build($locale); + } + + public function __toString() : string + { + return $this + ->strategy + ->ordinalIndicator($this->number); } - public function __toString() + public function isPrefix() : bool { - $absNumber = abs((integer) $this->number); - - if (in_array(($absNumber % 100), array(11, 12, 13))) { - return 'th'; - } - - switch ($absNumber % 10) { - case 1: return 'st'; - case 2: return 'nd'; - case 3: return 'rd'; - default: return 'th'; - } + return $this->strategy->isPrefix(); } } diff --git a/src/Coduo/PHPHumanizer/Number/Ordinal/Builder.php b/src/Coduo/PHPHumanizer/Number/Ordinal/Builder.php new file mode 100644 index 0000000..cc55af1 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Number/Ordinal/Builder.php @@ -0,0 +1,48 @@ + + */ + private array $map = [ 'M' => 1000, 'CM' => 900, 'D' => 500, @@ -22,16 +45,16 @@ class RomanNumeral 'V' => 5, 'IV' => 4, 'I' => 1, - ); + ]; /** - * @param $number - * - * @return string + * @param numeric $number * * @throws \InvalidArgumentException + * + * @return string */ - public function toRoman($number) + public function toRoman($number) : string { if (($number < self::MIN_VALUE) || ($number > self::MAX_VALUE)) { throw new \InvalidArgumentException(); @@ -44,6 +67,7 @@ public function toRoman($number) if ($number >= $value) { $romanString .= $key; $number -= $value; + break; } } @@ -53,30 +77,28 @@ public function toRoman($number) } /** - * @param $string - * - * @return int - * * @throws \InvalidArgumentException + * + * @return float|int */ - public function fromRoman($string) + public function fromRoman(string $string) { - if (strlen($string) === 0 || 0 === preg_match(self::ROMAN_STRING_MATCHER, $string)) { + if (\mb_strlen($string) === 0 || 0 === \preg_match(self::ROMAN_STRING_MATCHER, $string)) { throw new \InvalidArgumentException(); } $total = 0; - $i = strlen($string); + $i = \mb_strlen($string); while ($i > 0) { - $digit = $this->map[$string{--$i}]; + $digit = $this->map[$string[--$i]]; if ($i > 0) { - $previousDigit = $this->map[$string{$i - 1}]; + $previousDigit = $this->map[$string[$i - 1]]; if ($previousDigit < $digit) { $digit -= $previousDigit; - --$i; + $i--; } } diff --git a/src/Coduo/PHPHumanizer/NumberHumanizer.php b/src/Coduo/PHPHumanizer/NumberHumanizer.php new file mode 100644 index 0000000..c18d714 --- /dev/null +++ b/src/Coduo/PHPHumanizer/NumberHumanizer.php @@ -0,0 +1,101 @@ +isPrefix()) ? $ordinal . $number : $number . $ordinal; + } + + /** + * @param float|int $number + * @param string $locale + * + * @return string + */ + public static function ordinal($number, string $locale = 'en') : string + { + $ordinal = new Ordinal($number, $locale); + + return (string) $ordinal; + } + + /** + * @param int $number + * @param string $locale + * + * @return bool|int|string + */ + public static function binarySuffix(int $number, string $locale = 'en') + { + $binarySuffix = new BinarySuffix($number, $locale); + + return $binarySuffix->convert(); + } + + /** + * @return bool|int|string + */ + public static function preciseBinarySuffix(int $number, ?int $precision, string $locale = 'en') + { + $binarySuffix = new BinarySuffix($number, $locale, $precision); + + return $binarySuffix->convert(); + } + + /** + * @param numeric $number + */ + public static function metricSuffix($number, string $locale = 'en') : string + { + $binarySuffix = new MetricSuffix($number, $locale); + + return $binarySuffix->convert(); + } + + /** + * @param numeric $number + * + * @return string + */ + public static function toRoman($number) : string + { + $romanNumeral = new RomanNumeral(); + + return $romanNumeral->toRoman($number); + } + + /** + * @return float|int + */ + public static function fromRoman(string $number) + { + $romanNumeral = new RomanNumeral(); + + return $romanNumeral->fromRoman($number); + } +} diff --git a/src/Coduo/PHPHumanizer/Resources/Ordinal/DeStrategy.php b/src/Coduo/PHPHumanizer/Resources/Ordinal/DeStrategy.php new file mode 100644 index 0000000..ca00924 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/Ordinal/DeStrategy.php @@ -0,0 +1,27 @@ + [ + 'past' => '[0,Inf] nou nou', + 'future' => '[0,Inf] netnou', + ], + 'second' => [ + 'past' => '[0,1] %count% sekonde gelede|[2,Inf] %count% sekondes gelede', + 'future' => '[0,1] %count% sekonde van nou af|[2,Inf] %count% sekondes van nou af', + ], + 'minute' => [ + 'past' => '{1} %count% minuut gelede|[2,Inf] %count% minute gelede', + 'future' => '{1} %count% minuut van nou af|[2,Inf] %count% minute van nou af', + ], + 'hour' => [ + 'past' => '{1} %count% uur gelede|[2,Inf] %count% ure gelede', + 'future' => '{1} %count% uur van nou af|[2,Inf] %count% ure van nou af', + ], + 'day' => [ + 'past' => '{1} %count% dag gelede|[2,Inf] %count% dae gelede', + 'future' => '{1} %count% dag van nou af|[2,Inf] %count% dae van nou af', + ], + 'week' => [ + 'past' => '{1} %count% week gelede|[2,Inf] %count% weke gelede', + 'future' => '{1} %count% week van nou af|[2,Inf] %count% weke van nou af', + ], + 'month' => [ + 'past' => '{1} %count% maand gelede|[2,Inf] %count% maande gelede', + 'future' => '{1} %count% maand van nou af|[2,Inf] %count% maande van nou af', + ], + 'year' => [ + 'past' => '{1} %count% jaar gelede|[2,Inf] %count% jaar gelede', + 'future' => '{1} %count% jaar van nou af|[2,Inf] %count% jaar van nou af', + ], + 'compound' => [ + 'second' => '[0,1] %count% sekonde|[2,Inf] %count% sekondes', + 'minute' => '{1} %count% minuut|[2,Inf] %count% minute', + 'hour' => '{1} %count% uur|[2,Inf] %count% ure', + 'day' => '{1} %count% dag|[2,Inf] %count% dae', + 'week' => '{1} %count% week|[2,Inf] %count% weke', + 'month' => '{1} %count% maand|[2,Inf] %count% maande', + 'year' => '{1} %count% jaar|[2,Inf] %count% jaar', + 'past' => '%value% gelede', + 'future' => '%value% van nou af', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.af.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.af.yml deleted file mode 100644 index 77c6ed7..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.af.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] nou nou" - future: "[0,Inf] netnou" -second: - past: "{1} %count% sekonde gelede|[2,Inf] %count% sekondes gelede" - future: "{1} %count% sekonde van nou af|[2,Inf] %count% sekondes van nou af" -minute: - past: "{1} %count% minuut gelede|[2,Inf] %count% minute gelede" - future: "{1} %count% minuut van nou af|[2,Inf] %count% minute van nou af" -hour: - past: "{1} %count% uur gelede|[2,Inf] %count% ure gelede" - future: "{1} %count% uur van nou af|[2,Inf] %count% ure van nou af" -day: - past: "{1} %count% dag gelede|[2,Inf] %count% dae gelede" - future: "{1} %count% dag van nou af|[2,Inf] %count% dae van nou af" -week: - past: "{1} %count% week gelede|[2,Inf] %count% weke gelede" - future: "{1} %count% week van nou af|[2,Inf] %count% weke van nou af" -month: - past: "{1} %count% maand gelede|[2,Inf] %count% maande gelede" - future: "{1} %count% maand van nou af|[2,Inf] %count% maande van nou af" -year: - past: "{1} %count% jaar gelede|[2,Inf] %count% jaar gelede" - future: "{1} %count% jaar van nou af|[2,Inf] %count% jaar van nou af" - -compound: - second: "{1} %count% sekonde|[2,Inf] %count% sekondes" - minute: "{1} %count% minuut|[2,Inf] %count% minute" - hour: "{1} %count% uur|[2,Inf] %count% ure" - day: "{1} %count% dag|[2,Inf] %count% dae" - week: "{1} %count% week|[2,Inf] %count% weke" - month: "{1} %count% maand|[2,Inf] %count% maande" - year: "{1} %count% jaar|[2,Inf] %count% jaar" - ago: "gelede" - from_now: "van nou af" diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.az.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.az.php new file mode 100644 index 0000000..99d7920 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.az.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] indi', + 'future' => '[0,Inf] indi', + ], + 'second' => [ + 'past' => '[0,1] %count% saniyə əvvəl|[2,Inf] %count% saniyə əvvəl', + 'future' => '[0,1] %count% saniyə sonra|[2,Inf] %count% saniyə sonra', + ], + 'minute' => [ + 'past' => '{1} %count% dəqiqə əvvəl|[2,Inf] %count% dəqiqə əvvəl', + 'future' => '{1} %count% dəqiqə sonra|[2,Inf] %count% dəqiqə sonra', + ], + 'hour' => [ + 'past' => '{1} %count% saat əvvəl|[2,Inf] %count% saat əvvəl', + 'future' => '{1} %count% saat sonra|[2,Inf] %count% saat sonra', + ], + 'day' => [ + 'past' => '{1} %count% gün əvvəl|[2,Inf] %count% gün əvvəl', + 'future' => '{1} %count% gün sonra|[2,Inf] %count% gün sonra', + ], + 'week' => [ + 'past' => '{1} %count% həftə əvvəl|[2,Inf] %count% həftə əvvəl', + 'future' => '{1} %count% həftə sonra|[2,Inf] %count% həftə sonra', + ], + 'month' => [ + 'past' => '{1} %count% ay əvvəl|[2,Inf] %count% ay əvvəl', + 'future' => '{1} %count% ay sonra|[2,Inf] %count% ay sonra', + ], + 'year' => [ + 'past' => '{1} %count% il əvvəl|[2,Inf] %count% il əvvəl', + 'future' => '{1} %count% il sonra|[2,Inf] %count% il sonra', + ], + 'compound' => [ + 'second' => '[0,1] %count% saniyə|[2,Inf] %count% saniyə', + 'minute' => '{1} %count% dəqiqə|[2,Inf] %count% dəqiqə', + 'hour' => '{1} %count% saat|[2,Inf] %count% saat', + 'day' => '{1} %count% gün|[2,Inf] %count% gün', + 'week' => '{1} %count% həftə|[2,Inf] %count% həftə', + 'month' => '{1} %count% ay|[2,Inf] %count% ay', + 'year' => '{1} %count% il|[2,Inf] %count% il', + 'past' => '%value% əvvəl', + 'future' => '%value% sonra', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.bg.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.bg.php new file mode 100644 index 0000000..5f8c92e --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.bg.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] в момента', + 'future' => '[0,Inf] в момента', + ], + 'second' => [ + 'past' => '[0,1] преди %count% секунда|[2,Inf] преди %count% секунди', + 'future' => '[0,1] след %count% секунда|[2,Inf] след %count% секунди', + ], + 'minute' => [ + 'past' => '{1} преди %count% минута|[2,Inf] преди %count% минути', + 'future' => '{1} след %count% минута|[2,Inf] след %count% минути', + ], + 'hour' => [ + 'past' => '{1} преди %count% час|[2,Inf] преди %count% часа', + 'future' => '{1} след %count% час|[2,Inf] след %count% часа', + ], + 'day' => [ + 'past' => '{1} преди %count% ден|[2,Inf] преди %count% дни', + 'future' => '{1} след %count% ден|[2,Inf] след %count% дни', + ], + 'week' => [ + 'past' => '{1} преди %count% седмица|[2,Inf] преди %count% седмици', + 'future' => '{1} след %count% седмица|[2,Inf] след %count% седмици', + ], + 'month' => [ + 'past' => '{1} преди %count% месец|[2,Inf] преди %count% месеца', + 'future' => '{1} след %count% месец|[2,Inf] след %count% месеца', + ], + 'year' => [ + 'past' => '{1} преди %count% година|[2,Inf] преди %count% години', + 'future' => '{1} след %count% година|[2,Inf] след %count% години', + ], + 'compound' => [ + 'second' => '[0,1] %count% секунда|[2,Inf] %count% секунди', + 'minute' => '{1} %count% минута|[2,Inf] %count% минути', + 'hour' => '{1} %count% час|[2,Inf] %count% часа', + 'day' => '{1} %count% ден|[2,Inf] %count% дни', + 'week' => '{1} %count% седмица|[2,Inf] %count% седмица', + 'month' => '{1} %count% месец|[2,Inf] %count% месеца', + 'year' => '{1} %count% година|[2,Inf] %count% години', + 'past' => '%value% преди това', + 'future' => '%value% след това', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.cs.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.cs.php new file mode 100644 index 0000000..5417a4a --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.cs.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] právě teď', + 'future' => '[0,Inf] právě teď', + ], + 'second' => [ + 'past' => '{1} před vteřinou|[2, 4] před %count% vteřinami|[5,Inf] před %count% vteřinami', + 'future' => '{1} za vteřinu|[2, 4] za %count% vteřiny|[5,Inf] za %count% vteřin', + ], + 'minute' => [ + 'past' => '{1} před minutou|[2, Inf] před %count% minutami', + 'future' => '{1} za minutu|[2, 4] za %count% minuty|[5,Inf] za %count% minut', + ], + 'hour' => [ + 'past' => '{1} před hodinou|[2, Inf] před %count% hodinami', + 'future' => '{1} za hodinu|[2, 4] za %count% hodiny|[5,Inf] za %count% hodin', + ], + 'day' => [ + 'past' => '{1} včera|[2, Inf] před %count% dny', + 'future' => '{1} zítra|[2, 4] za %count% dny|[5,Inf] za %count% dní', + ], + 'week' => [ + 'past' => '{1} minulý týden|[2, Inf] před %count% týdny', + 'future' => '{1} za týden|[2, 4] za %count% týdny|[5,Inf] za %count% týdnů', + ], + 'month' => [ + 'past' => '{1} minulý měsíc|[2, Inf] před %count% měsíci', + 'future' => '{1} za měsíc|[2, 4] za %count% měsíce|[5,Inf] za %count% měsíců', + ], + 'year' => [ + 'past' => '{1} minulý rok|[2, Inf] před %count% lety', + 'future' => '{1} za rok|[2, 4] za %count% roky|[5,Inf] za %count% let', + ], + 'compound' => [ + 'second' => '{1} %count% vteřina |[2,4] %count% vteřiny|[5,Inf] %count% vteřin', + 'minute' => '{1} %count% minuta|[2,4] %count% minuty|[5,Inf] %count% minut', + 'hour' => '{1} %count% hodina|[2,4] %count% hodiny|[5,Inf] %count% hodin', + 'day' => '{1} %count% den |[2,4] %count% dny|[5,Inf] %count% dní', + 'week' => '{1} %count% týden|[2,4] %count% týdny|[5,Inf] %count% týdnů', + 'month' => '{1} %count% měsíc|[2,4] %count% měsíce|[5,Inf] %count% měsíců', + 'year' => '{1} %count% rok|[2,4] %count% roky|[5,Inf] %count% let', + 'past' => 'před %value% ', + 'future' => '%value% odteď', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.da.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.da.php new file mode 100644 index 0000000..e9feff4 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.da.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] lige nu', + 'future' => '[0,Inf] lige nu', + ], + 'second' => [ + 'past' => '[0,1] %count% sekund siden|[2,Inf] %count% sekunder siden', + 'future' => '[0,1] %count% sekund fra nu|[2,Inf] %count% sekunder fra nu', + ], + 'minute' => [ + 'past' => '{1} %count% minut siden|[2,Inf] %count% minutter siden', + 'future' => '{1} %count% minut fra nu|[2,Inf] %count% minutter fra nu', + ], + 'hour' => [ + 'past' => '{1} %count% time siden|[2,Inf] %count% timer siden', + 'future' => '{1} %count% time fra nu|[2,Inf] %count% timer fra nu', + ], + 'day' => [ + 'past' => '{1} %count% dag siden|[2,Inf] %count% dage siden', + 'future' => '{1} %count% dag fra nu|[2,Inf] %count% dage fra nu', + ], + 'week' => [ + 'past' => '{1} %count% uge siden|[2,Inf] %count% uger siden', + 'future' => '{1} %count% uge fra nu|[2,Inf] %count% uger fra nu', + ], + 'month' => [ + 'past' => '{1} %count% måned siden|[2,Inf] %count% måneder siden', + 'future' => '{1} %count% måned fra nu|[2,Inf] %count% måneder fra nu', + ], + 'year' => [ + 'past' => '{1} %count% år siden|[2,Inf] %count% år siden', + 'future' => '{1} %count% år fra nu|[2,Inf] %count% år fra nu', + ], + 'compound' => [ + 'second' => '[0,1] %count% sekund|[2,Inf] %count% sekunder', + 'minute' => '{1} %count% minut|[2,Inf] %count% minutter', + 'hour' => '{1} %count% time|[2,Inf] %count% timer', + 'day' => '{1} %count% dag|[2,Inf] %count% dage', + 'week' => '{1} %count% uge|[2,Inf] %count% uger', + 'month' => '{1} %count% måned|[2,Inf] %count% måneder', + 'year' => '{1} %count% år|[2,Inf] %count% år', + 'past' => '%value% siden', + 'future' => '%value% fra nu', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.de.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.de.php new file mode 100644 index 0000000..cdf7808 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.de.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] jetzt gerade', + 'future' => '[0,Inf] jetzt gerade', + ], + 'second' => [ + 'past' => '[0,1] vor %count% Sekunde|[2,Inf] vor %count% Sekunden', + 'future' => '[0,1] in %count% Sekunde|[2,Inf] in %count% Sekunden', + ], + 'minute' => [ + 'past' => '{1} vor %count% Minute|[2,Inf] vor %count% Minuten', + 'future' => '{1} in %count% Minute|[2,Inf] in %count% Minuten', + ], + 'hour' => [ + 'past' => '{1} vor %count% Stunde|[2,Inf] vor %count% Stunden', + 'future' => '{1} in %count% Stunde|[2,Inf] in %count% Stunden', + ], + 'day' => [ + 'past' => '{1} vor %count% Tag|[2,Inf] vor %count% Tagen', + 'future' => '{1} in %count% Tag|[2,Inf] in %count% Tagen', + ], + 'week' => [ + 'past' => '{1} vor %count% Woche|[2,Inf] vor %count% Wochen', + 'future' => '{1} in %count% Woche|[2,Inf] in %count% Wochen', + ], + 'month' => [ + 'past' => '{1} vor %count% Monat|[2,Inf] vor %count% Monaten', + 'future' => '{1} in %count% Monat|[2,Inf] in %count% Monaten', + ], + 'year' => [ + 'past' => '{1} vor %count% Jahr|[2,Inf] vor %count% Jahren', + 'future' => '{1} in %count% Jahr|[2,Inf] in %count% Jahren', + ], + 'compound' => [ + 'second' => '[0,1] %count% Sekunde|[2,Inf] %count% Sekunden', + 'minute' => '{1} %count% Minute|[2,Inf] %count% Minuten', + 'hour' => '{1} %count% Stunde|[2,Inf] %count% Stunden', + 'day' => '{1} %count% Tag|[2,Inf] %count% Tagen', + 'week' => '{1} %count% Woche|[2,Inf] %count% Wochen', + 'month' => '{1} %count% Monat|[2,Inf] %count% Monaten', + 'year' => '{1} %count% Jahr|[2,Inf] %count% Jahren', + 'past' => 'vor %value%', + 'future' => 'in %value%', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.de.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.de.yml deleted file mode 100644 index 0dcc736..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.de.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] jetzt gerade" - future: "[0,Inf] jetzt gerade" -second: - past: "{1} vor %count% Sekunde|[2,Inf] vor %count% Sekunden" - future: "{1} in %count% Sekunde|[2,Inf] in %count% Sekunden" -minute: - past: "{1} vor %count% Minute|[2,Inf] vor %count% Minuten" - future: "{1} in %count% Minute|[2,Inf] in %count% Minuten" -hour: - past: "{1} vor %count% Stunde|[2,Inf] vor %count% Stunden" - future: "{1} in %count% Stunde|[2,Inf] in %count% Stunden" -day: - past: "{1} vor %count% Tag|[2,Inf] vor %count% Tagen" - future: "{1} in %count% Tag|[2,Inf] in %count% Tagen" -week: - past: "{1} vor %count% Woche|[2,Inf] vor %count% Wochen" - future: "{1} in %count% Woche|[2,Inf] in %count% Wochen" -month: - past: "{1} vor %count% Monat|[2,Inf] vor %count% Monaten" - future: "{1} in %count% Monat|[2,Inf] in %count% Monaten" -year: - past: "{1} vor %count% Jahr|[2,Inf] vor %count% Jahren" - future: "{1} in %count% Jahr|[2,Inf] in %count% Jahren" - -compound: - second: "{1} %count% Sekunde|[2,Inf] %count% Sekunden" - minute: "{1} %count% Minute|[2,Inf] %count% Minuten" - hour: "{1} %count% Stunde|[2,Inf] %count% Stunden" - day: "{1} %count% Tag|[2,Inf] %count% Tage" - week: "{1} %count% Woche|[2,Inf] %count% Wochen" - month: "{1} %count% Monat|[2,Inf] %count% Monate" - year: "{1} %count% Jahr|[2,Inf] %count% Jahre" - ago: "vor" - from_now: "ab jetzt" diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.en.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.en.php new file mode 100644 index 0000000..a677387 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.en.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] just now', + 'future' => '[0,Inf] just now', + ], + 'second' => [ + 'past' => '[0,1] %count% second ago|[2,Inf] %count% seconds ago', + 'future' => '[0,1] %count% second from now|[2,Inf] %count% seconds from now', + ], + 'minute' => [ + 'past' => '{1} %count% minute ago|[2,Inf] %count% minutes ago', + 'future' => '{1} %count% minute from now|[2,Inf] %count% minutes from now', + ], + 'hour' => [ + 'past' => '{1} %count% hour ago|[2,Inf] %count% hours ago', + 'future' => '{1} %count% hour from now|[2,Inf] %count% hours from now', + ], + 'day' => [ + 'past' => '{1} %count% day ago|[2,Inf] %count% days ago', + 'future' => '{1} %count% day from now|[2,Inf] %count% days from now', + ], + 'week' => [ + 'past' => '{1} %count% week ago|[2,Inf] %count% weeks ago', + 'future' => '{1} %count% week from now|[2,Inf] %count% weeks from now', + ], + 'month' => [ + 'past' => '{1} %count% month ago|[2,Inf] %count% months ago', + 'future' => '{1} %count% month from now|[2,Inf] %count% months from now', + ], + 'year' => [ + 'past' => '{1} %count% year ago|[2,Inf] %count% years ago', + 'future' => '{1} %count% year from now|[2,Inf] %count% years from now', + ], + 'compound' => [ + 'second' => '[0,1] %count% second|[2,Inf] %count% seconds', + 'minute' => '{1} %count% minute|[2,Inf] %count% minutes', + 'hour' => '{1} %count% hour|[2,Inf] %count% hours', + 'day' => '{1} %count% day|[2,Inf] %count% days', + 'week' => '{1} %count% week|[2,Inf] %count% weeks', + 'month' => '{1} %count% month|[2,Inf] %count% months', + 'year' => '{1} %count% year|[2,Inf] %count% years', + 'past' => '%value% ago', + 'future' => '%value% from now', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.en.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.en.yml deleted file mode 100644 index 6a7534a..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.en.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] just now" - future: "[0,Inf] just now" -second: - past: "{1} %count% second ago|[2,Inf] %count% seconds ago" - future: "{1} %count% second from now|[2,Inf] %count% seconds from now" -minute: - past: "{1} %count% minute ago|[2,Inf] %count% minutes ago" - future: "{1} %count% minute from now|[2,Inf] %count% minutes from now" -hour: - past: "{1} %count% hour ago|[2,Inf] %count% hours ago" - future: "{1} %count% hour from now|[2,Inf] %count% hours from now" -day: - past: "{1} %count% day ago|[2,Inf] %count% days ago" - future: "{1} %count% day from now|[2,Inf] %count% days from now" -week: - past: "{1} %count% week ago|[2,Inf] %count% weeks ago" - future: "{1} %count% week from now|[2,Inf] %count% weeks from now" -month: - past: "{1} %count% month ago|[2,Inf] %count% months ago" - future: "{1} %count% month from now|[2,Inf] %count% months from now" -year: - past: "{1} %count% year ago|[2,Inf] %count% years ago" - future: "{1} %count% year from now|[2,Inf] %count% years from now" - -compound: - second: "{1} %count% second|[2,Inf] %count% seconds" - minute: "{1} %count% minute|[2,Inf] %count% minutes" - hour: "{1} %count% hour|[2,Inf] %count% hours" - day: "{1} %count% day|[2,Inf] %count% days" - week: "{1} %count% week|[2,Inf] %count% weeks" - month: "{1} %count% month|[2,Inf] %count% months" - year: "{1} %count% year|[2,Inf] %count% years" - ago: "ago" - from_now: "from now" \ No newline at end of file diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.es.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.es.php new file mode 100644 index 0000000..5d3cfdd --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.es.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] ahora mismo', + 'future' => '[0,Inf] ahora mismo', + ], + 'second' => [ + 'past' => '[0,1] hace %count% segundo |[2,Inf] hace %count% segundos', + 'future' => '[0,1] dentro de %count% segundo|[2,Inf] dentro de %count% segundos', + ], + 'minute' => [ + 'past' => '{1} hace %count% minuto|[2,Inf] hace %count% minutos', + 'future' => '{1} dentro de %count% minuto|[2,Inf] dentro de %count% minutos', + ], + 'hour' => [ + 'past' => '{1} hace %count% hora|[2,Inf] hace %count% horas', + 'future' => '{1} dentro de %count% hora|[2,Inf] dentro de %count% horas', + ], + 'day' => [ + 'past' => '{1} hace %count% día|[2,Inf] hace %count% días', + 'future' => '{1} dentro de %count% día|[2,Inf] dentro de %count% días', + ], + 'week' => [ + 'past' => '{1} hace %count% semana|[2,Inf] hace %count% semanas', + 'future' => '{1} dentro de %count% semana|[2,Inf] dentro de %count% semanas', + ], + 'month' => [ + 'past' => '{1} hace %count% mes|[2,Inf] hace %count% meses', + 'future' => '{1} dentro de %count% mes|[2,Inf] dentro de %count% meses', + ], + 'year' => [ + 'past' => '{1} hace %count% año|[2,Inf] hace %count% años', + 'future' => '{1} dentro de %count% año|[2,Inf] dentro de %count% años', + ], + 'compound' => [ + 'second' => '[0,1] %count% segundo|[2,Inf] %count% segundos', + 'minute' => '{1} %count% minuto|[2,Inf] %count% minutos', + 'hour' => '{1} %count% hora|[2,Inf] %count% horas', + 'day' => '{1} %count% día|[2,Inf] %count% días', + 'week' => '{1} %count% semana|[2,Inf] %count% semanas', + 'month' => '{1} %count% mes|[2,Inf] %count% meses', + 'year' => '{1} %count% año|[2,Inf] %count% años', + 'past' => 'hace %value%', + 'future' => 'dentro de %value%', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.fr.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.fr.php new file mode 100644 index 0000000..33e71c2 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.fr.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] à l\'instant', + 'future' => '[0,Inf] à l\'instant', + ], + 'second' => [ + 'past' => '[0,1] il y a %count% seconde|[2,Inf] il y a %count% secondes', + 'future' => '[0,1] il y a maintenant %count% seconde|[2,Inf] il y a maintenant %count% secondes', + ], + 'minute' => [ + 'past' => '{1} il y a %count% minute|[2,Inf] il y a %count% minutes', + 'future' => '{1} il y a maintenant %count% minute|[2,Inf] il y a maintenant %count% minutes', + ], + 'hour' => [ + 'past' => '{1} il y a %count% heure|[2,Inf] il y a %count% heure', + 'future' => '{1} il y a maintenant %count% heure|[2,Inf] il y a maintenant %count% heures', + ], + 'day' => [ + 'past' => '{1} il y a %count% jour|[2,Inf] il y a %count% jours', + 'future' => '{1} il y a maintenant %count% jour|[2,Inf] il y a maintenant %count% jours', + ], + 'week' => [ + 'past' => '{1} il y a %count% semaine|[2,Inf] il y a %count% semaines', + 'future' => '{1} il y a maintenant %count% semaine|[2,Inf] il y a maintenant %count% semaines', + ], + 'month' => [ + 'past' => '{1} il y a %count% mois|[2,Inf] il y a %count% mois', + 'future' => '{1} %count% mois maintenant|[2,Inf] %count% mois maintenant', + ], + 'year' => [ + 'past' => '{1} il y a %count% année|[2,Inf] il y a %count% années', + 'future' => '{1} il y a maintenant %count% année|[2,Inf] il y a maintenant %count% années', + ], + 'compound' => [ + 'second' => '[0,1] %count% seconde|[2,Inf] %count% secondes', + 'minute' => '{1} %count% minute|[2,Inf] %count% minutes', + 'hour' => '{1} %count% heure|[2,Inf] %count% heures', + 'day' => '{1} %count% jour|[2,Inf] %count% jours', + 'week' => '{1} %count% semaine|[2,Inf] %count% semaines', + 'month' => '{1} %count% mois|[2,Inf] %count% mois', + 'year' => '{1} %count% année|[2,Inf] %count% années', + 'past' => '%value% il y a', + 'future' => '%value% maintenant', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.fr.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.fr.yml deleted file mode 100644 index b2163c9..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.fr.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] à l'instant" - future: "[0,Inf] à l'instant" -second: - past: "{1} il y a %count% seconde|[2,Inf] il y a %count% secondes" - future: "{1} il y a maintenant %count% seconde|[2,Inf] il y a maintenant %count% secondes" -minute: - past: "{1} il y a %count% minute|[2,Inf] il y'a %count% minutes" - future: "{1} il y a maintenant %count% minute|[2,Inf] il y a maintenant %count% minutes" -hour: - past: "{1} il y a %count% heure|[2,Inf] il y a %count% heure" - future: "{1} il y a maintenant %count% heure|[2,Inf] il y a maintenant %count% heures" -day: - past: "{1} il y a %count% jour|[2,Inf] il y a %count% jours" - future: "{1} il y a maintenant %count% jour|[2,Inf] il y a maintenant %count% jours" -week: - past: "{1} il y a %count% semaine|[2,Inf] il y a %count% semaines" - future: "{1} il y a maintenant %count% semaine|[2,Inf] il y a maintenant %count% semaines" -month: - past: "{1} il y a %count% mois|[2,Inf] il y a %count% mois" - future: "{1} %count% mois maintenant|[2,Inf] %count% mois maintenant" -year: - past: "{1} il y a %count% année|[2,Inf] il y a %count% années" - future: "{1} il y a maintenant %count% année|[2,Inf] il y a maintenant %count% années" - -compound: - second: "{1} %count% seconde|[2,Inf] %count% secondes" - minute: "{1} %count% minute|[2,Inf] %count% minutes" - hour: "{1} %count% heure|[2,Inf] %count% heures" - day: "{1} %count% jour|[2,Inf] %count% jours" - week: "{1} %count% semaine|[2,Inf] %count% semaines" - month: "{1} %count% mois|[2,Inf] %count% mois" - year: "{1} %count% année|[2,Inf] %count% années" - ago: "il y a" - from_now: "maintenant" diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.id.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.id.php new file mode 100644 index 0000000..2f8eecc --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.id.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] baru saja', + 'future' => '[0,Inf] baru saja', + ], + 'second' => [ + 'past' => '[0,1] %count% detik yang lalu|[2,Inf] %count% detik yang lalu', + 'future' => '[0,1] %count% detik dari sekarang|[2,Inf] %count% detik dari sekarang', + ], + 'minute' => [ + 'past' => '{1} %count% menit yang lalu|[2,Inf] %count% menit yang lalu', + 'future' => '{1} %count% menit dari sekarang|[2,Inf] %count% menit dari sekarang', + ], + 'hour' => [ + 'past' => '{1} %count% jam yang lalu|[2,Inf] %count% jam yang lalu', + 'future' => '{1} %count% jam dari sekarang|[2,Inf] %count% jam dari sekarang', + ], + 'day' => [ + 'past' => '{1} %count% hari yang lalu|[2,Inf] %count% hari yang lalu', + 'future' => '{1} %count% hari dari sekarang|[2,Inf] %count% hari dari sekarang', + ], + 'week' => [ + 'past' => '{1} %count% minggu yang lalu|[2,Inf] %count% minggu yang lalu', + 'future' => '{1} %count% minggu dari sekarang|[2,Inf] %count% minggu dari sekarang', + ], + 'month' => [ + 'past' => '{1} %count% bulan yang lalu|[2,Inf] %count% bulan yang lalu', + 'future' => '{1} %count% bulan dari sekarang|[2,Inf] %count% bulan dari sekarang', + ], + 'year' => [ + 'past' => '{1} %count% tahun yang lalu|[2,Inf] %count% tahun yang lalu', + 'future' => '{1} %count% tahun dari sekarang|[2,Inf] %count% tahun dari sekarang', + ], + 'compound' => [ + 'second' => '[0,1] %count% detik|[2,Inf] %count% detik', + 'minute' => '{1} %count% menit|[2,Inf] %count% menit', + 'hour' => '{1} %count% jam|[2,Inf] %count% jam', + 'day' => '{1} %count% hari|[2,Inf] %count% hari', + 'week' => '{1} %count% minggu|[2,Inf] %count% minggu', + 'month' => '{1} %count% bulan|[2,Inf] %count% bulan', + 'year' => '{1} %count% tahun|[2,Inf] %count% tahun', + 'past' => '%value% yang lalu', + 'future' => '%value% dari sekarang', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.it.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.it.php new file mode 100644 index 0000000..4389c53 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.it.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] adesso', + 'future' => '[0,Inf] adesso', + ], + 'second' => [ + 'past' => '[0,1] %count% secondo fa|[2,Inf] %count% secondi fa', + 'future' => '[0,1] %count% secondo da adesso|[2,Inf] %count% secondi da adesso', + ], + 'minute' => [ + 'past' => '{1} %count% minuto fa|[2,Inf] %count% minuti fa', + 'future' => '{1} %count% minuto da adesso|[2,Inf] %count% minuti da adesso', + ], + 'hour' => [ + 'past' => '{1} %count% ora fa|[2,Inf] %count% ore fa', + 'future' => '{1} %count% ora da adesso|[2,Inf] %count% ore da adesso', + ], + 'day' => [ + 'past' => '{1} %count% giorno fa|[2,Inf] %count% giorni fa', + 'future' => '{1} %count% giorno da adesso|[2,Inf] %count% giorni da adesso', + ], + 'week' => [ + 'past' => '{1} %count% settimana fa|[2,Inf] %count% settimane fa', + 'future' => '{1} %count% settimana da adesso|[2,Inf] %count% settimane da adesso', + ], + 'month' => [ + 'past' => '{1} %count% mese fa|[2,Inf] %count% mesi fa', + 'future' => '{1} %count% mese da adesso|[2,Inf] %count% mesi da adesso', + ], + 'year' => [ + 'past' => '{1} %count% anno fa|[2,Inf] %count% anni fa', + 'future' => '{1} %count% anno da adesso|[2,Inf] %count% anni da adesso', + ], + 'compound' => [ + 'second' => '[0,1] %count% secondo|[2,Inf] %count% secondi', + 'minute' => '{1} %count% minuto|[2,Inf] %count% minuti', + 'hour' => '{1} %count% ora|[2,Inf] %count% ore', + 'day' => '{1} %count% giorno|[2,Inf] %count% giorni', + 'week' => '{1} %count% settimana|[2,Inf] %count% settimane', + 'month' => '{1} %count% mese|[2,Inf] %count% mesi', + 'year' => '{1} %count% anno|[2,Inf] %count% anni', + 'past' => '%value% fa', + 'future' => '%value% da adesso', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.it.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.it.yml deleted file mode 100644 index ac3e622..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.it.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] adesso" - future: "[0,Inf] adesso" -second: - past: "{1} %count% secondo fa|[2,Inf] %count% secondi fa" - future: "{1} %count% secondo da adesso|[2,Inf] %count% secondi da adesso" -minute: - past: "{1} %count% minuto fa|[2,Inf] %count% minuti fa" - future: "{1} %count% minuto da adesso|[2,Inf] %count% minuti da adesso" -hour: - past: "{1} %count% ora fa|[2,Inf] %count% ore fa" - future: "{1} %count% ora da adesso|[2,Inf] %count% ore da adesso" -day: - past: "{1} %count% giorno fa|[2,Inf] %count% giorni fa" - future: "{1} %count% giorno da adesso|[2,Inf] %count% giorni da adesso" -week: - past: "{1} %count% settimana fa|[2,Inf] %count% settimane fa" - future: "{1} %count% settimana da adesso|[2,Inf] %count% settimane da adesso" -month: - past: "{1} %count% mese fa|[2,Inf] %count% mesi fa" - future: "{1} %count% mese da adesso|[2,Inf] %count% mesi da adesso" -year: - past: "{1} %count% anno fa|[2,Inf] %count% anni fa" - future: "{1} %count% anno da adesso|[2,Inf] %count% anni da adesso" - -compound: - second: "{1} %count% secondo|[2,Inf] %count% secondi" - minute: "{1} %count% minuto|[2,Inf] %count% minuti" - hour: "{1} %count% ora|[2,Inf] %count% ore" - day: "{1} %count% giorno|[2,Inf] %count% giorni" - week: "{1} %count% settimana|[2,Inf] %count% settimane" - month: "{1} %count% mese|[2,Inf] %count% mesi" - year: "{1} %count% anno|[2,Inf] %count% anni" - ago: "fa" - from_now: "da adesso" diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.ja.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.ja.php new file mode 100644 index 0000000..3960542 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.ja.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] たった今', + 'future' => '[0,Inf] たった今', + ], + 'second' => [ + 'past' => '[0,1] %count% 秒前|[2,Inf] %count% 秒前', + 'future' => '[0,1] %count% 秒後|[2,Inf] %count% 秒後', + ], + 'minute' => [ + 'past' => '{1} %count% 分前|[2,Inf] %count% 分前', + 'future' => '{1} %count% 分後|[2,Inf] %count% 分後', + ], + 'hour' => [ + 'past' => '{1} %count% 時間前|[2,Inf] %count% 時間前', + 'future' => '{1} %count% 時間後|[2,Inf] %count% 時間後', + ], + 'day' => [ + 'past' => '{1} %count% 日前|[2,Inf] %count% 日前', + 'future' => '{1} %count% 日後|[2,Inf] %count% 日後', + ], + 'week' => [ + 'past' => '{1} %count% 週間前|[2,Inf] %count% 週間前', + 'future' => '{1} %count% 週間後|[2,Inf] %count% 週間後', + ], + 'month' => [ + 'past' => '{1} %count% ヶ月前|[2,Inf] %count% ヶ月前', + 'future' => '{1} %count% ヶ月後|[2,Inf] %count% ヶ月後', + ], + 'year' => [ + 'past' => '{1} %count% 年前|[2,Inf] %count% 年前', + 'future' => '{1} %count% 年後|[2,Inf] %count% 年後', + ], + 'compound' => [ + 'second' => '[0,1] %count% 秒|[2,Inf] %count% 秒', + 'minute' => '{1} %count% 分|[2,Inf] %count% 分', + 'hour' => '{1} %count% 時間|[2,Inf] %count% 時間', + 'day' => '{1} %count% 日|[2,Inf] %count% 日', + 'week' => '{1} %count% 週間|[2,Inf] %count% 週間', + 'month' => '{1} %count% 月|[2,Inf] %count% 月', + 'year' => '{1} %count% 年|[2,Inf] %count% 年', + 'past' => '%value%前', + 'future' => '%value%後', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.nl.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.nl.php new file mode 100644 index 0000000..57851ca --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.nl.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] zojuist', + 'future' => '[0,Inf] zojuist', + ], + 'second' => [ + 'past' => '[0,1] %count% seconde geleden|[2,Inf] %count% seconden geleden', + 'future' => '[0,1] over %count% seconde|[2,Inf] over %count% seconden', + ], + 'minute' => [ + 'past' => '{1} %count% minuut geleden|[2,Inf] %count% minuten geleden', + 'future' => '{1} over %count% minuut|[2,Inf] over %count% minuten', + ], + 'hour' => [ + 'past' => '{1} %count% uur geleden|[2,Inf] %count% uren geleden', + 'future' => '{1} over %count% uur|[2,Inf] over %count% uren', + ], + 'day' => [ + 'past' => '{1} %count% dag geleden|[2,Inf] %count% dagen geleden', + 'future' => '{1} over %count% dag|[2,Inf] over %count% dagen', + ], + 'week' => [ + 'past' => '{1} %count% week geleden|[2,Inf] %count% weken geleden', + 'future' => '{1} over %count% week|[2,Inf] over %count% weken', + ], + 'month' => [ + 'past' => '{1} %count% maand geleden|[2,Inf] %count% maanden geleden', + 'future' => '{1} over %count% maand|[2,Inf] over %count% maanden', + ], + 'year' => [ + 'past' => '{1} %count% jaar geleden|[2,Inf] %count% jaren geleden', + 'future' => '{1} over %count% jaar|[2,Inf] over %count% jaren', + ], + 'compound' => [ + 'second' => '[0,1] %count% seconde|[2,Inf] %count% seconden', + 'minute' => '{1} %count% minuut|[2,Inf] %count% minuten', + 'hour' => '{1} %count% uur|[2,Inf] %count% uren', + 'day' => '{1} %count% dag|[2,Inf] %count% dagen', + 'week' => '{1} %count% week|[2,Inf] %count% weken', + 'month' => '{1} %count% maand|[2,Inf] %count% maanden', + 'year' => '{1} %count% jaar|[2,Inf] %count% jaren', + 'past' => '%value% geleden', + 'future' => '%value% vanaf nu', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.nl.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.nl.yml deleted file mode 100644 index 86aced4..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.nl.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] zojuist" - future: "[0,Inf] zojuist" -second: - past: "{1} %count% seconde geleden|[2,Inf] %count% seconden geleden" - future: "{1} over %count% seconde|[2,Inf] over %count% seconden" -minute: - past: "{1} %count% minuut geleden|[2,Inf] %count% minuten geleden" - future: "{1} over %count% minuut|[2,Inf] over %count% minuten" -hour: - past: "{1} %count% uur geleden|[2,Inf] %count% uren geleden" - future: "{1} over %count% uur|[2,Inf] over %count% uren" -day: - past: "{1} %count% dag geleden|[2,Inf] %count% dagen geleden" - future: "{1} over %count% dag|[2,Inf] over %count% dagen" -week: - past: "{1} %count% week geleden|[2,Inf] %count% weken geleden" - future: "{1} over %count% week|[2,Inf] over %count% weken" -month: - past: "{1} %count% maand geleden|[2,Inf] %count% maanden geleden" - future: "{1} over %count% maand|[2,Inf] over %count% maanden" -year: - past: "{1} %count% jaar geleden|[2,Inf] %count% jaren geleden" - future: "{1} over %count% jaar|[2,Inf] over %count% jaren" - -compound: - second: "{1} %count% seconde|[2,Inf] %count% seconden" - minute: "{1} %count% minuut|[2,Inf] %count% minuten" - hour: "{1} %count% uur|[2,Inf] %count% uren" - day: "{1} %count% dag|[2,Inf] %count% dagen" - week: "{1} %count% week|[2,Inf] %count% weken" - month: "{1} %count% maand|[2,Inf] %count% maanden" - year: "{1} %count% jaar|[2,Inf] %count% jaren" - ago: "geleden" - from_now: "vanaf nu" \ No newline at end of file diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.no.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.no.php new file mode 100644 index 0000000..3da884d --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.no.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] akkurat nå', + 'future' => '[0,Inf] akkurat nå', + ], + 'second' => [ + 'past' => '[0,1] %count% sekund siden|[2,Inf] %count% sekunder siden', + 'future' => '[0,1] %count% sekund fra nå|[2,Inf] %count% sekunder fra nå', + ], + 'minute' => [ + 'past' => '{1} %count% minutt siden|[2,Inf] %count% minutter siden', + 'future' => '{1} %count% minutt fra nå|[2,Inf] %count% minutter fra nå', + ], + 'hour' => [ + 'past' => '{1} %count% time siden|[2,Inf] %count% timer siden', + 'future' => '{1} %count% time fra nå|[2,Inf] %count% timer fra nå', + ], + 'day' => [ + 'past' => '{1} %count% dag siden|[2,Inf] %count% dager siden', + 'future' => '{1} %count% dag fra nå|[2,Inf] %count% dager fra nå', + ], + 'week' => [ + 'past' => '{1} %count% uke siden|[2,Inf] %count% uker siden', + 'future' => '{1} %count% uke fra nå|[2,Inf] %count% uker fra nå', + ], + 'month' => [ + 'past' => '{1} %count% måned siden|[2,Inf] %count% måneder siden', + 'future' => '{1} %count% måned fra nå|[2,Inf] %count% måneder fra nå', + ], + 'year' => [ + 'past' => '{1} %count% år siden|[2,Inf] %count% år siden', + 'future' => '{1} %count% år fra nå|[2,Inf] %count% år fra nå', + ], + 'compound' => [ + 'second' => '[0,1] %count% sekund|[2,Inf] %count% sekunder', + 'minute' => '{1} %count% minutt|[2,Inf] %count% minutter', + 'hour' => '{1} %count% time|[2,Inf] %count% timer', + 'day' => '{1} %count% dag|[2,Inf] %count% dager', + 'week' => '{1} %count% uke|[2,Inf] %count% uker', + 'month' => '{1} %count% måned|[2,Inf] %count% måneder', + 'year' => '{1} %count% år|[2,Inf] %count% år', + 'past' => '%value% siden', + 'future' => '%value% fra nå', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.no.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.no.yml deleted file mode 100644 index 183dfe4..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.no.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] akkurat nå" - future: "[0,Inf] akkurat nå" -second: - past: "{1} %count% sekund siden|[2,Inf] %count% sekunder siden" - future: "{1} %count% sekund fra nå|[2,Inf] %count% sekunder fra nå" -minute: - past: "{1} %count% minutt siden|[2,Inf] %count% minutter siden" - future: "{1} %count% minutt fra nå|[2,Inf] %count% minutter fra nå" -hour: - past: "{1} %count% time siden|[2,Inf] %count% timer siden" - future: "{1} %count% time fra nå|[2,Inf] %count% timer fra nå" -day: - past: "{1} %count% dag siden|[2,Inf] %count% dager siden" - future: "{1} %count% dag fra nå|[2,Inf] %count% dager fra nå" -week: - past: "{1} %count% uke siden|[2,Inf] %count% uker siden" - future: "{1} %count% uke fra nå|[2,Inf] %count% uker fra nå" -month: - past: "{1} %count% måned siden|[2,Inf] %count% måneder siden" - future: "{1} %count% måned fra nå|[2,Inf] %count% måneder fra nå" -year: - past: "{1} %count% år siden|[2,Inf] %count% år siden" - future: "{1} %count% år fra nå|[2,Inf] %count% år fra nå" - -compound: - second: "{1} %count% sekund|[2,Inf] %count% sekunder" - minute: "{1} %count% minutt|[2,Inf] %count% minutter" - hour: "{1} %count% time|[2,Inf] %count% timer" - day: "{1} %count% dag|[2,Inf] %count% dager" - week: "{1} %count% uke|[2,Inf] %count% uker" - month: "{1} %count% måned|[2,Inf] %count% måneder" - year: "{1} %count% år|[2,Inf] %count% år" - ago: "siden" - from_now: "fra nå" \ No newline at end of file diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.pl.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.pl.php new file mode 100644 index 0000000..05fb2f3 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.pl.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] w tym momencie', + 'future' => '[0,Inf] w tym momencie', + ], + 'second' => [ + 'past' => '[0,1] sekundę temu|[2, 4] %count% sekundy temu|[5,Inf] %count% sekund temu', + 'future' => '[0,1] za sekundę|[2, 4] za %count% sekund|[5,Inf] za %count% sekund', + ], + 'minute' => [ + 'past' => '{1} minutę temu|[2, 4] %count% minuty temu|[5,Inf] %count% minut temu', + 'future' => '{1} za minutę|[2, 4] za %count% minuty|[5,Inf] za %count% minut', + ], + 'hour' => [ + 'past' => '{1} godzinę temu|[2, 4] %count% godziny temu|[5,Inf] %count% godzin temu', + 'future' => '{1} za godzinę|[2, 4] za %count% godziny|[5,Inf] za %count% godzin', + ], + 'day' => [ + 'past' => '{1} wczoraj|[2, Inf] %count% dni temu', + 'future' => '{1} jutro|[2, Inf] za %count% dni', + ], + 'week' => [ + 'past' => '{1} tydzień temu|[2, 4] %count% tygodnie temu|[5,Inf] %count% tygodni temu', + 'future' => '{1} za tydzień|[2, 4] za %count% tygodnie|[5,Inf] za %count% tygodni', + ], + 'month' => [ + 'past' => '{1} miesiąc temu|[2, 4] %count% miesiące temu|[5,Inf] %count% miesięcy temu', + 'future' => '{1} za miesiąc|[2, 4] za %count% miesiące|[5,Inf] za %count% miesięcy', + ], + 'year' => [ + 'past' => '{1} rok temu|[2, 4] %count% lata temu|[5,Inf] %count% lat temu', + 'future' => '{1} za rok|[2, 4] za %count% lata|[5,Inf] za %count% lat', + ], + 'compound' => [ + 'second' => '[0,1] %count% sekunda|[2,4] %count% sekundy|[5,Inf] %count% sekund', + 'minute' => '{1} %count% minuta|[2,4] %count% minuty|[5,Inf] %count% minut', + 'hour' => '{1} %count% godzina|[2,4] %count% godziny|[5,Inf] %count% godzin', + 'day' => '{1} %count% dzień|[2,Inf] %count% dni', + 'week' => '{1} %count% tydzień|[2,4] %count% tygodnie|[5,Inf] %count% tygodni', + 'month' => '{1} %count% miesiąc|[2,4] %count% miesiące|[5,Inf] %count% miesięcy', + 'year' => '{1} %count% rok|[2,4] %count% lata|[5,Inf] %count% lat', + 'past' => '%value% temu', + 'future' => '%value% od teraz', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.pl.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.pl.yml deleted file mode 100644 index 47b48c6..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.pl.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] w tym momencie" - future: "[0,Inf] w tym momencie" -second: - past: "{1} sekundę temu|[2, 4] %count% sekundy temu|[5,Inf] %count% sekund temu" - future: "{1} za sekundę|[2, 4] za %count% sekund|[5,Inf] za %count% sekund" -minute: - past: "{1} minutę temu|[2, 4] %count% minuty temu|[5,Inf] %count% minut temu" - future: "{1} za minutę|[2, 4] za %count% minuty|[5,Inf] za %count% minut" -hour: - past: "{1} godzinę temu|[2, 4] %count% godziny temu|[5,Inf] %count% godzin temu" - future: "{1} za godzinę|[2, 4] za %count% godziny|[5,Inf] za %count% godzin" -day: - past: "{1} wczoraj|[2, Inf] %count% dni temu" - future: "{1} jutro|[2, Inf] za %count% dni" -week: - past: "{1} tydzień temu|[2, 4] %count% tygodnie temu|[5,Inf] %count% tygodni temu" - future: "{1} za tydzień|[2, 4] za %count% tygodnie|[5,Inf] za %count% tygodni" -month: - past: "{1} miesiąc temu|[2, 4] %count% miesiące temu|[5,Inf] %count% miesięcy temu" - future: "{1} za miesiąc|[2, 4] za %count% miesiące|[5,Inf] za %count% miesięcy" -year: - past: "{1} rok temu|[2, 4] %count% lata temu|[5,Inf] %count% lat temu" - future: "{1} za rok|[2, 4] za %count% lata|[5,Inf] za %count% lat" - -compound: - second: "{1} %count% sekunda|[2,4] %count% sekundy|[5,Inf] %count% sekund" - minute: "{1} %count% minuta|[2,4] %count% minuty|[5,Inf] %count% minut" - hour: "{1} %count% godzina|[2,4] %count% godziny|[5,Inf] %count% godzin" - day: "{1} %count% dzień|[2,Inf] %count% dni" - week: "{1} %count% tydzień|[2,4] %count% tygodnie|[5,Inf] %count% tygodni" - month: "{1} %count% miesiąc|[2,4] %count% miesiące|[5,Inf] %count% miesięcy" - year: "{1} %count% rok|[2,4] %count% lata|[5,Inf] %count% lat" - ago: "temu" - from_now: "od teraz" diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.pt.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.pt.php new file mode 100644 index 0000000..6684afd --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.pt.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] agora', + 'future' => '[0,Inf] agora', + ], + 'second' => [ + 'past' => '[0,1] %count% segundo atrás|[2,Inf] %count% segundos atrás', + 'future' => '[0,1] %count% segundo a partir de agora|[2,Inf] %count% segundos a partir de agora', + ], + 'minute' => [ + 'past' => '{1} %count% minuto atrás|[2,Inf] %count% minutos atrás', + 'future' => '{1} %count% minuto a partir de agora|[2,Inf] %count% minutos a partir de agora', + ], + 'hour' => [ + 'past' => '{1} %count% hora atrás|[2,Inf] %count% horas atrás', + 'future' => '{1} %count% hora a partir de agora|[2,Inf] %count% horas a partir de agora', + ], + 'day' => [ + 'past' => '{1} %count% dia atrás|[2,Inf] %count% dias atrás', + 'future' => '{1} %count% dia a partir de agora|[2,Inf] %count% dias a partir de agora', + ], + 'week' => [ + 'past' => '{1} %count% semana atrás|[2,Inf] %count% semanas atrás', + 'future' => '{1} %count% semana a partir de agora|[2,Inf] %count% semanas a partir de agora', + ], + 'month' => [ + 'past' => '{1} %count% mês atrás|[2,Inf] %count% meses atrás', + 'future' => '{1} %count% mês a partir de agora|[2,Inf] %count% meses a partir de agora', + ], + 'year' => [ + 'past' => '{1} %count% ano atrás|[2,Inf] %count% anos atrás', + 'future' => '{1} %count% ano a partir de agora|[2,Inf] %count% anos a partir de agora', + ], + 'compound' => [ + 'second' => '[0,1] %count% segundo|[2,Inf] %count% segundos', + 'minute' => '{1} %count% minuto|[2,Inf] %count% minutos', + 'hour' => '{1} %count% hora|[2,Inf] %count% horas', + 'day' => '{1} %count% dia|[2,Inf] %count% dias', + 'week' => '{1} %count% semana|[2,Inf] %count% semana', + 'month' => '{1} %count% mês|[2,Inf] %count% meses', + 'year' => '{1} %count% ano|[2,Inf] %count% anos', + 'past' => '%value% atrás', + 'future' => '%value% a partir de agora', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.pt.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.pt.yml deleted file mode 100644 index b542d13..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.pt.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] agora" - future: "[0,Inf] agora" -second: - past: "{1} %count% segundo atrás|[2,Inf] %count% segundos atrás" - future: "{1} %count% segundo a partir de agora|[2,Inf] %count% segundos a partir de agora" -minute: - past: "{1} %count% minuto atrás|[2,Inf] %count% minutos atrás" - future: "{1} %count% minuto a partir de agora|[2,Inf] %count% minutos a partir de agora" -hour: - past: "{1} %count% hora atrás|[2,Inf] %count% horas atrás" - future: "{1} %count% hora a partir de agora|[2,Inf] %count% horas a partir de agora" -day: - past: "{1} %count% dia atrás|[2,Inf] %count% dias atrás" - future: "{1} %count% dia a partir de agora|[2,Inf] %count% dias a partir de agora" -week: - past: "{1} %count% semana atrás|[2,Inf] %count% semanas atrás" - future: "{1} %count% semana a partir de agora|[2,Inf] %count% semanas a partir de agora" -month: - past: "{1} %count% mês atrás|[2,Inf] %count% meses atrás" - future: "{1} %count% mês a partir de agora|[2,Inf] %count% meses a partir de agora" -year: - past: "{1} %count% ano atrás|[2,Inf] %count% anos atrás" - future: "{1} %count% ano a partir de agora|[2,Inf] %count% anos a partir de agora" - -compound: - second: "{1} %count% segundo|[2,Inf] %count% segundos" - minute: "{1} %count% minuto|[2,Inf] %count% minutos" - hour: "{1} %count% hora|[2,Inf] %count% horas" - day: "{1} %count% dia|[2,Inf] %count% dias" - week: "{1} %count% semana|[2,Inf] %count% semana" - month: "{1} %count% mês|[2,Inf] %count% meses" - year: "{1} %count% ano|[2,Inf] %count% anos" - ago: "atrás" - from_now: "a partir de agora" diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.php new file mode 100644 index 0000000..91f4ee5 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] atrás', + 'future' => '[0,Inf] a partir de agora', + ], + 'second' => [ + 'past' => '[0,1] %count% segundo atrás|[2,Inf] %count% segundos atrás', + 'future' => '[0,1] %count% segundo a partir de agora|[2,Inf] %count% segundos a partir de agora', + ], + 'minute' => [ + 'past' => '{1} %count% minuto atrás|[2,Inf] %count% minutos atrás', + 'future' => '{1} %count% minuto a partir de agora|[2,Inf] %count% minutos a partir de agora', + ], + 'hour' => [ + 'past' => '{1} %count% hora atrás|[2,Inf] %count% horas atrás', + 'future' => '{1} %count% hora a partir de agora|[2,Inf] %count% horas a partir de agora', + ], + 'day' => [ + 'past' => '{1} %count% dia atrás|[2,Inf] %count% dias atrás', + 'future' => '{1} %count% dia a partir de agora|[2,Inf] %count% dias a partir de agora', + ], + 'week' => [ + 'past' => '{1} %count% semana atrás|[2,Inf] %count% semanas atrás', + 'future' => '{1} %count% semana a partir de agora|[2,Inf] %count% semanas a partir de agora', + ], + 'month' => [ + 'past' => '{1} %count% mês atrás|[2,Inf] %count% meses atrás', + 'future' => '{1} %count% mês a partir de agora|[2,Inf] %count% meses a partir de agora', + ], + 'year' => [ + 'past' => '{1} %count% ano atrás|[2,Inf] %count% anos atrás', + 'future' => '{1} %count% ano a partir de agora|[2,Inf] %count% anos a partir de agora', + ], + 'compound' => [ + 'second' => '[0,1] %count% segundo|[2,Inf] %count% segundos', + 'minute' => '{1} %count% minuto|[2,Inf] %count% minutos', + 'hour' => '{1} %count% hora|[2,Inf] %count% horas', + 'day' => '{1} %count% dia|[2,Inf] %count% dias', + 'week' => '{1} %count% semana|[2,Inf] %count% semana', + 'month' => '{1} %count% mês|[2,Inf] %count% meses', + 'year' => '{1} %count% ano|[2,Inf] %count% anos', + 'past' => '%value% atrás', + 'future' => '%value% a partir de agora', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml deleted file mode 100644 index 570e55d..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] atrás" - future: "[0,Inf] a partir de agora" -second: - past: "{1} %count% segundo atrás|[2,Inf] %count% segundos atrás" - future: "{1} %count% segundo a partir de agora|[2,Inf] %count% segundos a partir de agora" -minute: - past: "{1} %count% minuto atrás|[2,Inf] %count% minutos atrás" - future: "{1} %count% minuto a partir de agora|[2,Inf] %count% minutos a partir de agora" -hour: - past: "{1} %count% hora atrás|[2,Inf] %count% horas atrás" - future: "{1} %count% hora a partir de agora|[2,Inf] %count% horas a partir de agora" -day: - past: "{1} %count% dia atrás|[2,Inf] %count% dias atrás" - future: "{1} %count% dia a partir de agora|[2,Inf] %count% dias a partir de agora" -week: - past: "{1} %count% semana atrás|[2,Inf] %count% semanas atrás" - future: "{1} %count% semana a partir de agora|[2,Inf] %count% semanas a partir de agora" -month: - past: "{1} %count% mês atrás|[2,Inf] %count% meses atrás" - future: "{1} %count% mês a partir de agora|[2,Inf] %count% meses a partir de agora" -year: - past: "{1} %count% ano atrás|[2,Inf] %count% anos atrás" - future: "{1} %count% ano a partir de agora|[2,Inf] %count% anos a partir de agora" - -compound: - second: "{1} %count% segundo|[2,Inf] %count% segundos" - minute: "{1} %count% minuto|[2,Inf] %count% minutos" - hour: "{1} %count% hora|[2,Inf] %count% horas" - day: "{1} %count% dia|[2,Inf] %count% dias" - week: "{1} %count% semana|[2,Inf] %count% semana" - month: "{1} %count% mês|[2,Inf] %count% meses" - year: "{1} %count% ano|[2,Inf] %count% anos" - ago: "atrás" - from_now: "a partir de agora" diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.ro.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.ro.php new file mode 100644 index 0000000..5a9726b --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.ro.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] mai înainte', + 'future' => '[0,Inf] imediat', + ], + 'second' => [ + 'past' => '[0,1] %count% secundă în urmă|[2,Inf] %count% secunde în urmă', + 'future' => '[0,1] %count% secundă de acum|[2,Inf] %count% secundă de acum', + ], + 'minute' => [ + 'past' => '{1} %count% minut în urmă|[2,Inf] %count% minute în urmă', + 'future' => '{1} %count% minut de acum|[2,Inf] %count% minute de acum', + ], + 'hour' => [ + 'past' => '{1} %count% oră în urmă|[2,Inf] %count% ore în urmă', + 'future' => '{1} %count% oră de acum|[2,Inf] %count% ore de acum', + ], + 'day' => [ + 'past' => '{1} %count% zi în urmă|[2,Inf] %count% zile în urmă', + 'future' => '{1} %count% zi de acum|[2,Inf] %count% zile de acum', + ], + 'week' => [ + 'past' => '{1} %count% săptămână în urmă|[2,Inf] %count% săptămâni în urmă', + 'future' => '{1} %count% săptămână de acum|[2,Inf] %count% săptămâni de acum', + ], + 'month' => [ + 'past' => '{1} %count% lună în urmă|[2,Inf] %count% luni în urmă', + 'future' => '{1} %count% lună de acum|[2,Inf] %count% luni de acum', + ], + 'year' => [ + 'past' => '{1} %count% an în urmă|[2,Inf] %count% ani în urmă', + 'future' => '{1} %count% an de acum|[2,Inf] %count% ani de acum', + ], + 'compound' => [ + 'second' => '[0,1] %count% secundă|[2,Inf] %count% secunde', + 'minute' => '{1} %count% minut|[2,Inf] %count% minute', + 'hour' => '{1} %count% oră|[2,Inf] %count% ore', + 'day' => '{1} %count% zi|[2,Inf] %count% zile', + 'week' => '{1} %count% săptămană|[2,Inf] %count% săptămani', + 'month' => '{1} %count% lună|[2,Inf] %count% luni', + 'year' => '{1} %count% an|[2,Inf] %count% ani', + 'ago' => 'în urmă', + 'from_now' => 'de acum', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.ru.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.ru.php new file mode 100644 index 0000000..15044e5 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.ru.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] сейчас', + 'future' => '[0,Inf] сейчас', + ], + 'second' => [ + 'past' => '%count% секунду назад|%count% секунды назад|%count% секунд назад', + 'future' => 'через %count% секунду|через %count% секунды|через %count% секунд', + ], + 'minute' => [ + 'past' => '%count% минуту назад|%count% минуты назад|%count% минут назад', + 'future' => 'через %count% минуту|через %count% минуты|через %count% минут', + ], + 'hour' => [ + 'past' => '%count% час назад|%count% часа назад|%count% часов назад', + 'future' => 'через %count% час|через %count% часа|через %count% часов', + ], + 'day' => [ + 'past' => '%count% день назад|%count% дня назад|%count% дней назад', + 'future' => 'через %count% день|через %count% дня|через %count% дней', + ], + 'week' => [ + 'past' => '%count% неделю назад|%count% недели назад|%count% недель назад', + 'future' => 'через %count% неделю|через %count% недели|через %count% недель', + ], + 'month' => [ + 'past' => '%count% месяц назад|%count% месяца назад|%count% месяцев назад', + 'future' => 'через %count% месяц|через %count% месяца|через %count% месяцев', + ], + 'year' => [ + 'past' => '%count% год назад|%count% года назад|%count% лет назад', + 'future' => 'через %count% год|через %count% года|через %count% лет', + ], + 'compound' => [ + 'second' => '%count% секунда|%count% секунды|%count% секунд', + 'minute' => '%count% минута|%count% минуты|%count% минут', + 'hour' => '%count% час|%count% часа|%count% часов', + 'day' => '%count% день|%count% дня|%count% дней', + 'week' => '%count% неделя|%count% недели|%count% недель', + 'month' => '%count% месяц|%count% месяца|%count% месяцев', + 'year' => '%count% год|%count% года|%count% лет', + 'past' => '%value% назад', + 'future' => 'через %value%', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.sk.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.sk.php new file mode 100644 index 0000000..52e6cdf --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.sk.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] práve teraz', + 'future' => '[0,Inf] práve teraz', + ], + 'second' => [ + 'past' => '{1} pred sekundou|[2, 4] pred %count% sekundami|[5,Inf] pred %count% sekundami', + 'future' => '{1} o sekundu|[2, 4] o %count% sekundy|[5,Inf] o %count% sekúnd', + ], + 'minute' => [ + 'past' => '{1} pred minútou|[2, Inf] pred %count% minútami', + 'future' => '{1} o minútu|[2, 4] o %count% minúty|[5,Inf] o %count% minút', + ], + 'hour' => [ + 'past' => '{1} pred hodinou|[2, Inf] pred %count% hodinami', + 'future' => '{1} o hodinu|[2, 4] o %count% hodiny|[5,Inf] o %count% hodín', + ], + 'day' => [ + 'past' => '{1} včera|[2, Inf] pred %count% dňami', + 'future' => '{1} zajtra|[2, 4] o %count% dni|[5,Inf] o %count% dní', + ], + 'week' => [ + 'past' => '{1} minulý týždeň|[2, Inf] pred %count% týždňami', + 'future' => '{1} o týždeň|[2, 4] o %count% týždne|[5,Inf] o %count% týždňov', + ], + 'month' => [ + 'past' => '{1} minulý mesiac|[2, Inf] pred %count% mesiacmi', + 'future' => '{1} o mesiac|[2, 4] o %count% mesiace|[5,Inf] o %count% mesiacov', + ], + 'year' => [ + 'past' => '{1} minulý rok|[2, Inf] pred %count% rokmi', + 'future' => '{1} za rok|[2, 4] o %count% roky|[5,Inf] o %count% rokov', + ], + 'compound' => [ + 'second' => '{1} %count% sekunda|[2,4] %count% sekundy|[5,Inf] %count% sekúnd', + 'minute' => '{1} %count% minúta|[2,4] %count% minúty|[5,Inf] %count% minút', + 'hour' => '{1} %count% hodina|[2,4] %count% hodiny|[5,Inf] %count% hodín', + 'day' => '{1} %count% deň|[2,4] %count% dni|[5,Inf] %count% dní', + 'week' => '{1} %count% týždeň|[2,4] %count% týždne|[5,Inf] %count% týždňov', + 'month' => '{1} %count% mesiac|[2,4] %count% mesiace|[5,Inf] %count% mesiacov', + 'year' => '{1} %count% rok|[2,4] %count% roky|[5,Inf] %count% rokov', + 'past' => '%value% dozadu', + 'future' => '%value% od teraz', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.sv.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.sv.php new file mode 100644 index 0000000..9945a5b --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.sv.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] nyss', + 'future' => '[0,Inf] nyss', + ], + 'second' => [ + 'past' => '{0} för 0 sekunder sedan|{1} för 1 sekund sedan|[2,Inf] för %count% sekunder sedan', + 'future' => '{0} om 0 sekunder|{1} om 1 sekund|[2,Inf] om %count% sekunder', + ], + 'minute' => [ + 'past' => '{0} för 0 minuter sedan|{1} för 1 minut sedan|[2,Inf] för %count% minuter sedan', + 'future' => '{0} om 0 minuter|{1} om 1 minut|[2,Inf] om %count% minuter', + ], + 'hour' => [ + 'past' => '{0} för 0 timmar sedan|{1} för 1 timme sedan|[2,Inf] för %count% timmar sedan', + 'future' => '{0} om 0 timmar|{1} om 1 timme|[2,Inf] om %count% timmar', + ], + 'day' => [ + 'past' => '{0} för 0 dagar sedan|{1} för 1 dag sedan|[2,Inf] för %count% dagar sedan', + 'future' => '{0} om 0 dagar|{1} om 1 dag|[2,Inf] om %count% dagar', + ], + 'week' => [ + 'past' => '{0} för 0 veckor sedan|{1} för 1 vecka sedan|[2,Inf] för %count% veckor sedan', + 'future' => '{0} om 0 veckor|{1} om 1 vecka|[2,Inf] om %count% veckor', + ], + 'month' => [ + 'past' => '{0} för 0 månader sedan|{1} för 1 månad sedan|[2,Inf] för %count% månader sedan', + 'future' => '{0} om 0 månader|{1} om 1 månad|[2,Inf] om %count% månader', + ], + 'year' => [ + 'past' => '[0,Inf] för %count% år sedan', + 'future' => '[0,Inf] om %count% år', + ], + 'compound' => [ + 'second' => '{0} 0 sekunder|{1} 1 sekund|[2,Inf] %count% sekunder', + 'minute' => '{0} 0 minuter|{1} 1 minut|[2,Inf] %count% minuter', + 'hour' => '{0} 0 timmar|{1} 1 timme|[2,Inf] %count% timmar', + 'day' => '{0} 0 dagar|{1} 1 dag|[2,Inf] %count% dagar', + 'week' => '{0} 0 veckor|{1} 1 vecka|[2,Inf] %count% veckor', + 'month' => '{0} 0 månader|{1} 1 månad|[2,Inf] %count% månader', + 'year' => '[0,Inf] %count% år', + 'past' => 'för %value% sedan', + 'future' => 'om %value%', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.th.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.th.php new file mode 100644 index 0000000..25a6f81 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.th.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] เมื่อสักครู่', + 'future' => '[0,Inf] เร็วๆนี้', + ], + 'second' => [ + 'past' => '[1,Inf] %count% วินาทีที่แล้ว', + 'future' => '[1,Inf] อีก %count% วินาที', + ], + 'minute' => [ + 'past' => '[1,Inf] %count% นาทีที่แล้ว', + 'future' => '[1,Inf] อีก %count% นาที', + ], + 'hour' => [ + 'past' => '[1,Inf] %count% ชั่วโมงที่แล้ว', + 'future' => '[1,Inf] อีก %count% ชั่วโมง', + ], + 'day' => [ + 'past' => '[1,Inf] %count% วันที่แล้ว', + 'future' => '[1,Inf] อีก %count% วัน', + ], + 'week' => [ + 'past' => '[1,Inf] %count% สัปดาห์ที่แล้ว', + 'future' => '[1,Inf] อีก %count% สัปดาห์', + ], + 'month' => [ + 'past' => '[1,Inf] %count% เดือนที่แล้ว', + 'future' => '[1,Inf] อีก %count% เดือน', + ], + 'year' => [ + 'past' => '[1,Inf] %count% ปีที่แล้ว', + 'future' => '[1,Inf] อีก %count% ปี', + ], + 'compound' => [ + 'second' => '[0,Inf] %count% วินาที', + 'minute' => '[1,Inf] %count% นาที', + 'hour' => '[1,Inf] %count% ชั่วโมง', + 'day' => '[1,Inf] %count% วัน', + 'week' => '[1,Inf] %count% สัปดาห์', + 'month' => '[1,Inf] %count% เดือน', + 'year' => '[1,Inf] %count% ปี', + 'past' => '%value%ที่แล้ว', + 'future' => 'อีก %value%', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.php new file mode 100644 index 0000000..8b58d1e --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] şimdi', + 'future' => '[0,Inf] şimdi', + ], + 'second' => [ + 'past' => '[0,1] %count% saniye önce|[2,Inf] %count% saniye önce', + 'future' => '[0,1] %count% saniye sonra|[2,Inf] %count% saniye sonra', + ], + 'minute' => [ + 'past' => '{1} %count% dakika önce|[2,Inf] %count% dakika önce', + 'future' => '{1} %count% dakika sonra|[2,Inf] %count% dakika sonra', + ], + 'hour' => [ + 'past' => '{1} %count% saat önce|[2,Inf] %count% saat önce', + 'future' => '{1} %count% saat sonra|[2,Inf] %count% saat sonra', + ], + 'day' => [ + 'past' => '{1} %count% gün önce|[2,Inf] %count% gün önce', + 'future' => '{1} %count% gün sonra|[2,Inf] %count% gün sonra', + ], + 'week' => [ + 'past' => '{1} %count% hafta önce|[2,Inf] %count% hafta önce', + 'future' => '{1} %count% hafta sonra|[2,Inf] %count% hafta sonra', + ], + 'month' => [ + 'past' => '{1} %count% ay önce|[2,Inf] %count% ay önce', + 'future' => '{1} %count% ay sonra|[2,Inf] %count% ay sonra', + ], + 'year' => [ + 'past' => '{1} %count% yıl önce|[2,Inf] %count% yıl önce', + 'future' => '{1} %count% yıl sonra|[2,Inf] %count% yıl sonra', + ], + 'compound' => [ + 'second' => '[0,1] %count% saniye|[2,Inf] %count% saniye', + 'minute' => '{1} %count% dakika|[2,Inf] %count% dakika', + 'hour' => '{1} %count% saat|[2,Inf] %count% saat', + 'day' => '{1} %count% gün|[2,Inf] %count% gün', + 'week' => '{1} %count% hafta|[2,Inf] %count% hafta', + 'month' => '{1} %count% ay|[2,Inf] %count% ay', + 'year' => '{1} %count% yıl|[2,Inf] %count% yıl', + 'past' => '%value% önce', + 'future' => '%value% sonra', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.yml deleted file mode 100644 index a283f2d..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.yml +++ /dev/null @@ -1,35 +0,0 @@ -just_now: - past: "[0,Inf] şimdi" - future: "[0,Inf] şimdi" -second: - past: "{1} %count% saniye önce|[2,Inf] %count% saniye önce" - future: "{1} %count% saniye sonra|[2,Inf] %count% saniye sonra" -minute: - past: "{1} %count% dakika önce|[2,Inf] %count% dakika önce" - future: "{1} %count% dakika sonra|[2,Inf] %count% dakika sonra" -hour: - past: "{1} %count% saat önce|[2,Inf] %count% saat önce" - future: "{1} %count% saat sonra|[2,Inf] %count% saat sonra" -day: - past: "{1} %count% gün önce|[2,Inf] %count% gün önce" - future: "{1} %count% gün sonra|[2,Inf] %count% gün sonra" -week: - past: "{1} %count% hafta önce|[2,Inf] %count% hafta önce" - future: "{1} %count% hafta sonra|[2,Inf] %count% hafta sonra" -month: - past: "{1} %count% ay önce|[2,Inf] %count% ay önce" - future: "{1} %count% ay sonra|[2,Inf] %count% ay sonra" -year: - past: "{1} %count% yıl önce|[2,Inf] %count% yıl önce" - future: "{1} %count% yıl sonra|[2,Inf] %count% yıl sonra" - -compound: - second: "{1} %count% saniye|[2,Inf] %count% saniye" - minute: "{1} %count% dakika|[2,Inf] %count% dakika" - hour: "{1} %count% saat|[2,Inf] %count% saat" - day: "{1} %count% gün|[2,Inf] %count% gün" - week: "{1} %count% hafta|[2,Inf] %count% hafta" - month: "{1} %count% ay|[2,Inf] %count% ay" - year: "{1} %count% yıl|[2,Inf] %count% yıl" - ago: "önce" - from_now: "sonra" diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.uk.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.uk.php new file mode 100644 index 0000000..22499b5 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.uk.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] зараз', + 'future' => '[0,Inf] зараз', + ], + 'second' => [ + 'past' => '%count% секунду тому|%count% секунди тому|%count% секунд тому', + 'future' => 'через %count% секунду|через %count% секунди|через %count% секунд', + ], + 'minute' => [ + 'past' => '%count% хвилину тому|%count% хвилини тому|%count% хвилин тому', + 'future' => 'через %count% хвилину|через %count% хвилини|через %count% хвилин', + ], + 'hour' => [ + 'past' => '%count% годину тому|%count% години тому|%count% годин тому', + 'future' => 'через %count% годину|через %count% години|через %count% годин', + ], + 'day' => [ + 'past' => '%count% день тому|%count% дні тому|%count% днів тому', + 'future' => 'через %count% день|через %count% дні|через %count% днів', + ], + 'week' => [ + 'past' => '%count% тиждень тому|%count% тижні тому|%count% тижнів тому', + 'future' => 'через %count% тиждень|через %count% тижні|через %count% тижнів', + ], + 'month' => [ + 'past' => '%count% місяць тому|%count% місяці тому|%count% місяців тому', + 'future' => 'через %count% місяць|через %count% місяці|через %count% місяців', + ], + 'year' => [ + 'past' => '%count% рік тому|%count% роки тому|%count% років тому', + 'future' => 'через %count% рік|через %count% роки|через %count% років', + ], + 'compound' => [ + 'second' => '%count% секунда|%count% секунди|%count% секунд', + 'minute' => '%count% хвилина|%count% хвилини|%count% хвилин', + 'hour' => '%count% година|%count% години|%count% годин', + 'day' => '%count% день|%count% дні|%count% днів', + 'week' => '%count% тиждень|%count% тижні|%count% тижнів', + 'month' => '%count% місяць|%count% місяця|%count% місяців', + 'year' => '%count% рік|%count% роки|%count% років', + 'past' => '%value% тому', + 'future' => 'через %value%', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.zh_CN.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.zh_CN.php new file mode 100644 index 0000000..2833fef --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.zh_CN.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] 刚刚', + 'future' => '[0,Inf] 刚刚', + ], + 'second' => [ + 'past' => '[1,Inf] %count% 秒前', + 'future' => '[1,Inf] %count% 秒后', + ], + 'minute' => [ + 'past' => '[1,Inf] %count% 分钟前', + 'future' => '[1,Inf] %count% 分钟后', + ], + 'hour' => [ + 'past' => '[1,Inf] %count% 小时前', + 'future' => '[1,Inf] %count% 小时后', + ], + 'day' => [ + 'past' => '[1,Inf] %count% 天前', + 'future' => '[1,Inf] %count% 天后', + ], + 'week' => [ + 'past' => '[1,Inf] %count% 周前', + 'future' => '[1,Inf] %count% 周后', + ], + 'month' => [ + 'past' => '[1,Inf] %count% 个月前', + 'future' => '[1,Inf] %count% 个月后', + ], + 'year' => [ + 'past' => '[1,Inf] %count% 年前', + 'future' => '[1,Inf] %count% 年后', + ], + 'compound' => [ + 'second' => '[0,Inf] %count% 秒', + 'minute' => '[1,Inf] %count% 分钟', + 'hour' => '[1,Inf] %count% 小时', + 'day' => '[1,Inf] %count% 天', + 'week' => '[1,Inf] %count% 周', + 'month' => '[1,Inf] %count% 个月', + 'year' => '[1,Inf] %count% 年', + 'past' => '%value%前', + 'future' => '%value%后', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.zh_TW.php b/src/Coduo/PHPHumanizer/Resources/translations/difference.zh_TW.php new file mode 100644 index 0000000..011ce66 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.zh_TW.php @@ -0,0 +1,47 @@ + [ + 'past' => '[0,Inf] 剛剛', + 'future' => '[0,Inf] 剛剛', + ], + 'second' => [ + 'past' => '[1,Inf] %count% 秒前', + 'future' => '[1,Inf] %count% 秒後', + ], + 'minute' => [ + 'past' => '[1,Inf] %count% 分鐘前', + 'future' => '[1,Inf] %count% 分鐘後', + ], + 'hour' => [ + 'past' => '[1,Inf] %count% 小時前', + 'future' => '[1,Inf] %count% 小時後', + ], + 'day' => [ + 'past' => '[1,Inf] %count% 天前', + 'future' => '[1,Inf] %count% 天後', + ], + 'week' => [ + 'past' => '[1,Inf] %count% 週前', + 'future' => '[1,Inf] %count% 週後', + ], + 'month' => [ + 'past' => '[1,Inf] %count% 個月前', + 'future' => '[1,Inf] %count% 個月後', + ], + 'year' => [ + 'past' => '[1,Inf] %count% 年前', + 'future' => '[1,Inf] %count% 年後', + ], + 'compound' => [ + 'second' => '[0,Inf] %count% 秒', + 'minute' => '[1,Inf] %count% 分鐘', + 'hour' => '[1,Inf] %count% 小時', + 'day' => '[1,Inf] %count% 天', + 'week' => '[1,Inf] %count% 週', + 'month' => '[1,Inf] %count% 個月', + 'year' => '[1,Inf] %count% 年', + 'past' => '%value%前', + 'future' => '%value%後', + ], +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.cs.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.cs.php new file mode 100644 index 0000000..23c9f36 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.cs.php @@ -0,0 +1,7 @@ + '%first% a %second%', + 'comma_separated' => '%list%, a %last%', + 'comma_separated_with_limit' => '[1,4] %list%, a %count% další|[5,Inf] %list%, a %count% dalších', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.da.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.da.php new file mode 100644 index 0000000..e5d4ce8 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.da.php @@ -0,0 +1,7 @@ + '%first% og %second%', + 'comma_separated' => '%list%, og %last%', + 'comma_separated_with_limit' => '{1} %list%, og 1 anden|[2,Inf] %list%, og %count% andre', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.en.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.en.php new file mode 100644 index 0000000..c6c07f3 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.en.php @@ -0,0 +1,7 @@ + '%first% and %second%', + 'comma_separated' => '%list%, and %last%', + 'comma_separated_with_limit' => '{1} %list%, and 1 other|[2,Inf] %list%, and %count% others', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.en.yml b/src/Coduo/PHPHumanizer/Resources/translations/oxford.en.yml deleted file mode 100644 index 22eb5cf..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/oxford.en.yml +++ /dev/null @@ -1,3 +0,0 @@ -only_two: "%first% and %second%" -comma_separated: "%list%, and %last%" -comma_separated_with_limit: "{1} %list%, and 1 other|[2,Inf] %list%, and %count% others" \ No newline at end of file diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.es.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.es.php new file mode 100644 index 0000000..618a233 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.es.php @@ -0,0 +1,7 @@ + '%first% y %second%', + 'comma_separated' => '%list%, y %last%', + 'comma_separated_with_limit' => '{1} %list%, y 1 más|[2,Inf] %list%, y %count% más', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.fr.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.fr.php new file mode 100644 index 0000000..0ff0dc2 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.fr.php @@ -0,0 +1,7 @@ + '%first% et %second%', + 'comma_separated' => '%list% et %last%', + 'comma_separated_with_limit' => '{1} %list% et 1 autre|[2,Inf] %list% et %count% autres', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.id.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.id.php new file mode 100644 index 0000000..5cc8a46 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.id.php @@ -0,0 +1,7 @@ + '%first% dan %second%', + 'comma_separated' => '%list%, dan %last%', + 'comma_separated_with_limit' => '{1} %list%, dan 1 lainnya|[2,Inf] %list%, dan %count% lainnya', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.it.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.it.php new file mode 100644 index 0000000..a135f18 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.it.php @@ -0,0 +1,7 @@ + '%first% e %second%', + 'comma_separated' => '%list% e %last%', + 'comma_separated_with_limit' => '{1} %list% ed un altro|[2,Inf] %list% e %count% altri', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.ja.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.ja.php new file mode 100644 index 0000000..d5ba791 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.ja.php @@ -0,0 +1,7 @@ + '%first% と %second%', + 'comma_separated' => '%list% と %last%', + 'comma_separated_with_limit' => '{1} %list% ともうひとり|[2,Inf] %list% ともう %count% 人', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.nl.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.nl.php new file mode 100644 index 0000000..22c5601 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.nl.php @@ -0,0 +1,7 @@ + '%first% en %second%', + 'comma_separated' => '%list%, en %last%', + 'comma_separated_with_limit' => '{1} %list%, en 1 andere|[2,Inf] %list%, en %count% andere', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.pl.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.pl.php new file mode 100644 index 0000000..3f49e92 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.pl.php @@ -0,0 +1,7 @@ + '%first% i %second%', + 'comma_separated' => '%list% i %last%', + 'comma_separated_with_limit' => '{1} %list% i 1 inny|[2,Inf] %list% i %count% innych', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.pl.yml b/src/Coduo/PHPHumanizer/Resources/translations/oxford.pl.yml deleted file mode 100644 index 6a999c0..0000000 --- a/src/Coduo/PHPHumanizer/Resources/translations/oxford.pl.yml +++ /dev/null @@ -1,3 +0,0 @@ -only_two: "%first% i %second%" -comma_separated: "%list% i %last%" -comma_separated_with_limit: "{1} %list% i 1 inny|[2,Inf] %list% i %count% innych" \ No newline at end of file diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.ro.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.ro.php new file mode 100644 index 0000000..451e09c --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.ro.php @@ -0,0 +1,7 @@ + '%first% și %second%', + 'comma_separated' => '%list% și %last%', + 'comma_separated_with_limit' => '{1} %list% și încă unul|[2,Inf] %list% și %count% alții', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.ru.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.ru.php new file mode 100644 index 0000000..5d688d1 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.ru.php @@ -0,0 +1,7 @@ + '%first% и %second%', + 'comma_separated' => '%list% и %last%', + 'comma_separated_with_limit' => '{1} %list% и ещё 1|[2,Inf] %list% и ещё %count%', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.sk.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.sk.php new file mode 100644 index 0000000..915779e --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.sk.php @@ -0,0 +1,7 @@ + '%first% a %second%', + 'comma_separated' => '%list%, a %last%', + 'comma_separated_with_limit' => '[1,4] %list%, a %count% ďalší|[5,Inf] %list%, a %count% ďalších', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.sv.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.sv.php new file mode 100644 index 0000000..5df6ada --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.sv.php @@ -0,0 +1,7 @@ + '%first% och %second%', + 'comma_separated' => '%list%, och %last%', + 'comma_separated_with_limit' => '[1,Inf] %list%, och %count% till', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.th.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.th.php new file mode 100644 index 0000000..5d282c4 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.th.php @@ -0,0 +1,7 @@ + '%first% และ %second%', + 'comma_separated' => '%list% และ %last%', + 'comma_separated_with_limit' => '{1} %list% และอีก 1|[2,Inf] %list% และอีก %count%', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.uk.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.uk.php new file mode 100644 index 0000000..77a11cb --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.uk.php @@ -0,0 +1,7 @@ + '%first% та %second%', + 'comma_separated' => '%list% та %last%', + 'comma_separated_with_limit' => '{1} %list% і ще 1|[2,Inf] %list% і ще %count%', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.zh_CN.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.zh_CN.php new file mode 100644 index 0000000..5b7d1eb --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.zh_CN.php @@ -0,0 +1,7 @@ + '%first% 和 %second%', + 'comma_separated' => '%list%, 和 %last%', + 'comma_separated_with_limit' => '{1} %list% 和另一个|[2,Inf] %list% 和另 %count% 个', +]; diff --git a/src/Coduo/PHPHumanizer/Resources/translations/oxford.zh_TW.php b/src/Coduo/PHPHumanizer/Resources/translations/oxford.zh_TW.php new file mode 100644 index 0000000..633ae70 --- /dev/null +++ b/src/Coduo/PHPHumanizer/Resources/translations/oxford.zh_TW.php @@ -0,0 +1,7 @@ + '%first% 和 %second%', + 'comma_separated' => '%list%, 和 %last%', + 'comma_separated_with_limit' => '{1} %list% 和另一個|[2,Inf] %list% 和另 %count% 個', +]; diff --git a/src/Coduo/PHPHumanizer/String.php b/src/Coduo/PHPHumanizer/String.php deleted file mode 100644 index a9a268b..0000000 --- a/src/Coduo/PHPHumanizer/String.php +++ /dev/null @@ -1,19 +0,0 @@ - */ - private $binaryPrefixes = array( - 1125899906842624 => '#.## PB', - 1099511627776 => '#.## TB', - 1073741824 => '#.## GB', - 1048576 => '#.## MB', + private array $binaryPrefixes = [ + 1_125_899_906_842_624 => '#.## PB', + 1_099_511_627_776 => '#.## TB', + 1_073_741_824 => '#.## GB', + 1_048_576 => '#.## MB', 1024 => '#.# kB', 0 => '# bytes', - ); + ]; - /** - * @param $number - * @param string $locale - * - * @throws \InvalidArgumentException - */ - public function __construct($number, $locale = 'en') + public function __construct(int $number, string $locale = 'en', ?int $precision = null) { - if (!is_numeric($number)) { - throw new \InvalidArgumentException('Binary suffix converter accept only numeric values.'); + if (!\class_exists(\NumberFormatter::class)) { + throw new \RuntimeException('Binary suffix converter requires intl extension!'); } - $this->number = (int) $number; + if (null !== $precision) { + $this->setSpecificPrecisionFormat($precision); + } + + $this->number = $number; $this->locale = $locale; + + /* + * Workaround for 32-bit systems which ignore array ordering when + * dropping values over 2^32-1 + */ + \krsort($this->binaryPrefixes); } + /** + * @return int|string + */ public function convert() { $formatter = new \NumberFormatter($this->locale, \NumberFormatter::PATTERN_DECIMAL); + if ($this->number < 0) { return $this->number; } foreach ($this->binaryPrefixes as $size => $unitPattern) { if ($size <= $this->number) { - $value = ($this->number >= self::CONVERT_THRESHOLD) ? $this->number / (double) $size : $this->number; + $value = ($this->number >= self::CONVERT_THRESHOLD) ? $this->number / (float) $size : $this->number; $formatter->setPattern($unitPattern); + /** @phpstan-ignore-next-line */ return $formatter->format($value); } } + /** @phpstan-ignore-next-line */ return $formatter->format($this->number); } + + /** + * Replaces the default ICU 56.1 decimal formats defined in $binaryPrefixes with ones that provide the same symbols + * but the provided number of decimal places. + */ + private function setSpecificPrecisionFormat(int $precision) : void + { + if ($precision < 0) { + throw new \InvalidArgumentException('Precision must be positive'); + } + + if ($precision > 3) { + throw new \InvalidArgumentException('Invalid precision. Binary suffix converter can only represent values in ' . + 'up to three decimal places'); + } + + $icuFormat = '#'; + + if ($precision > 0) { + $icuFormat .= \str_pad('#.', (2 + $precision), '0'); + } + + foreach ($this->binaryPrefixes as $size => $unitPattern) { + if ($size >= 1024) { + $symbol = \substr($unitPattern, (int) \strpos($unitPattern, ' ')); + $this->binaryPrefixes[$size] = $icuFormat . $symbol; + } + } + } } diff --git a/src/Coduo/PHPHumanizer/String/Breakpoint.php b/src/Coduo/PHPHumanizer/String/Breakpoint.php new file mode 100644 index 0000000..1e5caed --- /dev/null +++ b/src/Coduo/PHPHumanizer/String/Breakpoint.php @@ -0,0 +1,20 @@ +breakpoint = $breakpoint; + $this->append = $append; + $this->allowedTags = $allowedTags; + } + + public function truncate(string $text, int $charactersCount) : string + { + $strippedText = \strip_tags($text, $this->allowedTags); + + return $this->truncateHtml($strippedText, $charactersCount); + } + + /** + * Truncates a string to the given length. It will optionally preserve + * HTML tags if $is_html is set to true. + * + * Adapted from FuelPHP Str::truncate (https://github.com/fuelphp/common/blob/master/src/Str.php) + */ + private function truncateHtml(string $string, int $charactersCount) : string + { + $limit = $charactersCount; + $offset = 0; + $tags = []; + + // Handle special characters. + \preg_match_all('#&[a-z]+;#i', \strip_tags($string), $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); + + foreach ($matches as $match) { + if ($match[0][1] >= $limit) { + break; + } + $limit += (\mb_strlen($match[0][0]) - 1); + } + + // Handle all the html tags. + \preg_match_all('#<[^>]+>([^<]*)#', $string, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); + + foreach ($matches as $match) { + if ($match[0][1] - $offset >= $limit) { + break; + } + + $tag = \mb_substr((string) \strtok($match[0][0], " \t\n\r\0\x0B>"), 1); + + if ($tag[0] != '/') { + $tags[] = $tag; + } elseif (\end($tags) == \mb_substr($tag, 1)) { + \array_pop($tags); + } + + $offset += $match[1][1] - $match[0][1]; + } + + $newString = \mb_substr($string, 0, $limit = \min(\mb_strlen($string), $this->breakpoint->calculatePosition($string, $limit + $offset))); + $newString .= (\mb_strlen($string) > $limit ? $this->append : ''); + $newString .= (\count($tags = \array_reverse($tags)) ? '' : ''); + + return $newString; + } +} diff --git a/src/Coduo/PHPHumanizer/String/Humanize.php b/src/Coduo/PHPHumanizer/String/Humanize.php index 3ec9c58..87bf577 100644 --- a/src/Coduo/PHPHumanizer/String/Humanize.php +++ b/src/Coduo/PHPHumanizer/String/Humanize.php @@ -1,44 +1,45 @@ */ - private $capitalize; + private array $forbiddenWords; /** - * @param $text - * @param bool $capitalize + * @param array $forbiddenWords */ - public function __construct($text, $capitalize = true) + public function __construct(string $text, bool $capitalize = true, string $separator = '_', array $forbiddenWords = ['id']) { $this->text = $text; $this->capitalize = $capitalize; + $this->separator = $separator; + $this->forbiddenWords = $forbiddenWords; } - /** - * @internal param bool $capitalize - * - * @return string - */ - public function __toString() + public function __toString() : string { - $humanized = trim(strtolower(preg_replace(array('/([A-Z])/', '/[_\s]+/'), array('_$1', ' '), $this->text))); - $humanized = trim(str_replace($this->forbiddenWords, '', $humanized)); + $humanized = \trim(\strtolower((string) \preg_replace(['/([A-Z])/', \sprintf('/[%s\s]+/', $this->separator)], ['_$1', ' '], $this->text))); + $humanized = \trim(\str_replace($this->forbiddenWords, '', $humanized)); - return $this->capitalize ? ucfirst($humanized) : $humanized; + return $this->capitalize ? \ucfirst($humanized) : $humanized; } } diff --git a/src/Coduo/PHPHumanizer/String/MetricSuffix.php b/src/Coduo/PHPHumanizer/String/MetricSuffix.php index 513ddac..d39ad33 100644 --- a/src/Coduo/PHPHumanizer/String/MetricSuffix.php +++ b/src/Coduo/PHPHumanizer/String/MetricSuffix.php @@ -1,62 +1,83 @@ */ - private $binaryPrefixes = array( - 1000000000000000 => '#.##P', - 1000000000000 => '#.##T', - 1000000000 => '#.##G', - 1000000 => '#.##M', + private array $binaryPrefixes = [ + 1_000_000_000_000_000 => '#.##P', + 1_000_000_000_000 => '#.##T', + 1_000_000_000 => '#.##G', + 1_000_000 => '#.##M', 1000 => '#.#k', 0 => '#.#', - ); + ]; /** - * @param $number + * @param numeric $number * @param string $locale * * @throws \InvalidArgumentException */ - public function __construct($number, $locale = 'en') + public function __construct($number, string $locale = 'en') { - if (!is_numeric($number)) { + if (!\class_exists(\NumberFormatter::class)) { + throw new \RuntimeException('Metric suffix converter requires intl extension!'); + } + + /** + * @psalm-suppress DocblockTypeContradiction + */ + if (!\is_numeric($number)) { throw new \InvalidArgumentException('Metric suffix converter accept only numeric values.'); } $this->number = (int) $number; $this->locale = $locale; + + /* + * Workaround for 32-bit systems which ignore array ordering when + * dropping values over 2^32-1 + */ + \krsort($this->binaryPrefixes); } - public function convert() + public function convert() : string { $formatter = new \NumberFormatter($this->locale, \NumberFormatter::PATTERN_DECIMAL); foreach ($this->binaryPrefixes as $size => $unitPattern) { if ($size <= $this->number) { - $value = ($this->number >= self::CONVERT_THRESHOLD) ? $this->number / (double) $size : $this->number; + $value = ($this->number >= self::CONVERT_THRESHOLD) ? $this->number / (float) $size : $this->number; $formatter->setPattern($unitPattern); + /** @phpstan-ignore-next-line */ return $formatter->format($value); } } + /** @phpstan-ignore-next-line */ return $formatter->format($this->number); } } diff --git a/src/Coduo/PHPHumanizer/String/ShortcodeProcessor.php b/src/Coduo/PHPHumanizer/String/ShortcodeProcessor.php new file mode 100644 index 0000000..acd6686 --- /dev/null +++ b/src/Coduo/PHPHumanizer/String/ShortcodeProcessor.php @@ -0,0 +1,47 @@ +createShortcodeProcessor( + function () : void { + } + )->process($text); + } + + /** + * Removes only shortcode tags from given text (leaves their content as it is). + */ + public function removeShortcodeTags(string $text) : string + { + return $this->createShortcodeProcessor(fn (ShortcodeInterface $s) : ?string => $s->getContent())->process($text); + } + + private function createShortcodeProcessor(callable $defaultHandler) : Processor + { + $handlers = new HandlerContainer(); + $handlers->setDefault($defaultHandler); + + return new Processor(new RegularParser(), $handlers); + } +} diff --git a/src/Coduo/PHPHumanizer/String/TextTruncate.php b/src/Coduo/PHPHumanizer/String/TextTruncate.php new file mode 100644 index 0000000..5d0dfdf --- /dev/null +++ b/src/Coduo/PHPHumanizer/String/TextTruncate.php @@ -0,0 +1,36 @@ +breakpoint = $breakpoint; + $this->append = $append; + } + + public function truncate(string $text, int $charactersCount) : string + { + if ($charactersCount < 0 || \mb_strlen($text) <= $charactersCount) { + return $text; + } + + $truncatedText = \rtrim(\mb_substr($text, 0, $this->breakpoint->calculatePosition($text, $charactersCount))); + + return ($truncatedText === $text) ? $truncatedText : $truncatedText . $this->append; + } +} diff --git a/src/Coduo/PHPHumanizer/String/Truncate.php b/src/Coduo/PHPHumanizer/String/Truncate.php deleted file mode 100644 index e724ab2..0000000 --- a/src/Coduo/PHPHumanizer/String/Truncate.php +++ /dev/null @@ -1,47 +0,0 @@ -text = $text; - $this->charactersCount = $charactersCount; - $this->append = $append; - } - - public function __toString() - { - if ($this->charactersCount < 0 || strlen($this->text) <= ($this->charactersCount + mb_strlen($this->append))) { - return $this->text; - } - - $length = $this->charactersCount; - if (false !== ($breakpoint = mb_strpos($this->text, ' ', $this->charactersCount))) { - $length = $breakpoint; - } - - return rtrim(mb_substr($this->text, 0, $length)).$this->append; - } -} diff --git a/src/Coduo/PHPHumanizer/String/TruncateInterface.php b/src/Coduo/PHPHumanizer/String/TruncateInterface.php new file mode 100644 index 0000000..c0400cb --- /dev/null +++ b/src/Coduo/PHPHumanizer/String/TruncateInterface.php @@ -0,0 +1,17 @@ + \mb_strlen($text)) { + return \mb_strlen($text); + } + + $breakpoint = \mb_strpos($text, ' ', $charactersCount); + + if (false === $breakpoint) { + return \mb_strlen($text); + } + + return $breakpoint; + } +} diff --git a/src/Coduo/PHPHumanizer/StringHumanizer.php b/src/Coduo/PHPHumanizer/StringHumanizer.php new file mode 100644 index 0000000..5e492b4 --- /dev/null +++ b/src/Coduo/PHPHumanizer/StringHumanizer.php @@ -0,0 +1,65 @@ + $forbiddenWords + */ + public static function humanize(string $text, bool $capitalize = true, string $separator = '_', array $forbiddenWords = []) : string + { + return (string) new Humanize($text, $capitalize, $separator, $forbiddenWords); + } + + public static function truncate(string $text, int $charactersCount, string $append = '') : string + { + $truncate = new TextTruncate(new WordBreakpoint(), $append); + + return $truncate->truncate($text, $charactersCount); + } + + public static function truncateHtml(string $text, int $charactersCount, string $allowedTags = '', string $append = '') : string + { + $truncate = new HtmlTruncate(new WordBreakpoint(), $allowedTags, $append); + + return $truncate->truncate($text, $charactersCount); + } + + public static function removeShortcodes(string $text) : string + { + if (!\class_exists('\Thunder\Shortcode\Processor\Processor')) { + throw new \RuntimeException('Please add "thunderer/shortcode": ^0.7 to composer.json first'); + } + + $processor = new ShortcodeProcessor(); + + return $processor->removeShortcodes($text); + } + + public static function removeShortcodeTags(string $text) : string + { + if (!\class_exists('\Thunder\Shortcode\Processor\Processor')) { + throw new \RuntimeException('Please add "thunderer/shortcode": ^0.7 to composer.json first'); + } + + $processor = new ShortcodeProcessor(); + + return $processor->removeShortcodeTags($text); + } +} diff --git a/src/Coduo/PHPHumanizer/Translator/Builder.php b/src/Coduo/PHPHumanizer/Translator/Builder.php index 7131ed1..7fb7dcf 100644 --- a/src/Coduo/PHPHumanizer/Translator/Builder.php +++ b/src/Coduo/PHPHumanizer/Translator/Builder.php @@ -1,27 +1,45 @@ + */ + private static array $translators = []; + + public static function build(string $locale) : Translator { - $translator = new Translator($locale); - $translator->addLoader('yml', new YamlFileLoader()); + if (!isset(self::$translators[$locale])) { + $translator = new Translator($locale); + $translator->addLoader('php', new PhpFileLoader()); + + $iterator = new \FilesystemIterator(__DIR__ . '/../Resources/translations'); + $filter = new \RegexIterator($iterator, '/[aA-zZ]+\.([a-z]{2}|[a-z]{2}\_[A-Z]{2})\.php$/'); - $iterator = new \FilesystemIterator(__DIR__.'/../Resources/translations'); - $filter = new \RegexIterator($iterator, '/[aA-zZ]+\.([a-z]{2}|[a-z]{2}\_[A-Z]{2})\.yml$/'); + /** @var \SplFileInfo $file */ + foreach ($filter as $file) { + $resourceName = $file->getBasename('.php'); + [$fileDomain, $fileLocale] = \explode('.', $resourceName); + $translator->addResource('php', $file->getPathname(), $fileLocale, $fileDomain); + } - foreach ($filter as $file) { - /* @var $file \SplFileInfo */ - $resourceName = $file->getBasename('.yml'); - list($fileDomain, $fileLocale) = explode('.', $resourceName); - $translator->addResource('yml', $file->getPathname(), $fileLocale, $fileDomain); + self::$translators[$locale] = $translator; } - return $translator; + return self::$translators[$locale]; } } diff --git a/tests/Coduo/PHPHumanizer/Tests/Aeon/Calendar/FormatterTest.php b/tests/Coduo/PHPHumanizer/Tests/Aeon/Calendar/FormatterTest.php new file mode 100644 index 0000000..a061e97 --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/Aeon/Calendar/FormatterTest.php @@ -0,0 +1,85 @@ +add(TimeUnit::hours(3)) + ->add(TimeUnit::minutes(25)) + ->add(TimeUnit::seconds(30)) + ->add(TimeUnit::milliseconds(200)); + + $formatter = new Formatter(Builder::build('en')); + + $this->assertSame( + '2 days, 3 hours, 25 minutes, and 30.2 seconds', + $formatter->timeUnit($timeUnit) + ); + } + + public function test_format_relative_time_unit() : void + { + $timeUnit = RelativeTimeUnit::months(14); + + $formatter = new Formatter(Builder::build('en')); + + $this->assertSame( + '1 year and 2 months', + $formatter->timeUnit($timeUnit) + ); + } + + public function test_format_time_units_smaller_than_1_sec() : void + { + $timeUnit = TimeUnit::milliseconds(200); + + $formatter = new Formatter(Builder::build('en')); + + $this->assertSame( + '0.2 second', + $formatter->timeUnit($timeUnit) + ); + } + + public function test_format_time_units_smaller_than_1_ms() : void + { + $timeUnit = TimeUnit::precise(0.000002); + + $formatter = new Formatter(Builder::build('en')); + + $this->assertSame( + '0 second', + $formatter->timeUnit($timeUnit) + ); + } + + public function test_format_zero_seconds_time_unit() : void + { + $timeUnit = TimeUnit::precise(0); + + $formatter = new Formatter(Builder::build('en')); + + $this->assertSame( + '0 second', + $formatter->timeUnit($timeUnit) + ); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/Collection/FormatterTest.php b/tests/Coduo/PHPHumanizer/Tests/Collection/FormatterTest.php new file mode 100644 index 0000000..d5f1c64 --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/Collection/FormatterTest.php @@ -0,0 +1,49 @@ +assertSame( + 'Michal and Norbert', + $formatter->format(['Michal', 'Norbert'], null) + ); + } + + public function test_formats_elements_with_limit() : void + { + $formatter = new Formatter(Builder::build('en')); + + $this->assertSame( + 'Michal, Norbert, and 1 other', + $formatter->format(['Michal', 'Norbert', 'Lukasz'], 2) + ); + } + + public function test_formats_elements_without_limit() : void + { + $formatter = new Formatter(Builder::build('en')); + + $this->assertSame( + 'Michal, Norbert, and Lukasz', + $formatter->format(['Michal', 'Norbert', 'Lukasz'], null) + ); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/Collection/OxfordTest.php b/tests/Coduo/PHPHumanizer/Tests/Collection/OxfordTest.php new file mode 100644 index 0000000..5a56fcc --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/Collection/OxfordTest.php @@ -0,0 +1,36 @@ +assertSame( + '', + (new Oxford(new Formatter(Builder::build('en'))))->format([]) + ); + } + + public function test_returns_collection_item_string_when_collection_has_one_element() : void + { + $this->assertSame( + 'Michal', + (new Oxford(new Formatter(Builder::build('en'))))->format(['Michal']) + ); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/CollectionHumanizerTest.php b/tests/Coduo/PHPHumanizer/Tests/CollectionHumanizerTest.php new file mode 100644 index 0000000..f11b6d4 --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/CollectionHumanizerTest.php @@ -0,0 +1,93 @@ +assertSame($expectedResult, CollectionHumanizer::oxford($collection, $limit, $locale)); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/DateTime/DifferenceTest.php b/tests/Coduo/PHPHumanizer/Tests/DateTime/DifferenceTest.php new file mode 100644 index 0000000..23e8b1e --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/DateTime/DifferenceTest.php @@ -0,0 +1,120 @@ +assertInstanceOf(Minute::class, $diff->getUnit()); + $this->assertSame(15, $diff->getQuantity()); + $this->assertTrue($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_future_date_in_minutes() : void + { + $diff = new Difference(new \DateTime('2014-04-26 13:00:00'), new \DateTime('2014-04-26 13:15:00')); + $this->assertInstanceOf(Minute::class, $diff->getUnit()); + $this->assertSame(15, $diff->getQuantity()); + $this->assertFalse($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_past_date_in_hours() : void + { + $diff = new Difference(new \DateTime('2014-04-26 13:00:00'), new \DateTime('2014-04-26 11:00:00')); + $this->assertInstanceOf(Hour::class, $diff->getUnit()); + $this->assertSame(2, $diff->getQuantity()); + $this->assertTrue($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_future_date_in_hours() : void + { + $diff = new Difference(new \DateTime('2014-04-26 13:00:00'), new \DateTime('2014-04-26 16:00:00')); + $this->assertInstanceOf(Hour::class, $diff->getUnit()); + $this->assertSame(3, $diff->getQuantity()); + $this->assertFalse($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_past_date_in_days() : void + { + $diff = new Difference(new \DateTime('2014-04-10'), new \DateTime('2014-04-09')); + $this->assertInstanceOf(Day::class, $diff->getUnit()); + $this->assertSame(1, $diff->getQuantity()); + $this->assertTrue($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_future_date_in_days() : void + { + $diff = new Difference(new \DateTime('2014-04-10'), new \DateTime('2014-04-11')); + $this->assertInstanceOf(Day::class, $diff->getUnit()); + $this->assertSame(1, $diff->getQuantity()); + $this->assertFalse($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_past_date_in_weeks() : void + { + $diff = new Difference(new \DateTime('2014-04-15'), new \DateTime('2014-04-01')); + $this->assertInstanceOf(Week::class, $diff->getUnit()); + $this->assertSame(2, $diff->getQuantity()); + $this->assertTrue($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_future_date_in_weeks() : void + { + $diff = new Difference(new \DateTime('2014-04-01'), new \DateTime('2014-04-15')); + $this->assertInstanceOf(Week::class, $diff->getUnit()); + $this->assertSame(2, $diff->getQuantity()); + $this->assertFalse($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_past_date_in_months() : void + { + $diff = new Difference(new \DateTime('2014-04-01'), new \DateTime('2014-03-01')); + $this->assertInstanceOf(Month::class, $diff->getUnit()); + $this->assertSame(1, $diff->getQuantity()); + $this->assertTrue($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_future_date_in_months() : void + { + $diff = new Difference(new \DateTime('2014-04-01'), new \DateTime('2014-05-01')); + $this->assertInstanceOf(Month::class, $diff->getUnit()); + $this->assertSame(1, $diff->getQuantity()); + $this->assertFalse($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_past_date_in_years() : void + { + $diff = new Difference(new \DateTime('2014-01-01'), new \DateTime('2012-01-01')); + $this->assertInstanceOf(Year::class, $diff->getUnit()); + $this->assertSame(2, $diff->getQuantity()); + $this->assertTrue($diff->isPast()); + } + + public function test_calculate_diff_between_present_and_future_date_in_years() : void + { + $diff = new Difference(new \DateTime('2014-01-01'), new \DateTime('2015-01-01')); + $this->assertInstanceOf(Year::class, $diff->getUnit()); + $this->assertSame(1, $diff->getQuantity()); + $this->assertFalse($diff->isPast()); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/DateTime/FormatterTest.php b/tests/Coduo/PHPHumanizer/Tests/DateTime/FormatterTest.php new file mode 100644 index 0000000..72d6011 --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/DateTime/FormatterTest.php @@ -0,0 +1,44 @@ +assertSame('10 minutes ago', $formatter->formatDifference($diff)); + } + + public function test_format_datetime_diff_for_specific_locale() : void + { + $diff = new Difference( + new \DateTime('2015-01-01 00:10:00'), + new \DateTime('2015-01-01 00:00:00') + ); + + $formatter = new Formatter(Builder::build('en')); + + $this->assertSame('10 minut temu', $formatter->formatDifference($diff, 'pl')); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/DateTime/PreciseFormatterTest.php b/tests/Coduo/PHPHumanizer/Tests/DateTime/PreciseFormatterTest.php new file mode 100644 index 0000000..f32a306 --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/DateTime/PreciseFormatterTest.php @@ -0,0 +1,56 @@ +assertSame('10 days, 5 hours from now', $formatter->formatDifference($diff)); + } + + public function test_format_compound_datetime_diff_for_specific_locale() : void + { + $diff = new PreciseDifference( + new \DateTime('2015-01-01 00:00:00'), + new \DateTime('2015-01-11 05:00:00') + ); + + $formatter = new PreciseFormatter(Builder::build('en')); + + $this->assertSame('через 10 дней, 5 часов', $formatter->formatDifference($diff, 'ru')); + } + + public function test_format_date_interval() : void + { + $interval = new \DateInterval('P1DT5H25M43S'); + + $formatter = new PreciseFormatter(Builder::build('en')); + + $this->assertSame( + '1 day, 5 hours, 25 minutes, and 43 seconds', + $formatter->formatInterval($interval) + ); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/DateTimeHumanizerTest.php b/tests/Coduo/PHPHumanizer/Tests/DateTimeHumanizerTest.php new file mode 100644 index 0000000..72ca15f --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/DateTimeHumanizerTest.php @@ -0,0 +1,555 @@ +add(TimeUnit::seconds(5)), '20 minutes and 5 seconds', 'en'], + [ + TimeUnit::days(2) + ->add(TimeUnit::hours(3)) + ->add(TimeUnit::minutes(25)) + ->add(TimeUnit::seconds(30)) + ->add(TimeUnit::milliseconds(200)), + '2 days, 3 hours, 25 minutes, and 30.2 seconds', + 'en', + ], + [RelativeTimeUnit::months(14), '1 year and 2 months', 'en'], + + // Polish + [TimeUnit::seconds(20), '20 sekund', 'pl'], + [TimeUnit::minutes(20), '20 minut', 'pl'], + [TimeUnit::minutes(20)->add(TimeUnit::seconds(5)), '20 minut i 5 sekund', 'pl'], + [ + TimeUnit::days(2) + ->add(TimeUnit::hours(3)) + ->add(TimeUnit::minutes(25)) + ->add(TimeUnit::seconds(30)) + ->add(TimeUnit::milliseconds(200)), + '2 dni, 3 godziny, 25 minut i 30.2 sekund', + 'pl', + ], + [RelativeTimeUnit::months(14), '1 rok i 2 miesiące', 'pl'], + + // Swedish + [TimeUnit::seconds(20), '20 sekunder', 'sv'], + [TimeUnit::minutes(20), '20 minuter', 'sv'], + [TimeUnit::minutes(20)->add(TimeUnit::seconds(5)), '20 minuter och 5 sekunder', 'sv'], + [ + TimeUnit::days(2) + ->add(TimeUnit::hours(3)) + ->add(TimeUnit::minutes(25)) + ->add(TimeUnit::seconds(30)) + ->add(TimeUnit::milliseconds(200)), + '2 dagar, 3 timmar, 25 minuter, och 30.2 sekunder', + 'sv', + ], + [RelativeTimeUnit::months(14), '1 år och 2 månader', 'sv'], + ]; + } + + /** + * @dataProvider humanizeDataProvider + */ + public function test_humanize_difference_between_dates(string $firstDate, string $secondDate, string $expected, string $locale) : void + { + $this->assertSame($expected, DateTimeHumanizer::difference(new \DateTime($firstDate), new \DateTime($secondDate), $locale)); + } + + /** + * @dataProvider humanizeDataProvider + */ + public function test_humanize_time_period(string $firstDate, string $secondDate, string $expected, string $locale) : void + { + $this->assertSame($expected, DateTimeHumanizer::timePeriod(new TimePeriod(DateTime::fromString($firstDate), DateTime::fromString($secondDate)), $locale)); + } + + /** + * @dataProvider preciseDifferenceDataProvider + */ + public function test_humanize_precise_difference_between_dates(string $firstDate, string $secondDate, string $expected, string $locale) : void + { + $this->assertSame($expected, DateTimeHumanizer::timePeriodPrecise(new TimePeriod(DateTime::fromString($firstDate), DateTime::fromString($secondDate)), $locale)); + } + + /** + * @dataProvider preciseDifferenceDataProvider + */ + public function test_humanize_time_period_precise(string $firstDate, string $secondDate, string $expected, string $locale) : void + { + $this->assertSame($expected, DateTimeHumanizer::preciseDifference(new \DateTime($firstDate), new \DateTime($secondDate), $locale)); + } + + /** + * @dataProvider timeUnitDataProvider + */ + public function test_humanize_time_unit(Unit $unit, string $expected, string $locale) : void + { + $this->assertSame($expected, DateTimeHumanizer::timeUnit($unit, $locale)); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/NumberHumanizerTest.php b/tests/Coduo/PHPHumanizer/Tests/NumberHumanizerTest.php new file mode 100644 index 0000000..e5bcf2b --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/NumberHumanizerTest.php @@ -0,0 +1,585 @@ +assertSame($expected, NumberHumanizer::ordinal($number)); + } + + /** + * @dataProvider ordinalIndicatorDutchProvider + * + * @param $expected + * @param $number + */ + public function test_return_ordinal_suffix_dutch($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinal($number, 'nl')); + } + + /** + * @dataProvider ordinalIndicatorIndonesianProvider + * + * @param $expected + * @param $number + */ + public function test_return_ordinal_suffix_indonesian($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinal($number, 'id')); + } + + /** + * @dataProvider ordinalSuffixPtEsItProvider + * + * @param $expected + * @param $number + */ + public function test_return_ordinal_suffix_spanish($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinal($number, 'es')); + } + + /** + * @dataProvider ordinalSuffixPtEsItProvider + * + * @param $expected + * @param $number + */ + public function test_return_ordinal_suffix_italian($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinal($number, 'it')); + } + + /** + * @dataProvider ordinalSuffixGermanProvider + * + * @param $expected + * @param $number + */ + public function test_return_ordinal_suffix_german($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinal($number, 'de')); + } + + /** + * @dataProvider ordinalSuffixFrenchProvider + * + * @param $expected + * @param $number + */ + public function test_return_ordinal_suffix_french($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinal($number, 'fr')); + } + + /** + * @dataProvider ordinalizeDataProvider + * + * @depends test_return_ordinal_suffix + * + * @param $expected + * @param $number + */ + public function test_ordinalize_numbers($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinalize($number)); + } + + /** + * @dataProvider ordinalizeDataDutchProvider + * + * @depends test_return_ordinal_suffix_dutch + * + * @param $expected + * @param $number + */ + public function test_ordinalize_numbers_dutch($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinalize($number, 'nl')); + } + + /** + * @dataProvider ordinalizeDataIndonesianProvider + * + * @depends test_return_ordinal_suffix_indonesian + * + * @param $expected + * @param $number + */ + public function test_ordinalize_numbers_indonesian($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinalize($number, 'id')); + } + + /** + * @dataProvider ordinalizeDataPtEsItProvider + * + * @param $expected + * @param $number + */ + public function test_ordinalize_numbers_portuguese($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinalize($number, 'pt')); + } + + /** + * @dataProvider ordinalizeDataPtEsItProvider + * + * @param $expected + * @param $number + */ + public function test_ordinalize_numbers_spanish($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinalize($number, 'es')); + } + + /** + * @dataProvider ordinalizeDataPtEsItProvider + * + * @param $expected + * @param $number + */ + public function test_ordinalize_numbers_italian($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinalize($number, 'it')); + } + + /** + * @dataProvider ordinalizeDataGermanProvider + * + * @param $expected + * @param $number + */ + public function test_ordinalize_numbers_german($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinalize($number, 'de')); + } + + /** + * @dataProvider ordinalizeDataFrenchProvider + * + * @param $expected + * @param $number + */ + public function test_ordinalize_numbers_french($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::ordinalize($number, 'fr')); + } + + /** + * @dataProvider binarySuffixDataProvider + * + * @param $expected + * @param $number + * @param string $locale + */ + public function test_convert_number_to_string_with_binary_suffix($expected, $number, $locale = 'en') : void + { + $this->assertSame($expected, NumberHumanizer::binarySuffix($number, $locale)); + } + + /** + * @dataProvider preciseBinarySuffixDataProvider + * + * @param $expected + * @param $number + * @param string $locale + * @param int $precision + */ + public function test_convert_number_to_string_with_precise_binary_suffix($expected, $number, $precision, $locale = 'en') : void + { + $this->assertSame($expected, NumberHumanizer::preciseBinarySuffix($number, $precision, $locale)); + } + + public function test_statically_throw_exception_when_converting_to_string_with_precise_binary_suffix_negative_precision() : void + { + $this->expectException(\InvalidArgumentException::class); + + NumberHumanizer::preciseBinarySuffix(1, -1); + } + + public function test_statically_throw_exception_when_converting_to_string_with_precise_binary_suffix_large_precision() : void + { + $this->expectException(\InvalidArgumentException::class); + + NumberHumanizer::preciseBinarySuffix(1, 4); + } + + /** + * @dataProvider metricSuffixDataProvider + * + * @param $expected + * @param $number + * @param string $locale + */ + public function test_convert_number_to_string_with_metric_suffix($expected, $number, $locale = 'en') : void + { + $this->assertSame($expected, NumberHumanizer::metricSuffix($number, $locale)); + } + + public function test_statically_throw_exception_when_converting_to_string_with_metric_suffix_non_numeric_values() : void + { + $this->expectException(\InvalidArgumentException::class); + + NumberHumanizer::metricSuffix('as12'); + } + + /** + * @dataProvider romanDataProvider + * + * @param $expected + * @param $number + */ + public function test_converts_numbers_to_roman($expected, $number) : void + { + $this->assertSame($expected, NumberHumanizer::toRoman($number)); + } + + /** + * @dataProvider romanDataProvider + * + * @param $expected + * @param $number + */ + public function test_convert_roman_numbers_to_arabic($number, $expected) : void + { + $this->assertSame($expected, NumberHumanizer::fromRoman($number)); + } + + /** + * @dataProvider romanExceptionProvider + * + * @param $number + */ + public function test_statically_throw_exception_when_converting_number_is_out_of_range($number) : void + { + $this->expectException(\InvalidArgumentException::class); + + NumberHumanizer::toRoman($number); + } + + /** + * @dataProvider arabicExceptionProvider + * + * @param $number + */ + public function test_statically_throw_exception_when_converting_roman_number_is_invalid($number) : void + { + $this->expectException(\InvalidArgumentException::class); + + NumberHumanizer::fromRoman($number); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/String/WordBreakpointTest.php b/tests/Coduo/PHPHumanizer/Tests/String/WordBreakpointTest.php new file mode 100644 index 0000000..274e0bf --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/String/WordBreakpointTest.php @@ -0,0 +1,51 @@ +assertSame(5, $wordBreakpoint->calculatePosition('Lorem ipsum dolorem', 2)); + $this->assertSame(5, $wordBreakpoint->calculatePosition('Lorem ipsum dolorem', 4)); + $this->assertSame(5, $wordBreakpoint->calculatePosition('Lorem ipsum dolorem', 5)); + $this->assertSame(11, $wordBreakpoint->calculatePosition('Lorem ipsum dolorem', 10)); + $this->assertSame(19, $wordBreakpoint->calculatePosition('Lorem ipsum dolorem', -2)); + $this->assertSame(5, $wordBreakpoint->calculatePosition('Lorem ipsum dolorem', 0)); + } + + public function test_calculate_breakpoint_position_when_sentence_is_shorter_than_characters_count() : void + { + $wordBreakpoint = new WordBreakpoint(); + + $this->assertSame(19, $wordBreakpoint->calculatePosition('Lorem ipsum dolorem', 20)); + } + + public function test_calculate_breakpoint_position_when_characters_count_ends_in_last_word() : void + { + $wordBreakpoint = new WordBreakpoint(); + + $this->assertSame(11, $wordBreakpoint->calculatePosition('Lorem ipsum', 7)); + } + + public function test_calculate_breakpoint_position_when_characters_count_ends_in_last_space() : void + { + $wordBreakpoint = new WordBreakpoint(); + + $this->assertSame(5, $wordBreakpoint->calculatePosition('Lorem ipsum', 5)); + } +} diff --git a/tests/Coduo/PHPHumanizer/Tests/StringHumanizerTest.php b/tests/Coduo/PHPHumanizer/Tests/StringHumanizerTest.php new file mode 100644 index 0000000..692364f --- /dev/null +++ b/tests/Coduo/PHPHumanizer/Tests/StringHumanizerTest.php @@ -0,0 +1,165 @@ +HyperText Markup Language, commonly referred to as HTML, is the standard markup language used to create web pages.[1] Web browsers can read HTML files and render them into visible or audible web pages. HTML describes the structure of a website semantically along with cues for presentation, making it a markup language, rather than a programming language.

'; + + return [ + [$text, 3, '', 'HyperText'], + [$text, 12, '', 'HyperText Markup'], + [$text, 30, '', 'HyperText Markup Language, commonly'], + [$text, 50, '', 'HyperText Markup Language, commonly referred to as'], + [$text, 75, '', 'HyperText Markup Language, commonly referred to as HTML, is the standard markup'], + [$text, 100, '', 'HyperText Markup Language, commonly referred to as HTML, is the standard markup language used to create'], + [$text, 3, '', 'HyperText'], + [$text, 12, '', 'HyperText Markup'], + [$text, 50, '', 'HyperText Markup Language, commonly referred to as'], + [$text, 75, '', 'HyperText Markup Language, commonly referred to as HTML, is the standard markup'], + [$text, 100, '', 'HyperText Markup Language, commonly referred to as HTML, is the standard markup language used to create'], + [$text, 50, '', 'HyperText Markup Language, commonly referred to as...', '...'], + [$text, 75, '', 'HyperText Markup Language, commonly referred to as HTML, is the standard markup...', '...'], + ]; + } + + /** + * @dataProvider humanizeStringProvider + * + * @param $input + * @param $expected + * @param $capitalize + * @param $separator + * @param array $forbiddenWords + */ + public function test_humanize_strings($input, $expected, $capitalize, $separator, array $forbiddenWords) : void + { + $this->assertSame($expected, StringHumanizer::humanize($input, $capitalize, $separator, $forbiddenWords)); + } + + /** + * @dataProvider truncateStringProvider + * + * @param $text + * @param $expected + * @param $charactersCount + * @param string $append + */ + public function test_truncate_string_to_word_closest_to_a_certain_number_of_characters($text, $expected, $charactersCount, $append = '') : void + { + $this->assertSame($expected, StringHumanizer::truncate($text, $charactersCount, $append)); + } + + /** + * @dataProvider truncateHtmlStringProvider + * + * @param $text + * @param $charactersCount + * @param $allowedTags + * @param $expected + * @param $append + */ + public function test_truncate_string_to_word_closest_to_a_certain_number_of_characters_with_html_tags($text, $charactersCount, $allowedTags, $expected, $append = '') : void + { + $this->assertSame($expected, StringHumanizer::truncateHtml($text, $charactersCount, $allowedTags, $append)); + } + + /** + * @dataProvider removeAllShortcodesProvider + * + * @param $text + * @param $expected + */ + public function test_remove_all_shortcodes_from_text($text, $expected) : void + { + $this->assertSame($expected, StringHumanizer::removeShortcodes($text)); + } + + /** + * @dataProvider removeShortcodeTagsProvider + * + * @param $text + * @param $expected + */ + public function test_remove_only_shortcode_tags_from_text($text, $expected) : void + { + $this->assertSame($expected, StringHumanizer::removeShortcodeTags($text)); + } +} diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 0000000..5657f6e --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/tools/composer.json b/tools/composer.json new file mode 100644 index 0000000..31cd76d --- /dev/null +++ b/tools/composer.json @@ -0,0 +1,10 @@ +{ + "name": "coduo/php-humanizer", + "description": "PHP Humanizer - Tools", + "autoload": {}, + "require-dev": { + "phpunit/phpunit": "^10", + "phpstan/phpstan": "^1", + "friendsofphp/php-cs-fixer": "^3.53" + } +} diff --git a/tools/composer.lock b/tools/composer.lock new file mode 100644 index 0000000..25cea75 --- /dev/null +++ b/tools/composer.lock @@ -0,0 +1,4331 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "52130002fb8d6b03652b0158924085b4", + "packages": [], + "packages-dev": [ + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be/" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com/", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-12T16:29:46+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de/" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be/" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl/" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.4" + }, + "funding": [ + { + "url": "https://packagist.com/", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2025-08-20T19:15:30+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com/", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2025-08-14T07:29:31+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.91.3", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "9f10aa6390cea91da175ea608880e942d7c0226e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9f10aa6390cea91da175ea608880e942d7c0226e", + "reference": "9f10aa6390cea91da175ea608880e942d7c0226e", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.3", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.5", + "ext-filter": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.3", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.6", + "react/event-loop": "^1.5", + "react/socket": "^1.16", + "react/stream": "^1.4", + "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0", + "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.33", + "symfony/polyfill-php80": "^1.33", + "symfony/polyfill-php81": "^1.33", + "symfony/polyfill-php84": "^1.33", + "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2 || ^8.0", + "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.7", + "infection/infection": "^0.31.0", + "justinrainbow/json-schema": "^6.5", + "keradus/cli-executor": "^2.2", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.9", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", + "phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34", + "symfony/var-dumper": "^5.4.48 || ^6.4.24 || ^7.3.2 || ^8.0", + "symfony/yaml": "^5.4.45 || ^6.4.24 || ^7.3.2 || ^8.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/**/Internal/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.91.3" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2025-12-05T19:45:37+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.13.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-08-01T08:46:24+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.7.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + }, + "time": "2025-12-06T11:56:16+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.12.32", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8", + "reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2025-09-30T10:16:31+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "10.1.16", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-text-template": "^3.0.1", + "sebastian/code-unit-reverse-lookup": "^3.0.0", + "sebastian/complexity": "^3.2.0", + "sebastian/environment": "^6.1.0", + "sebastian/lines-of-code": "^2.0.2", + "sebastian/version": "^4.0.1", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:31:57+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T06:24:48+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:09+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T14:07:24+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:57:52+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "10.5.60", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "f2e26f52f80ef77832e359205f216eeac00e320c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f2e26f52f80ef77832e359205f216eeac00e320c", + "reference": "f2e26f52f80ef77832e359205f216eeac00e320c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-invoker": "^4.0.0", + "phpunit/php-text-template": "^3.0.1", + "phpunit/php-timer": "^6.0.0", + "sebastian/cli-parser": "^2.0.1", + "sebastian/code-unit": "^2.0.0", + "sebastian/comparator": "^5.0.4", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.4", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.1", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.60" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2025-12-06T07:50:42+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.6", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-01-01T16:37:48+00:00" + }, + { + "name": "react/dns", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.14.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-18T19:34:28+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-17T20:46:25+00:00" + }, + { + "name": "react/promise", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.12.28 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-08-19T18:57:03+00:00" + }, + { + "name": "react/socket", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.17.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-19T20:47:34+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:12:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:15+00:00" + }, + { + "name": "sebastian/comparator", + "version": "5.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "e8e53097718d2b53cfb2aa859b06a41abf58c62e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e8e53097718d2b53cfb2aa859b06a41abf58c62e", + "reference": "e8e53097718d2b53cfb2aa859b06a41abf58c62e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2025-09-07T05:25:07+00:00" + }, + { + "name": "sebastian/complexity", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "68ff824baeae169ec9f2137158ee529584553799" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:37:17+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:15:17+00:00" + }, + { + "name": "sebastian/environment", + "version": "6.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-23T08:47:14+00:00" + }, + { + "name": "sebastian/exporter", + "version": "5.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "0735b90f4da94969541dac1da743446e276defa6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6", + "reference": "0735b90f4da94969541dac1da743446e276defa6", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2025-09-24T06:09:11+00:00" + }, + { + "name": "sebastian/global-state", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:19:19+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:38:20+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:32+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:18+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a", + "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" + } + ], + "time": "2025-08-10T07:50:56+00:00" + }, + { + "name": "sebastian/type", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:10:45+00:00" + }, + { + "name": "sebastian/version", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-07T11:34:05+00:00" + }, + { + "name": "symfony/console", + "version": "v8.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "fcb73f69d655b48fcb894a262f074218df08bd58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/fcb73f69d655b48fcb894a262f074218df08bd58", + "reference": "fcb73f69d655b48fcb894a262f074218df08bd58", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.4|^8.0" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/lock": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com/", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v8.0.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-12-05T15:25:33+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com/", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "573f95783a2ec6e38752979db139f09fec033f03" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/573f95783a2ec6e38752979db139f09fec033f03", + "reference": "573f95783a2ec6e38752979db139f09fec033f03", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/security-http": "<7.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/framework-bundle": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com/", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v8.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-10-30T14:17:19+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com/", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v8.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "d937d400b980523dc9ee946bb69972b5e619058d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d937d400b980523dc9ee946bb69972b5e619058d", + "reference": "d937d400b980523dc9ee946bb69972b5e619058d", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com/", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v8.0.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-12-01T09:13:36+00:00" + }, + { + "name": "symfony/finder", + "version": "v8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "7598dd5770580fa3517ec83e8da0c9b9e01f4291" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/7598dd5770580fa3517ec83e8da0c9b9e01f4291", + "reference": "7598dd5770580fa3517ec83e8da0c9b9e01f4291", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "symfony/filesystem": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com/", + "support": { + "source": "https://github.com/symfony/finder/tree/v8.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-11-05T14:36:47+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/d2b592535ffa6600c265a3893a7f7fd2bad82dd7", + "reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com/", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v8.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-11-12T15:55:31+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com/", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com/", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-27T09:58:17+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com/", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com/", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-23T08:48:59+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com/", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-01-02T08:10:11+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com/", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php84", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com/", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-24T13:30:11+00:00" + }, + { + "name": "symfony/process", + "version": "v8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "a0a750500c4ce900d69ba4e9faf16f82c10ee149" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/a0a750500c4ce900d69ba4e9faf16f82c10ee149", + "reference": "a0a750500c4ce900d69ba4e9faf16f82c10ee149", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com/", + "support": { + "source": "https://github.com/symfony/process/tree/v8.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-10-16T16:25:44+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.6.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com/", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-15T11:30:57+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "67df1914c6ccd2d7b52f70d40cf2aea02159d942" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/67df1914c6ccd2d7b52f70d40cf2aea02159d942", + "reference": "67df1914c6ccd2d7b52f70d40cf2aea02159d942", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com/", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v8.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-08-04T07:36:47+00:00" + }, + { + "name": "symfony/string", + "version": "v8.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "ba65a969ac918ce0cc3edfac6cdde847eba231dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/ba65a969ac918ce0cc3edfac6cdde847eba231dc", + "reference": "ba65a969ac918ce0cc3edfac6cdde847eba231dc", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com/", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v8.0.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-12-01T09:13:36+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-11-17T20:03:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +}