laminas-validator icon indicating copy to clipboard operation
laminas-validator copied to clipboard

Supported PSR-7 in File\Count validator

Open icetee opened this issue 2 years ago • 4 comments

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

This PR complements previous PR https://github.com/zendframework/zend-validator/pull/251. Recommendation PSR-7 UploadedFileInterface has not been implemented in File / Count validation. At the same time, it improves the https://github.com/laminas/laminas-validator/issues/24 issue.

This PR is same https://github.com/laminas/laminas-validator/pull/109, but upgrade Count path for Actions workflow tests.

icetee avatar Oct 16 '22 22:10 icetee

I just noted that this package does not depend on psr/http-message, which is only in require-dev:

https://github.com/laminas/laminas-validator/blob/23e27edc1520c0bf0c9c7e7f192dd1314677969e/composer.json#L50

I think declaring the dependency, although annoying, would be wise here.

Ocramius avatar Oct 17 '22 08:10 Ocramius

I just noted that this package does not depend on psr/http-message, which is only in require-dev:

https://github.com/laminas/laminas-validator/blob/23e27edc1520c0bf0c9c7e7f192dd1314677969e/composer.json#L50

I think declaring the dependency, although annoying, would be wise here.

I was going to suggest that too, but it is already listed in suggest - for the same reasoning we should require everything else too?? I would prefer it that way FWIW, but instanceof has got our back here right?

gsteel avatar Oct 17 '22 08:10 gsteel

but instanceof has got our back here right?

Not if a new major version breaks BC there :|

Ocramius avatar Oct 17 '22 08:10 Ocramius

Not if a new major version breaks BC there :|

Good point - tests wouldn't catch that because dev is pinned to ^1

gsteel avatar Oct 17 '22 08:10 gsteel

I corrected what came up.

UploadedFileInterface is used in several places in non-test code. https://github.com/laminas/laminas-validator/blob/a995b21d18c63cd1f5d123d0d2cd31a1c2d828dc/src/File/Upload.php#L91 https://github.com/laminas/laminas-validator/blob/a995b21d18c63cd1f5d123d0d2cd31a1c2d828dc/src/File/Upload.php#L134 https://github.com/laminas/laminas-validator/blob/a995b21d18c63cd1f5d123d0d2cd31a1c2d828dc/src/File/Upload.php#L187 https://github.com/laminas/laminas-validator/blob/a995b21d18c63cd1f5d123d0d2cd31a1c2d828dc/src/File/Upload.php#L193 https://github.com/laminas/laminas-validator/blob/a995b21d18c63cd1f5d123d0d2cd31a1c2d828dc/src/File/Upload.php#L262

icetee avatar Oct 31 '22 20:10 icetee

Yeah, for me, PSR-7 needs to become a hard dependency here...

Ocramius avatar Oct 31 '22 23:10 Ocramius

I'd let @gsteel call the shots here: meanwhile moving to 2.28.x.

Ocramius avatar Nov 12 '22 21:11 Ocramius

Thanks @icetee 👍

gsteel avatar Nov 14 '22 08:11 gsteel