I am checking uploaded file is readable by is_readable
function of php but in coding standard check it's shows
The use of function is_readable() is discouraged
same error show ablow all function.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityAs per Magento 2 coding standard you should use magento function instead of direct php functions
You can use isReadable()
function of class Magento\Framework\Filesystem\Driver\File
Also available other function like use fileGetCsv()
for fgetcsv()
use fileOpen()
for fopen()
You can find more file specific functions from
vendor/magento/framework/Filesystem/Driver/File.php
protected $_fileSystem;
public function __construct(
...
\Magento\Framework\Filesystem\Driver\File $fileSystem,
...
) {
$this->_fileSystem = $fileSystem;
}