FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

upgrade to CakePHP 5 #593

Closed arusinowski closed 1 year ago

arusinowski commented 1 year ago

Hi, this is cakephp upload plugin updated to CakePHP 5 dev version. I will update this branch as new versions of CakePHP5 become available.

ADmad commented 1 year ago

To get the testsuite running you'll also need to update the phpunit config and the tests bootstrap to use the new fixture schema loading. You can refer to the cake-5 of the search plugin for the same.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 92.10% and project coverage change: -0.02 :warning:

Comparison is base (820a45c) 95.87% compared to head (5345747) 95.86%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## cake-5 #593 +/- ## ============================================ - Coverage 95.87% 95.86% -0.02% Complexity 109 109 ============================================ Files 11 11 Lines 291 290 -1 ============================================ - Hits 279 278 -1 Misses 12 12 ``` | [Impacted Files](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake) | Coverage Δ | | |---|---|---| | [src/File/Transformer/DefaultTransformer.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL0ZpbGUvVHJhbnNmb3JtZXIvRGVmYXVsdFRyYW5zZm9ybWVyLnBocA==) | `100.00% <ø> (ø)` | | | [src/UploadPlugin.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL1VwbG9hZFBsdWdpbi5waHA=) | `0.00% <ø> (ø)` | | | [src/Database/Type/FileType.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL0RhdGFiYXNlL1R5cGUvRmlsZVR5cGUucGhw) | `33.33% <33.33%> (ø)` | | | [src/Model/Behavior/UploadBehavior.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL01vZGVsL0JlaGF2aW9yL1VwbG9hZEJlaGF2aW9yLnBocA==) | `95.04% <88.88%> (+0.04%)` | :arrow_up: | | [src/File/Path/Basepath/DefaultTrait.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL0ZpbGUvUGF0aC9CYXNlcGF0aC9EZWZhdWx0VHJhaXQucGhw) | `100.00% <100.00%> (ø)` | | | [src/File/Path/DefaultProcessor.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL0ZpbGUvUGF0aC9EZWZhdWx0UHJvY2Vzc29yLnBocA==) | `100.00% <100.00%> (ø)` | | | [src/File/Path/Filename/DefaultTrait.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL0ZpbGUvUGF0aC9GaWxlbmFtZS9EZWZhdWx0VHJhaXQucGhw) | `92.30% <100.00%> (+6.59%)` | :arrow_up: | | [src/File/Writer/DefaultWriter.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL0ZpbGUvV3JpdGVyL0RlZmF1bHRXcml0ZXIucGhw) | `100.00% <100.00%> (ø)` | | | [src/Validation/Traits/ImageValidationTrait.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL1ZhbGlkYXRpb24vVHJhaXRzL0ltYWdlVmFsaWRhdGlvblRyYWl0LnBocA==) | `100.00% <100.00%> (ø)` | | | [src/Validation/Traits/UploadValidationTrait.php](https://app.codecov.io/gh/FriendsOfCake/cakephp-upload/pull/593?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FriendsOfCake#diff-c3JjL1ZhbGlkYXRpb24vVHJhaXRzL1VwbG9hZFZhbGlkYXRpb25UcmFpdC5waHA=) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

LordSimal commented 1 year ago

@arusinowski we recently released CakePHP 5.0 RC1 which also included a major PHPUnit update from 9 to 10. Do you want to continue/finish this PR?

arusinowski commented 1 year ago

@arusinowski we recently released CakePHP 5.0 RC1 which also included a major PHPUnit update from 9 to 10. Do you want to continue/finish this PR?

Yes, i already started working on tests upgrade

LordSimal commented 1 year ago

FYI: The new Cake5 CI workflow doesn't require having phpstan and psalm in the composer.json anymore. instead all you have to do is add this file to the repo (inside the .phive folder of course) Then github CI can check stan as well.

You can also adjust the composer.json scripts section to contain the additional commands like you can see here: https://github.com/cakephp/debug_kit/blob/5.x/composer.json#L54-L62 Then you can check stan locally as well.