3

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.

0

As 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;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.