Skip to content

Commit fd8b63f

Browse files
committed
#102 use interface recommendation instead of specific class
1 parent 2de3b7c commit fd8b63f

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
3939
'^call_user_func_array$' => null,
4040
'^chdir$' => null,
4141
'^chgrp$' => null,
42-
'^chmod$' => '\Magento\Framework\Filesystem\DriverInterface::changePermissions()
43-
or \Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()',
42+
'^chmod$' => 'Magento\Framework\Filesystem\DriverInterface::changePermissions()
43+
or Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()',
4444
'^chown$' => null,
4545
'^chroot$' => null,
4646
'^com_load_typelib$' => null,
47-
'^copy$' => '\Magento\Framework\Filesystem\Driver\File::copy()',
47+
'^copy$' => 'Magento\Framework\Filesystem\DriverInterface::copy()',
4848
'^curl_.*$' => null,
4949
'^cyrus_connect$' => null,
5050
'^dba_.*$' => null,
@@ -54,17 +54,17 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
5454
'^dcngettext$' => null,
5555
'^dgettext$' => null,
5656
'^dio_.*$' => null,
57-
'^dirname$' => '\Magento\Framework\Filesystem\DriverInterface::getParentDirectory()',
57+
'^dirname$' => 'Magento\Framework\Filesystem\DriverInterface::getParentDirectory()',
5858
'^dngettext$' => null,
5959
'^domxml_.*$' => null,
6060
'^fbsql_.*$' => null,
6161
'^fdf_add_doc_javascript$' => null,
6262
'^fdf_open$' => null,
63-
'^fopen$' => '\Magento\Framework\Filesystem\Driver\File::fileOpen()',
64-
'^fclose$' => '\Magento\Framework\Filesystem\Driver\File::fileClose()',
63+
'^fopen$' => 'Magento\Framework\Filesystem\DriverInterface::fileOpen()',
64+
'^fclose$' => 'Magento\Framework\Filesystem\DriverInterface::fileClose()',
6565
'^fsockopen$' => null,
6666
'^ftp_.*$' => null,
67-
'^fwrite$' => '\Magento\Framework\Filesystem\Driver\File::fileWrite()',
67+
'^fwrite$' => 'Magento\Framework\Filesystem\DriverInterface::fileWrite()',
6868
'^gettext$' => null,
6969
'^gz.*$' => null,
7070
'^header$' => null,
@@ -80,7 +80,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
8080
'^link$' => null,
8181
'^mail$' => null,
8282
'^mb_send_mail$' => null,
83-
'^mkdir$' => '\Magento\Framework\Filesystem\DriverInterface::createDirectory()',
83+
'^mkdir$' => 'Magento\Framework\Filesystem\DriverInterface::createDirectory()',
8484
'^move_uploaded_file$' => null,
8585
'^msession_.*$' => null,
8686
'^msg_send$' => null,
@@ -97,7 +97,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
9797
'^parse_str$' => null,
9898
'^parse_url$' => null,
9999
'^parsekit_compile_string$' => null,
100-
'^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo->()',
100+
'^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo()',
101101
'^pcntl_.*$' => null,
102102
'^posix_.*$' => null,
103103
'^pfpro_.*$' => null,
@@ -107,14 +107,14 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
107107
'^print_r$' => null,
108108
'^printf$' => null,
109109
'^putenv$' => null,
110-
'^readfile$' => '\Magento\Framework\Filesystem\Driver\File::fileRead()',
110+
'^readfile$' => 'Magento\Framework\Filesystem\DriverInterface::fileRead()',
111111
'^readgzfile$' => null,
112-
'^readline$' => '\Magento\Framework\Filesystem\Driver\File::fileReadLine()',
112+
'^readline$' => 'Magento\Framework\Filesystem\DriverInterface::fileReadLine()',
113113
'^readlink$' => null,
114114
'^register_shutdown_function$' => null,
115115
'^register_tick_function$' => null,
116-
'^rename$' => '\Magento\Framework\Filesystem\Driver\File::raname()',
117-
'^rmdir$' => '\Magento\Framework\Filesystem\DriverInterface::deleteDirectory()',
116+
'^rename$' => 'Magento\Framework\Filesystem\DriverInterface::raname()',
117+
'^rmdir$' => 'Magento\Framework\Filesystem\DriverInterface::deleteDirectory()',
118118
'^scandir$' => null,
119119
'^session_.*$' => null,
120120
'^set_include_path$' => null,
@@ -127,9 +127,9 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
127127
'^socket_.*$' => null,
128128
'^stream_.*$' => null,
129129
'^sybase_.*$' => null,
130-
'^symlink$' => '\Magento\Framework\Filesystem\Driver\File::symlink()',
130+
'^symlink$' => 'Magento\Framework\Filesystem\DriverInterface::symlink()',
131131
'^syslog$' => null,
132-
'^touch$' => '\Magento\Framework\Filesystem\Driver\File::touch()',
132+
'^touch$' => 'Magento\Framework\Filesystem\DriverInterface::touch()',
133133
'^trigger_error$' => null,
134134
'^unlink$' => null,
135135
'^vprintf$' => null,
@@ -150,7 +150,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
150150
'^fdf_.*$' => null,
151151
'^fget.*$' => null,
152152
'^fread$' => null,
153-
'^fflush$' => '\Magento\Framework\Filesystem\Driver\File::fileFlush()',
153+
'^fflush$' => 'Magento\Framework\Filesystem\DriverInterface::fileFlush()',
154154
'^get_browser$' => null,
155155
'^get_headers$' => null,
156156
'^get_meta_tags$' => null,
@@ -195,24 +195,24 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
195195
'^gettype$' => null,
196196
'^var_dump$' => null,
197197
'^tempnam$' => null,
198-
'^realpath$' => '\Magento\Framework\Filesystem\Driver\File::getRealPath()',
198+
'^realpath$' => 'Magento\Framework\Filesystem\DriverInterface::getRealPath()',
199199
'^linkinfo$' => null,
200-
'^lstat$' => '\Magento\Framework\Filesystem\Driver\File::stat()',
200+
'^lstat$' => 'Magento\Framework\Filesystem\DriverInterface::stat()',
201201
'^stat$' => null,
202202
'^lchgrp$' => null,
203203
'^lchown$' => null,
204204
'^show_source$' => null,
205-
'^is_dir$' => '\Magento\Framework\Filesystem\Driver\File::isDirectory()',
205+
'^is_dir$' => 'Magento\Framework\Filesystem\DriverInterface::isDirectory()',
206206
'^is_executable$' => null,
207-
'^is_file$' => '\Magento\Framework\Filesystem\Driver\File::isFile()',
207+
'^is_file$' => 'Magento\Framework\Filesystem\DriverInterface::isFile()',
208208
'^is_link$' => null,
209-
'^is_readable$' => '\Magento\Framework\Filesystem\Driver\File::isReadable()',
210-
'^is_writable$' => '\Magento\Framework\Filesystem\DriverInterface::isWritable()',
211-
'^is_writeable$' => '\Magento\Framework\Filesystem\DriverInterface::isWritable()',
209+
'^is_readable$' => 'Magento\Framework\Filesystem\DriverInterface::isReadable()',
210+
'^is_writable$' => 'Magento\Framework\Filesystem\DriverInterface::isWritable()',
211+
'^is_writeable$' => 'Magento\Framework\Filesystem\DriverInterface::isWritable()',
212212
'^is_uploaded_file$' => null,
213-
'^glob$' => '\Magento\Framework\Filesystem\Glob::glob()',
213+
'^glob$' => 'Magento\Framework\Filesystem\Glob::glob()',
214214
'^ssh2_.*$' => null,
215-
'^delete$' => '\Magento\Framework\Filesystem\Driver\File::deleteFile()',
215+
'^delete$' => 'Magento\Framework\Filesystem\DriverInterface::deleteFile()',
216216
'^file.*$' => null,
217217
'^chop$' => 'rtrim()',
218218
'^sizeof$' => 'count()',

0 commit comments

Comments
 (0)