From 1e53f7289bcf0fda8d62abd499fc3d247f81b015 Mon Sep 17 00:00:00 2001 From: Raul E Watson Date: Sat, 3 Aug 2019 15:35:11 +0100 Subject: [PATCH 1/6] #102 Add alternative for php pathinfo function is discouraged --- Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php index 75a87654..36469274 100644 --- a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php +++ b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php @@ -96,7 +96,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, From ceb63ee5c03fc0fac1590088e692c125aa0bb855 Mon Sep 17 00:00:00 2001 From: Raul E Watson Date: Sun, 4 Aug 2019 00:54:52 +0100 Subject: [PATCH 2/6] #102 Add alternatives for php function is discouraged --- .../Functions/DiscouragedFunctionSniff.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php index 36469274..5a8fc0f0 100644 --- a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php +++ b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php @@ -53,14 +53,14 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^dcngettext$' => null, '^dgettext$' => null, '^dio_.*$' => null, - '^dirname$' => null, + '^dirname$' => 'Magento\Framework\Filesystem\Io\File->dirname()', '^dngettext$' => null, '^domxml_.*$' => null, '^fbsql_.*$' => null, '^fdf_add_doc_javascript$' => null, '^fdf_open$' => null, - '^fopen$' => null, - '^fclose$' => null, + '^fopen$' => '\Magento\Framework\Filesystem\Driver\File->fileOpen()', + '^fclose$' => '\Magento\Framework\Filesystem\Driver\File->fileClose()', '^fsockopen$' => null, '^ftp_.*$' => null, '^fwrite$' => null, @@ -194,24 +194,24 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^gettype$' => null, '^var_dump$' => null, '^tempnam$' => null, - '^realpath$' => null, + '^realpath$' => '\Magento\Framework\Filesystem\Driver\File->getRealPath()', '^linkinfo$' => null, '^lstat$' => null, '^stat$' => null, '^lchgrp$' => null, '^lchown$' => null, '^show_source$' => null, - '^is_dir$' => null, + '^is_dir$' => '\Magento\Framework\Filesystem\Driver\File->isDirectory()', '^is_executable$' => null, - '^is_file$' => null, + '^is_file$' => '\Magento\Framework\Filesystem\Driver\File->isFile()', '^is_link$' => null, - '^is_readable$' => null, - '^is_writable$' => null, - '^is_writeable$' => null, + '^is_readable$' => '\Magento\Framework\Filesystem\Driver\File->isReadable()', + '^is_writable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable()', + '^is_writeable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable()', '^is_uploaded_file$' => null, '^glob$' => null, '^ssh2_.*$' => null, - '^delete$' => null, + '^delete$' => '\Magento\Framework\Filesystem\Driver\File->deleteFile()', '^file.*$' => null, '^chop$' => 'rtrim()', '^sizeof$' => 'count()', From eaae9fd1d9fbc9b3a63afa3dea1f42f3720da3f0 Mon Sep 17 00:00:00 2001 From: Raul E Watson Date: Tue, 6 Aug 2019 13:56:56 +0100 Subject: [PATCH 3/6] #102 Add more alternatives for php function is discouraged --- .../Functions/DiscouragedFunctionSniff.php | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php index 5a8fc0f0..f1a304f8 100644 --- a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php +++ b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php @@ -39,11 +39,11 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^call_user_func_array$' => null, '^chdir$' => null, '^chgrp$' => null, - '^chmod$' => null, + '^chmod$' => 'Magento\Framework\Filesystem\Io\File->chmod', '^chown$' => null, '^chroot$' => null, '^com_load_typelib$' => null, - '^copy$' => null, + '^copy$' => '\Magento\Framework\Filesystem\Driver\File->copy', '^curl_.*$' => null, '^cyrus_connect$' => null, '^dba_.*$' => null, @@ -53,17 +53,17 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^dcngettext$' => null, '^dgettext$' => null, '^dio_.*$' => null, - '^dirname$' => 'Magento\Framework\Filesystem\Io\File->dirname()', + '^dirname$' => 'Magento\Framework\Filesystem\Io\File->dirname', '^dngettext$' => null, '^domxml_.*$' => null, '^fbsql_.*$' => null, '^fdf_add_doc_javascript$' => null, '^fdf_open$' => null, - '^fopen$' => '\Magento\Framework\Filesystem\Driver\File->fileOpen()', - '^fclose$' => '\Magento\Framework\Filesystem\Driver\File->fileClose()', + '^fopen$' => '\Magento\Framework\Filesystem\Driver\File->fileOpen', + '^fclose$' => '\Magento\Framework\Filesystem\Driver\File->fileClose', '^fsockopen$' => null, '^ftp_.*$' => null, - '^fwrite$' => null, + '^fwrite$' => '\Magento\Framework\Filesystem\Driver\File->fileWrite', '^gettext$' => null, '^gz.*$' => null, '^header$' => null, @@ -79,7 +79,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^link$' => null, '^mail$' => null, '^mb_send_mail$' => null, - '^mkdir$' => null, + '^mkdir$' => 'Magento\Framework\Filesystem\Io\File->mkdir', '^move_uploaded_file$' => null, '^msession_.*$' => null, '^msg_send$' => null, @@ -96,7 +96,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^parse_str$' => null, '^parse_url$' => null, '^parsekit_compile_string$' => null, - '^pathinfo$' => 'Magento\Framework\Filesystem\Io\File->getPathInfo()', + '^pathinfo$' => 'Magento\Framework\Filesystem\Io\File->getPathInfo', '^pcntl_.*$' => null, '^posix_.*$' => null, '^pfpro_.*$' => null, @@ -106,14 +106,14 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^print_r$' => null, '^printf$' => null, '^putenv$' => null, - '^readfile$' => null, + '^readfile$' => '\Magento\Framework\Filesystem\Driver\File->fileRead', '^readgzfile$' => null, - '^readline$' => null, + '^readline$' => '\Magento\Framework\Filesystem\Driver\File->fileReadLine', '^readlink$' => null, '^register_shutdown_function$' => null, '^register_tick_function$' => null, - '^rename$' => null, - '^rmdir$' => null, + '^rename$' => '\Magento\Framework\Filesystem\Driver\File->raname', + '^rmdir$' => 'Magento\Framework\Filesystem\Io\File->rmdir', '^scandir$' => null, '^session_.*$' => null, '^set_include_path$' => null, @@ -126,9 +126,9 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^socket_.*$' => null, '^stream_.*$' => null, '^sybase_.*$' => null, - '^symlink$' => null, + '^symlink$' => '\Magento\Framework\Filesystem\Driver\File->symlink', '^syslog$' => null, - '^touch$' => null, + '^touch$' => '\Magento\Framework\Filesystem\Driver\File->touch', '^trigger_error$' => null, '^unlink$' => null, '^vprintf$' => null, @@ -149,7 +149,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^fdf_.*$' => null, '^fget.*$' => null, '^fread$' => null, - '^fflush$' => null, + '^fflush$' => '\Magento\Framework\Filesystem\Driver\File->fileFlush', '^get_browser$' => null, '^get_headers$' => null, '^get_meta_tags$' => null, @@ -194,24 +194,24 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^gettype$' => null, '^var_dump$' => null, '^tempnam$' => null, - '^realpath$' => '\Magento\Framework\Filesystem\Driver\File->getRealPath()', + '^realpath$' => '\Magento\Framework\Filesystem\Driver\File->getRealPath', '^linkinfo$' => null, - '^lstat$' => null, + '^lstat$' => '\Magento\Framework\Filesystem\Driver\File->stat', '^stat$' => null, '^lchgrp$' => null, '^lchown$' => null, '^show_source$' => null, - '^is_dir$' => '\Magento\Framework\Filesystem\Driver\File->isDirectory()', + '^is_dir$' => '\Magento\Framework\Filesystem\Driver\File->isDirectory', '^is_executable$' => null, - '^is_file$' => '\Magento\Framework\Filesystem\Driver\File->isFile()', + '^is_file$' => '\Magento\Framework\Filesystem\Driver\File->isFile', '^is_link$' => null, - '^is_readable$' => '\Magento\Framework\Filesystem\Driver\File->isReadable()', - '^is_writable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable()', - '^is_writeable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable()', + '^is_readable$' => '\Magento\Framework\Filesystem\Driver\File->isReadable', + '^is_writable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable', + '^is_writeable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable', '^is_uploaded_file$' => null, - '^glob$' => null, + '^glob$' => '\Magento\Framework\Filesystem\Glob::glob', '^ssh2_.*$' => null, - '^delete$' => '\Magento\Framework\Filesystem\Driver\File->deleteFile()', + '^delete$' => '\Magento\Framework\Filesystem\Driver\File->deleteFile', '^file.*$' => null, '^chop$' => 'rtrim()', '^sizeof$' => 'count()', From b842a8b1c48b85ebfc1cd8073439b9617e1826ca Mon Sep 17 00:00:00 2001 From: Raul E Watson Date: Fri, 9 Aug 2019 11:07:39 +0100 Subject: [PATCH 4/6] #102 avoid using Io --- .../Functions/DiscouragedFunctionSniff.php | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php index f1a304f8..f6fb547c 100644 --- a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php +++ b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php @@ -39,11 +39,11 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^call_user_func_array$' => null, '^chdir$' => null, '^chgrp$' => null, - '^chmod$' => 'Magento\Framework\Filesystem\Io\File->chmod', + '^chmod$' => '\Magento\Framework\Filesystem\DriverInterface::changePermissions() or \Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()', '^chown$' => null, '^chroot$' => null, '^com_load_typelib$' => null, - '^copy$' => '\Magento\Framework\Filesystem\Driver\File->copy', + '^copy$' => '\Magento\Framework\Filesystem\Driver\File::copy()', '^curl_.*$' => null, '^cyrus_connect$' => null, '^dba_.*$' => null, @@ -53,17 +53,17 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^dcngettext$' => null, '^dgettext$' => null, '^dio_.*$' => null, - '^dirname$' => 'Magento\Framework\Filesystem\Io\File->dirname', + '^dirname$' => '\Magento\Framework\Filesystem\DriverInterface::getParentDirectory()', '^dngettext$' => null, '^domxml_.*$' => null, '^fbsql_.*$' => null, '^fdf_add_doc_javascript$' => null, '^fdf_open$' => null, - '^fopen$' => '\Magento\Framework\Filesystem\Driver\File->fileOpen', - '^fclose$' => '\Magento\Framework\Filesystem\Driver\File->fileClose', + '^fopen$' => '\Magento\Framework\Filesystem\Driver\File::fileOpen()', + '^fclose$' => '\Magento\Framework\Filesystem\Driver\File::fileClose()', '^fsockopen$' => null, '^ftp_.*$' => null, - '^fwrite$' => '\Magento\Framework\Filesystem\Driver\File->fileWrite', + '^fwrite$' => '\Magento\Framework\Filesystem\Driver\File::fileWrite()', '^gettext$' => null, '^gz.*$' => null, '^header$' => null, @@ -79,7 +79,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^link$' => null, '^mail$' => null, '^mb_send_mail$' => null, - '^mkdir$' => 'Magento\Framework\Filesystem\Io\File->mkdir', + '^mkdir$' => '\Magento\Framework\Filesystem\DriverInterface::createDirectory()', '^move_uploaded_file$' => null, '^msession_.*$' => null, '^msg_send$' => null, @@ -96,7 +96,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^parse_str$' => null, '^parse_url$' => null, '^parsekit_compile_string$' => null, - '^pathinfo$' => 'Magento\Framework\Filesystem\Io\File->getPathInfo', + '^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo->()', '^pcntl_.*$' => null, '^posix_.*$' => null, '^pfpro_.*$' => null, @@ -106,14 +106,14 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^print_r$' => null, '^printf$' => null, '^putenv$' => null, - '^readfile$' => '\Magento\Framework\Filesystem\Driver\File->fileRead', + '^readfile$' => '\Magento\Framework\Filesystem\Driver\File::fileRead()', '^readgzfile$' => null, - '^readline$' => '\Magento\Framework\Filesystem\Driver\File->fileReadLine', + '^readline$' => '\Magento\Framework\Filesystem\Driver\File::fileReadLine()', '^readlink$' => null, '^register_shutdown_function$' => null, '^register_tick_function$' => null, - '^rename$' => '\Magento\Framework\Filesystem\Driver\File->raname', - '^rmdir$' => 'Magento\Framework\Filesystem\Io\File->rmdir', + '^rename$' => '\Magento\Framework\Filesystem\Driver\File::raname()', + '^rmdir$' => '\Magento\Framework\Filesystem\DriverInterface::deleteDirectory()', '^scandir$' => null, '^session_.*$' => null, '^set_include_path$' => null, @@ -126,9 +126,9 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^socket_.*$' => null, '^stream_.*$' => null, '^sybase_.*$' => null, - '^symlink$' => '\Magento\Framework\Filesystem\Driver\File->symlink', + '^symlink$' => '\Magento\Framework\Filesystem\Driver\File::symlink()', '^syslog$' => null, - '^touch$' => '\Magento\Framework\Filesystem\Driver\File->touch', + '^touch$' => '\Magento\Framework\Filesystem\Driver\File::touch()', '^trigger_error$' => null, '^unlink$' => null, '^vprintf$' => null, @@ -149,7 +149,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^fdf_.*$' => null, '^fget.*$' => null, '^fread$' => null, - '^fflush$' => '\Magento\Framework\Filesystem\Driver\File->fileFlush', + '^fflush$' => '\Magento\Framework\Filesystem\Driver\File::fileFlush()', '^get_browser$' => null, '^get_headers$' => null, '^get_meta_tags$' => null, @@ -194,24 +194,24 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^gettype$' => null, '^var_dump$' => null, '^tempnam$' => null, - '^realpath$' => '\Magento\Framework\Filesystem\Driver\File->getRealPath', + '^realpath$' => '\Magento\Framework\Filesystem\Driver\File::getRealPath()', '^linkinfo$' => null, - '^lstat$' => '\Magento\Framework\Filesystem\Driver\File->stat', + '^lstat$' => '\Magento\Framework\Filesystem\Driver\File::stat()', '^stat$' => null, '^lchgrp$' => null, '^lchown$' => null, '^show_source$' => null, - '^is_dir$' => '\Magento\Framework\Filesystem\Driver\File->isDirectory', + '^is_dir$' => '\Magento\Framework\Filesystem\Driver\File::isDirectory()', '^is_executable$' => null, - '^is_file$' => '\Magento\Framework\Filesystem\Driver\File->isFile', + '^is_file$' => '\Magento\Framework\Filesystem\Driver\File::isFile()', '^is_link$' => null, - '^is_readable$' => '\Magento\Framework\Filesystem\Driver\File->isReadable', - '^is_writable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable', - '^is_writeable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable', + '^is_readable$' => '\Magento\Framework\Filesystem\Driver\File::isReadable()', + '^is_writable$' => '\Magento\Framework\Filesystem\DriverInterface::isWritable()', + '^is_writeable$' => '\Magento\Framework\Filesystem\DriverInterface::isWritable()', '^is_uploaded_file$' => null, - '^glob$' => '\Magento\Framework\Filesystem\Glob::glob', + '^glob$' => '\Magento\Framework\Filesystem\Glob::glob()', '^ssh2_.*$' => null, - '^delete$' => '\Magento\Framework\Filesystem\Driver\File->deleteFile', + '^delete$' => '\Magento\Framework\Filesystem\Driver\File::deleteFile()', '^file.*$' => null, '^chop$' => 'rtrim()', '^sizeof$' => 'count()', From 27d90c372c7f66956b39ef170dfb75a1e7fe96b1 Mon Sep 17 00:00:00 2001 From: Raul E Watson Date: Fri, 9 Aug 2019 15:50:45 +0100 Subject: [PATCH 5/6] #102 Line exceeds maximum limit of 120 characters --- Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php index f6fb547c..ba5086ff 100644 --- a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php +++ b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php @@ -39,7 +39,8 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^call_user_func_array$' => null, '^chdir$' => null, '^chgrp$' => null, - '^chmod$' => '\Magento\Framework\Filesystem\DriverInterface::changePermissions() or \Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()', + '^chmod$' => '\Magento\Framework\Filesystem\DriverInterface::changePermissions() + or \Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()', '^chown$' => null, '^chroot$' => null, '^com_load_typelib$' => null, From fd8b63f98eecc8fbe3db9f2afd29c5710b357ef6 Mon Sep 17 00:00:00 2001 From: Raul E Watson Date: Sat, 10 Aug 2019 02:24:23 +0100 Subject: [PATCH 6/6] #102 use interface recommendation instead of specific class --- .../Functions/DiscouragedFunctionSniff.php | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php index ba5086ff..c3b9c037 100644 --- a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php +++ b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php @@ -39,12 +39,12 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^call_user_func_array$' => null, '^chdir$' => null, '^chgrp$' => null, - '^chmod$' => '\Magento\Framework\Filesystem\DriverInterface::changePermissions() - or \Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()', + '^chmod$' => 'Magento\Framework\Filesystem\DriverInterface::changePermissions() + or Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()', '^chown$' => null, '^chroot$' => null, '^com_load_typelib$' => null, - '^copy$' => '\Magento\Framework\Filesystem\Driver\File::copy()', + '^copy$' => 'Magento\Framework\Filesystem\DriverInterface::copy()', '^curl_.*$' => null, '^cyrus_connect$' => null, '^dba_.*$' => null, @@ -54,17 +54,17 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^dcngettext$' => null, '^dgettext$' => null, '^dio_.*$' => null, - '^dirname$' => '\Magento\Framework\Filesystem\DriverInterface::getParentDirectory()', + '^dirname$' => 'Magento\Framework\Filesystem\DriverInterface::getParentDirectory()', '^dngettext$' => null, '^domxml_.*$' => null, '^fbsql_.*$' => null, '^fdf_add_doc_javascript$' => null, '^fdf_open$' => null, - '^fopen$' => '\Magento\Framework\Filesystem\Driver\File::fileOpen()', - '^fclose$' => '\Magento\Framework\Filesystem\Driver\File::fileClose()', + '^fopen$' => 'Magento\Framework\Filesystem\DriverInterface::fileOpen()', + '^fclose$' => 'Magento\Framework\Filesystem\DriverInterface::fileClose()', '^fsockopen$' => null, '^ftp_.*$' => null, - '^fwrite$' => '\Magento\Framework\Filesystem\Driver\File::fileWrite()', + '^fwrite$' => 'Magento\Framework\Filesystem\DriverInterface::fileWrite()', '^gettext$' => null, '^gz.*$' => null, '^header$' => null, @@ -80,7 +80,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^link$' => null, '^mail$' => null, '^mb_send_mail$' => null, - '^mkdir$' => '\Magento\Framework\Filesystem\DriverInterface::createDirectory()', + '^mkdir$' => 'Magento\Framework\Filesystem\DriverInterface::createDirectory()', '^move_uploaded_file$' => null, '^msession_.*$' => null, '^msg_send$' => null, @@ -97,7 +97,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^parse_str$' => null, '^parse_url$' => null, '^parsekit_compile_string$' => null, - '^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo->()', + '^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo()', '^pcntl_.*$' => null, '^posix_.*$' => null, '^pfpro_.*$' => null, @@ -107,14 +107,14 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^print_r$' => null, '^printf$' => null, '^putenv$' => null, - '^readfile$' => '\Magento\Framework\Filesystem\Driver\File::fileRead()', + '^readfile$' => 'Magento\Framework\Filesystem\DriverInterface::fileRead()', '^readgzfile$' => null, - '^readline$' => '\Magento\Framework\Filesystem\Driver\File::fileReadLine()', + '^readline$' => 'Magento\Framework\Filesystem\DriverInterface::fileReadLine()', '^readlink$' => null, '^register_shutdown_function$' => null, '^register_tick_function$' => null, - '^rename$' => '\Magento\Framework\Filesystem\Driver\File::raname()', - '^rmdir$' => '\Magento\Framework\Filesystem\DriverInterface::deleteDirectory()', + '^rename$' => 'Magento\Framework\Filesystem\DriverInterface::raname()', + '^rmdir$' => 'Magento\Framework\Filesystem\DriverInterface::deleteDirectory()', '^scandir$' => null, '^session_.*$' => null, '^set_include_path$' => null, @@ -127,9 +127,9 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^socket_.*$' => null, '^stream_.*$' => null, '^sybase_.*$' => null, - '^symlink$' => '\Magento\Framework\Filesystem\Driver\File::symlink()', + '^symlink$' => 'Magento\Framework\Filesystem\DriverInterface::symlink()', '^syslog$' => null, - '^touch$' => '\Magento\Framework\Filesystem\Driver\File::touch()', + '^touch$' => 'Magento\Framework\Filesystem\DriverInterface::touch()', '^trigger_error$' => null, '^unlink$' => null, '^vprintf$' => null, @@ -150,7 +150,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^fdf_.*$' => null, '^fget.*$' => null, '^fread$' => null, - '^fflush$' => '\Magento\Framework\Filesystem\Driver\File::fileFlush()', + '^fflush$' => 'Magento\Framework\Filesystem\DriverInterface::fileFlush()', '^get_browser$' => null, '^get_headers$' => null, '^get_meta_tags$' => null, @@ -195,24 +195,24 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^gettype$' => null, '^var_dump$' => null, '^tempnam$' => null, - '^realpath$' => '\Magento\Framework\Filesystem\Driver\File::getRealPath()', + '^realpath$' => 'Magento\Framework\Filesystem\DriverInterface::getRealPath()', '^linkinfo$' => null, - '^lstat$' => '\Magento\Framework\Filesystem\Driver\File::stat()', + '^lstat$' => 'Magento\Framework\Filesystem\DriverInterface::stat()', '^stat$' => null, '^lchgrp$' => null, '^lchown$' => null, '^show_source$' => null, - '^is_dir$' => '\Magento\Framework\Filesystem\Driver\File::isDirectory()', + '^is_dir$' => 'Magento\Framework\Filesystem\DriverInterface::isDirectory()', '^is_executable$' => null, - '^is_file$' => '\Magento\Framework\Filesystem\Driver\File::isFile()', + '^is_file$' => 'Magento\Framework\Filesystem\DriverInterface::isFile()', '^is_link$' => null, - '^is_readable$' => '\Magento\Framework\Filesystem\Driver\File::isReadable()', - '^is_writable$' => '\Magento\Framework\Filesystem\DriverInterface::isWritable()', - '^is_writeable$' => '\Magento\Framework\Filesystem\DriverInterface::isWritable()', + '^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$' => '\Magento\Framework\Filesystem\Glob::glob()', + '^glob$' => 'Magento\Framework\Filesystem\Glob::glob()', '^ssh2_.*$' => null, - '^delete$' => '\Magento\Framework\Filesystem\Driver\File::deleteFile()', + '^delete$' => 'Magento\Framework\Filesystem\DriverInterface::deleteFile()', '^file.*$' => null, '^chop$' => 'rtrim()', '^sizeof$' => 'count()',