joomla-extensions / jedchecker

Joomla extension to check components, modules or plugins for possible problems for submission to the JED -> Translations: https://joomla.crowdin.com/joomla-official-extensions
38 stars 28 forks source link

Wrong deprecation: Joomla\CMS\Filesystem\File and Joomla\CMS\Filesystem\Folder ? #244

Closed peterhulst closed 6 months ago

peterhulst commented 6 months ago

Hello,

When using JED Checker version 2.4.3 I got the following:

deprecated in Joomla! 5: use Joomla\CMS\Filesystem\File; Instead, use: \Joomla\Filesystem\File

deprecated in Joomla! 5: use Joomla\CMS\Filesystem\Folder; Instead, use: Joomla\Filesystem\Folder

However changing: use Joomla\CMS\Filesystem\Folder; into: use Joomla\Filesystem\Folder; gived both in J4 and J5:

Call to undefined method Joomla\Filesystem\Folder::exists()

I think both depreciation are wrongly indicated.

Regards

dryabov commented 6 months ago

They are deprecated, but not removed (the deprecation message is "will be removed in 6.0"). As far as I understand, it's recommended to use PHP's functions (is_dir, is_file) instead of a primitive wrappers around them.

peterhulst commented 6 months ago

Thank you for the reply.

In J5 you will find a lot of (> 60 matches): use Joomla\CMS\Filesystem\Folder;

But: use Joomla\Filesystem\Folder; can only be found 11 times.

So is J5 not consistent in that check?

dryabov commented 6 months ago

Most likely there are different people working on extensions and the library. As far as I remember, even Joomla 4 triggered a lot of deprecated messages in Alpha and Beta releases (that were only fixed in the RC version).

peterhulst commented 6 months ago

Thank you for the suggestion to use: is_dir and is_file So I could remove the use of File and Folder and get rid of the depreciate messages. Work perfectly Regards