Skip to content
49 changes: 25 additions & 24 deletions Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^call_user_func_array$' => null,
'^chdir$' => null,
'^chgrp$' => null,
'^chmod$' => null,
'^chmod$' => 'Magento\Framework\Filesystem\DriverInterface::changePermissions()
or Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()',
'^chown$' => null,
'^chroot$' => null,
'^com_load_typelib$' => null,
'^copy$' => null,
'^copy$' => 'Magento\Framework\Filesystem\DriverInterface::copy()',
'^curl_.*$' => null,
'^cyrus_connect$' => null,
'^dba_.*$' => null,
Expand All @@ -53,17 +54,17 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^dcngettext$' => null,
'^dgettext$' => null,
'^dio_.*$' => null,
'^dirname$' => null,
'^dirname$' => 'Magento\Framework\Filesystem\DriverInterface::getParentDirectory()',
'^dngettext$' => null,
'^domxml_.*$' => null,
'^fbsql_.*$' => null,
'^fdf_add_doc_javascript$' => null,
'^fdf_open$' => null,
'^fopen$' => null,
'^fclose$' => null,
'^fopen$' => 'Magento\Framework\Filesystem\DriverInterface::fileOpen()',
'^fclose$' => 'Magento\Framework\Filesystem\DriverInterface::fileClose()',
'^fsockopen$' => null,
'^ftp_.*$' => null,
'^fwrite$' => null,
'^fwrite$' => 'Magento\Framework\Filesystem\DriverInterface::fileWrite()',
'^gettext$' => null,
'^gz.*$' => null,
'^header$' => null,
Expand All @@ -79,7 +80,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^link$' => null,
'^mail$' => null,
'^mb_send_mail$' => null,
'^mkdir$' => null,
'^mkdir$' => 'Magento\Framework\Filesystem\DriverInterface::createDirectory()',
'^move_uploaded_file$' => null,
'^msession_.*$' => null,
'^msg_send$' => null,
Expand All @@ -96,7 +97,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^parse_str$' => null,
'^parse_url$' => null,
'^parsekit_compile_string$' => null,
'^pathinfo$' => null,
'^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo()',
'^pcntl_.*$' => null,
'^posix_.*$' => null,
'^pfpro_.*$' => null,
Expand All @@ -106,14 +107,14 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^print_r$' => null,
'^printf$' => null,
'^putenv$' => null,
'^readfile$' => null,
'^readfile$' => 'Magento\Framework\Filesystem\DriverInterface::fileRead()',
'^readgzfile$' => null,
'^readline$' => null,
'^readline$' => 'Magento\Framework\Filesystem\DriverInterface::fileReadLine()',
'^readlink$' => null,
'^register_shutdown_function$' => null,
'^register_tick_function$' => null,
'^rename$' => null,
'^rmdir$' => null,
'^rename$' => 'Magento\Framework\Filesystem\DriverInterface::raname()',
'^rmdir$' => 'Magento\Framework\Filesystem\DriverInterface::deleteDirectory()',
'^scandir$' => null,
'^session_.*$' => null,
'^set_include_path$' => null,
Expand All @@ -126,9 +127,9 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^socket_.*$' => null,
'^stream_.*$' => null,
'^sybase_.*$' => null,
'^symlink$' => null,
'^symlink$' => 'Magento\Framework\Filesystem\DriverInterface::symlink()',
'^syslog$' => null,
'^touch$' => null,
'^touch$' => 'Magento\Framework\Filesystem\DriverInterface::touch()',
'^trigger_error$' => null,
'^unlink$' => null,
'^vprintf$' => null,
Expand All @@ -149,7 +150,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^fdf_.*$' => null,
'^fget.*$' => null,
'^fread$' => null,
'^fflush$' => null,
'^fflush$' => 'Magento\Framework\Filesystem\DriverInterface::fileFlush()',
'^get_browser$' => null,
'^get_headers$' => null,
'^get_meta_tags$' => null,
Expand Down Expand Up @@ -194,24 +195,24 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^gettype$' => null,
'^var_dump$' => null,
'^tempnam$' => null,
'^realpath$' => null,
'^realpath$' => 'Magento\Framework\Filesystem\DriverInterface::getRealPath()',
'^linkinfo$' => null,
'^lstat$' => null,
'^lstat$' => 'Magento\Framework\Filesystem\DriverInterface::stat()',
'^stat$' => null,
'^lchgrp$' => null,
'^lchown$' => null,
'^show_source$' => null,
'^is_dir$' => null,
'^is_dir$' => 'Magento\Framework\Filesystem\DriverInterface::isDirectory()',
'^is_executable$' => null,
'^is_file$' => null,
'^is_file$' => 'Magento\Framework\Filesystem\DriverInterface::isFile()',
'^is_link$' => null,
'^is_readable$' => null,
'^is_writable$' => null,
'^is_writeable$' => null,
'^is_readable$' => 'Magento\Framework\Filesystem\DriverInterface::isReadable()',
'^is_writable$' => 'Magento\Framework\Filesystem\DriverInterface::isWritable()',
'^is_writeable$' => 'Magento\Framework\Filesystem\DriverInterface::isWritable()',
'^is_uploaded_file$' => null,
'^glob$' => null,
'^glob$' => 'Magento\Framework\Filesystem\Glob::glob()',
'^ssh2_.*$' => null,
'^delete$' => null,
'^delete$' => 'Magento\Framework\Filesystem\DriverInterface::deleteFile()',
'^file.*$' => null,
'^chop$' => 'rtrim()',
'^sizeof$' => 'count()',
Expand Down