-
Notifications
You must be signed in to change notification settings - Fork 14
Comparing changes
Open a pull request
base repository: ddeboer/transcoder
base: master
head repository: fossar/transcoder
compare: master
Commits on Jan 11, 2021
-
Modern PHPUnit does not run suites without names.
Configuration menu - View commit details
-
Copy full SHA for bc03ab8 - Browse repository at this point
Copy the full SHA bc03ab8View commit details
Commits on Jan 13, 2021
-
tests: Use symfony/phpunit-bridge
PHPUnit 7 is not compatible with PHP 8 and PHPUnit 8 adds return annotations to setUp method, requiring us to add those as well to pass return covariance checks. We can bypass that by renaming the setUp methods and using @before annotations but then there are other issues as well. For example, recent PHPUnit no longer supports @expectexception annotations an other issues. Let’s use Symfony’s PHPUnit bridge, which will allow us the widest range of supported PHP versions. We will need to bump to PHP 5.6+ since that is what php-unit bridge requires but PHP 5.4 is not even supported by Debian Jessie (oldoldstable). We also need to set locale appropriately for the null passed to iconv to work, since phpunit-bridge uses C locale (ASCII) for consistency.
Configuration menu - View commit details
-
Copy full SHA for 37b3afb - Browse repository at this point
Copy the full SHA 37b3afbView commit details -
These are relevant now. Also had to explicitly set xdebug mode on versions using XDebug 3.
Configuration menu - View commit details
-
Copy full SHA for d3581bf - Browse repository at this point
Copy the full SHA d3581bfView commit details -
For easier running of scripts. Now we can just execute `composer test`.
Configuration menu - View commit details
-
Copy full SHA for b0ca55d - Browse repository at this point
Copy the full SHA b0ca55dView commit details
Commits on May 22, 2021
-
Configuration menu - View commit details
-
Copy full SHA for c69a559 - Browse repository at this point
Copy the full SHA c69a559View commit details -
This will allow people to easily enter a shell with dependencies like PHP and composer pre-installed. Just install *Nix package manager* and run `nix-shell`. You can also get *direnv* to be placed in the environment automatically whenever you `cd` into the project directory in a terminal emulator. You can also switch the used PHP version by changing `matrix.phpPackage` value in the `flake.nix` file and re-running `nix-shell`. For more information, check out https://github.com/fossar/selfoss/blob/e0a0ee2a88fc1be8563a3eb361c7b1142b239232/docs/content/docs/development/using-nix.md
Configuration menu - View commit details
-
Copy full SHA for 5a5e094 - Browse repository at this point
Copy the full SHA 5a5e094View commit details -
ci: Add GitHub Actions workflow
This will run tests on all supported PHP version 5.6 through 8.0.
Configuration menu - View commit details
-
Copy full SHA for 5c2d66a - Browse repository at this point
Copy the full SHA 5c2d66aView commit details -
iconv: Fix matching warning on PHP 8
PHP 8 says encoding instead of charset: php/php-src@a4331a6 It is also a warning instead of notice: php/php-src@9e3f352
Configuration menu - View commit details
-
Copy full SHA for c1a9af4 - Browse repository at this point
Copy the full SHA c1a9af4View commit details
Commits on May 23, 2021
-
Configuration menu - View commit details
-
Copy full SHA for f710bfd - Browse repository at this point
Copy the full SHA f710bfdView commit details -
Pair error handler restoration properly
Previously, the error handlers in IconvTranscoder and MbTranscoder were not restored on error because exception was raised. And what is worse, MbTranscoder popped the error handler stack even when it did not push into it. Let’s fix the former by restoring in a finally block (not catching the raised exception), and the latter by restoring only conditionally.
Configuration menu - View commit details
-
Copy full SHA for 09d89e2 - Browse repository at this point
Copy the full SHA 09d89e2View commit details -
mbstring: Restore the ability to pass “auto” as input language
Since PHP 7.3, the array returned by `mb_list_encodings` [no longer contains “auto”]. [no longer contains “auto”]: php/php-src@1151554 `MbTranscoder::isSupported` therefore rejected “auto” and it could not be used as source encoding. To restore previous behaviour, let’s whitelist “auto” ourselves. We still reject “auto” for target encoding since PHP would reject it itself if passed. Note that PHP 8 started [throwing ValueError] when unknown encoding is passed so in the future, we might want to just rethrow that: [throwing ValueError]: php/php-src@229dff9 Also note that the interpretation of “[auto]” depends on the value of `mbstring.language` setting: [auto]: https://github.com/php/php-src/blob/d61d21ad57d04b91a1155153811d16ea982fa106/ext/mbstring/mbstring.c#L296-L306 > If "auto" is set, it is expanded to the list of encodings defined per the NLS. For instance, if the NLS is set to Japanese, the value is assumed to be "ASCII,JIS,UTF-8,EUC-JP,SJIS". > — https://www.php.net/manual/en/mbstring.supported-encodings.php Interestingly, you can include [auto] along with other encodings in `from_encodings` and the expanded encodings will get added to the list. But with the default “neutral” NLS settings, it actually just expands to [ASCII and UTF-8] and the available [identity lists] are useless for Western languages. I would therefore recommend avoiding “auto” and passing the source encoding(s) explicitly. [ASCII and UTF-8]: https://github.com/php/php-src/blob/d61d21ad57d04b91a1155153811d16ea982fa106/ext/mbstring/mbstring.c#L144-L147 [identity lists]: https://github.com/php/php-src/blob/d61d21ad57d04b91a1155153811d16ea982fa106/ext/mbstring/mbstring.c#L88-L142 Finally, although not really relevant for us, since we just use our default input encoding, PHP 8 added support for passing `null` to `from_encodings`, in which case the current internal encoding will be used: https://github.com/php/php-src/blob/d61d21ad57d04b91a1155153811d16ea982fa106/ext/mbstring/mbstring.c#L2529
Configuration menu - View commit details
-
Copy full SHA for a9ceb91 - Browse repository at this point
Copy the full SHA a9ceb91View commit details -
Clarify that “auto-detection” does not actually work
for the most part. Change the tests to actually test the case where it works. This also fixes the warnings that the tests do not contain assertions.
Configuration menu - View commit details
-
Copy full SHA for 7533db0 - Browse repository at this point
Copy the full SHA 7533db0View commit details -
Transcoder: Fix instantiation without iconv
If we do not have iconv, it should still work with just mbstring.
Configuration menu - View commit details
-
Copy full SHA for 5df19bb - Browse repository at this point
Copy the full SHA 5df19bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for de61ecd - Browse repository at this point
Copy the full SHA de61ecdView commit details -
Configuration menu - View commit details
-
Copy full SHA for c1ee207 - Browse repository at this point
Copy the full SHA c1ee207View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d2d361 - Browse repository at this point
Copy the full SHA 2d2d361View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ca3044 - Browse repository at this point
Copy the full SHA 4ca3044View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3bcca53 - Browse repository at this point
Copy the full SHA 3bcca53View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3774c76 - Browse repository at this point
Copy the full SHA 3774c76View commit details -
ci: Install php-cs-fixer through Nix
Since this is library, we do not have a lock file so let’s just use the package from Nix.
Configuration menu - View commit details
-
Copy full SHA for 0b8e82c - Browse repository at this point
Copy the full SHA 0b8e82cView commit details -
Configuration menu - View commit details
-
Copy full SHA for dd4012b - Browse repository at this point
Copy the full SHA dd4012bView commit details
Commits on Mar 7, 2023
-
Flake lock file updates: • Updated input 'phps': 'github:fossar/nix-phps/da4f25e4a230e42b349df2d8c9c66c1717191413' (2021-05-23) → 'github:fossar/nix-phps/181dee32f3d47312674462cff30fcca661c6c643' (2023-03-05) • Updated input 'phps/flake-compat': 'github:edolstra/flake-compat/99f1c2157fba4bfe6211a321fd0ee43199025dbf' (2020-11-26) → 'github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9' (2023-01-17) • Updated input 'phps/nixpkgs': 'github:NixOS/nixpkgs/efee454783c5c14ae78687439077c1d3f0544d97' (2021-05-22) → 'github:NixOS/nixpkgs/f5ffd5787786dde3a8bf648c7a1b5f78c4e01abb' (2023-03-03) • Updated input 'phps/utils': 'github:numtide/flake-utils/b543720b25df6ffdfcf9227afafc5b8c1fabfae8' (2021-05-11) → 'github:numtide/flake-utils/3db36a8b464d0c4532ba1c7dda728f4576d6d073' (2023-02-13)
Configuration menu - View commit details
-
Copy full SHA for e0cd0e4 - Browse repository at this point
Copy the full SHA e0cd0e4View commit details -
- Bump image version to latest: https://github.blog/changelog/2022-11-09-github-actions-ubuntu-latest-workflows-will-use-ubuntu-22-04/ - Avoid using deprecated ::set-output https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ - actions/cache: 2 → 3 https://github.com/actions/cache/releases/tag/v3.0.0 Also drop unused cache-name environment variable. - actions/checkout: 2 → 3 https://github.com/actions/checkout/releases/tag/v3.0.0 - cachix/install-nix-action: 12 → 20 https://github.com/cachix/install-nix-action/releases/tag/v13 https://github.com/cachix/install-nix-action/releases/tag/v14 https://github.com/cachix/install-nix-action/releases/tag/v15 https://github.com/cachix/install-nix-action/releases/tag/v16 https://github.com/cachix/install-nix-action/releases/tag/v17 https://github.com/cachix/install-nix-action/releases/tag/v18 https://github.com/cachix/install-nix-action/releases/tag/v19 https://github.com/cachix/install-nix-action/releases/tag/v20 - cachix-action: 8 → 12 https://github.com/cachix/cachix-action/releases/tag/v9 https://github.com/cachix/cachix-action/releases/tag/v10 https://github.com/cachix/cachix-action/releases/tag/v11 https://github.com/cachix/cachix-action/releases/tag/v12
Configuration menu - View commit details
-
Copy full SHA for 2d9265f - Browse repository at this point
Copy the full SHA 2d9265fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 446f0b1 - Browse repository at this point
Copy the full SHA 446f0b1View commit details -
Deprecated: iconv(): Passing null to parameter #1 ($from_encoding) of type string is deprecated in src/IconvTranscoder.php on line 49
Configuration menu - View commit details
-
Copy full SHA for 2e1d8fd - Browse repository at this point
Copy the full SHA 2e1d8fdView commit details -
Raise minimum PHP version to 7.2.5
This will allow to use type hints plus clean-up a bit.
Configuration menu - View commit details
-
Copy full SHA for 2a6b03d - Browse repository at this point
Copy the full SHA 2a6b03dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f7ac8b - Browse repository at this point
Copy the full SHA 6f7ac8bView commit details -
And fix some issues. Install PHPStan using Nix so that it is pinned and we do not have to also manage `composer.lock`.
Configuration menu - View commit details
-
Copy full SHA for 0a7c68c - Browse repository at this point
Copy the full SHA 0a7c68cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1864d5f - Browse repository at this point
Copy the full SHA 1864d5fView commit details
Commits on Mar 8, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 941ab65 - Browse repository at this point
Copy the full SHA 941ab65View commit details
Commits on Mar 15, 2025
-
mbstring: Make encoding detection stricter
PHP 8.3 changed how source encoding detection works: https://www.php.net/manual/en/migration83.other-changes.php#migration83.other-changes.functions.mbstring Most locales only consider `ASCII` and `UTF-8` (see `mb_detect_order()`), and when a byte sequence invalid in both tested encodings (such as 0x91 for ‘ in Windows-1252) is encountered, one of them might now be chosen as the most fitting encoding. (This is done using the heuristics introduced in PHP 8.1: php/php-src@28b346b) Compare the output of the following script across PHP versions: <?php $result = hex2bin("91"); var_dump(mb_detect_encoding($result)); var_dump(mb_detect_encoding($result, 'auto', true)); var_dump(mb_convert_encoding($result, 'UTF-8', 'auto')); Let’s run the `mb_detect_encoding()` ourselves with `$strict` argument set to `true`, to ensure consistent behaviour across all PHP versions. This might potentially cause a regression is some cases. Not sure. Additionally, since we are now ensuring all encodings are valid, we can drop the warning capture mechanism. It does not work on PHP ≥ 8.0 anyway, since that raises a `ValueError` instead of a warning when an invalid encoding is provided. https://www.php.net/manual/en/function.mb-convert-encoding.php#refsect1-function.mb-convert-encoding-errors Also adjust the confusing string in tests. https://www.php.net/manual/en/function.mb-convert-encoding.php https://www.php.net/manual/en/function.mb-detect-encoding.php https://www.php.net/manual/en/function.mb-detect-order.php
Configuration menu - View commit details
-
Copy full SHA for 5d40f6b - Browse repository at this point
Copy the full SHA 5d40f6bView commit details -
devenv: Make direnv reload on flake changes
We do not use `flake` direnv feature since flakes currently copy the whole repo into Nix store, so we need to watch the files manually.
Configuration menu - View commit details
-
Copy full SHA for f4eef1f - Browse repository at this point
Copy the full SHA f4eef1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b0ea6bc - Browse repository at this point
Copy the full SHA b0ea6bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2db54e0 - Browse repository at this point
Copy the full SHA 2db54e0View commit details -
phpstan: Rename config to use dist suffix
This allows developer to create their own own config file, e.g. for setting `editorUrl`: https://phpstan.org/user-guide/output-format#opening-file-in-an-editor
Configuration menu - View commit details
-
Copy full SHA for 8094799 - Browse repository at this point
Copy the full SHA 8094799View commit details -
Install PHPStan through composer
It has isolated dependencies nowadays and it will be helpful for other developers, who probably expect it to be installed that way and do not want to use Nix. Do the same with PHP-CS-Fixer.
Configuration menu - View commit details
-
Copy full SHA for fabb6a0 - Browse repository at this point
Copy the full SHA fabb6a0View commit details -
Flake lock file updates: • Updated input 'phps': 'github:fossar/nix-phps/181dee32f3d47312674462cff30fcca661c6c643' (2023-03-05) → 'github:fossar/nix-phps/e48727edd2dbbbd7b9181bd284569554f6e4e5a6' (2025-03-10) • Updated input 'phps/flake-compat': 'github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9' (2023-01-17) → 'github:edolstra/flake-compat/ff81ac966bb2cae68946d5ed5fc4994f96d0ffec' (2024-12-04) • Updated input 'phps/nixpkgs': 'github:NixOS/nixpkgs/f5ffd5787786dde3a8bf648c7a1b5f78c4e01abb' (2023-03-03) → 'github:NixOS/nixpkgs/de0fe301211c267807afd11b12613f5511ff7433' (2025-03-07) • Updated input 'phps/utils': 'github:numtide/flake-utils/3db36a8b464d0c4532ba1c7dda728f4576d6d073' (2023-02-13) → 'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b' (2024-11-13) • Added input 'phps/utils/systems': 'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
Configuration menu - View commit details
-
Copy full SHA for 0bf5a8f - Browse repository at this point
Copy the full SHA 0bf5a8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 52c84e2 - Browse repository at this point
Copy the full SHA 52c84e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d309bd - Browse repository at this point
Copy the full SHA 8d309bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 976d0f4 - Browse repository at this point
Copy the full SHA 976d0f4View commit details -
devenv: Provide locale archive
Without this, the Iconv tests on CI started to fail in `setLocale` invocation: PHPUnit\Framework\Exception: The locale functionality is not implemented on your platform, the specified locale does not exist or the category name is invalid. /home/runner/work/transcoder/transcoder/tests/IconvTranscoderTest.php:25
Configuration menu - View commit details
-
Copy full SHA for 2a7809a - Browse repository at this point
Copy the full SHA 2a7809aView commit details -
Raise minimum PHP version to 7.4
https://www.php.net/releases/7_3_0.php https://www.php.net/releases/7_4_0.php This installed a newer version of CS Fixer - friendsofphp/php-cs-fixer updated from v3.4.0 to v3.72.0 minor See changes: PHP-CS-Fixer/PHP-CS-Fixer@FriendsOfPHP:v3.4.0...PHP-CS-Fixer:v3.72.0 Release notes: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/v3.72.0 - `no_superfluous_phpdoc_tags` removes `inheritdoc`. - `phpdoc_to_param_type` did its thing in one place. As a result, I had to fix some rules: - Disable `phpdoc_to_param_type` since it now tries to use union type in a param type hint, which is only supported on PHP 8.0. Also enable PHP 7.3 migration in PHP-CS-Fixer, although there was nothing to do.
Configuration menu - View commit details
-
Copy full SHA for ac7fc2c - Browse repository at this point
Copy the full SHA ac7fc2cView commit details -
Not a BC break since all of them are private. Had to change an initialization check in `MbTranscoder::__construct`, since PHPStan figured out it is not nullable.
Configuration menu - View commit details
-
Copy full SHA for f396153 - Browse repository at this point
Copy the full SHA f396153View commit details -
- phpstan/phpstan updated from 1.12.21 to 2.1.8 major See changes: phpstan/phpstan@1.12.21...2.1.8 Release notes Had to remove redundant assertion. Not clear when false can actually occur on PHP ≥ 8.0 – on PHP 7.4, it can happen when passing an invalid target encoding but on PHP 8.0, it just throws a `ValueError`.
Configuration menu - View commit details
-
Copy full SHA for b4f8126 - Browse repository at this point
Copy the full SHA b4f8126View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3afd573 - Browse repository at this point
Copy the full SHA 3afd573View commit details
There are no files selected for viewing
This file was deleted.