Skip to content

Commit 0986839

Browse files
authored
Merge pull request #181 from magento-commerce/correct-discouraged-message
AC-3187: Incorrect message for discouraged functions
2 parents 71d8814 + afd864c commit 0986839

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php

+38-38
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
4040
'^chdir$' => null,
4141
'^chgrp$' => null,
4242
'^chmod$' => 'Magento\Framework\Filesystem\DriverInterface::changePermissions()
43-
or Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()',
43+
or Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively',
4444
'^chown$' => null,
4545
'^chroot$' => null,
4646
'^com_load_typelib$' => null,
47-
'^copy$' => 'Magento\Framework\Filesystem\DriverInterface::copy()',
47+
'^copy$' => 'Magento\Framework\Filesystem\DriverInterface::copy',
4848
'^curl_.*$' => null,
4949
'^cyrus_connect$' => null,
5050
'^dba_.*$' => null,
@@ -54,21 +54,21 @@ 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
'^fbsql$' => null,
6262
'^fdf_add_doc_javascript$' => null,
6363
'^fdf_open$' => null,
64-
'^fopen$' => 'Magento\Framework\Filesystem\DriverInterface::fileOpen()',
65-
'^fclose$' => 'Magento\Framework\Filesystem\DriverInterface::fileClose()',
66-
'^fsockopen$' => 'Magento\Framework\Filesystem\Driver\Http::open()',
64+
'^fopen$' => 'Magento\Framework\Filesystem\DriverInterface::fileOpen',
65+
'^fclose$' => 'Magento\Framework\Filesystem\DriverInterface::fileClose',
66+
'^fsockopen$' => 'Magento\Framework\Filesystem\Driver\Http::open',
6767
'^ftp_.*$' => null,
68-
'^fwrite$' => 'Magento\Framework\Filesystem\DriverInterface::fileWrite()',
69-
'^fputs$' => 'Magento\Framework\Filesystem\DriverInterface::fileWrite()',
70-
'^gettext$' => 'Magento\Framework\Translate\AdapterInterface::translate()',
71-
'^_$' => 'Magento\Framework\Translate\AdapterInterface::translate()',
68+
'^fwrite$' => 'Magento\Framework\Filesystem\DriverInterface::fileWrite',
69+
'^fputs$' => 'Magento\Framework\Filesystem\DriverInterface::fileWrite',
70+
'^gettext$' => 'Magento\Framework\Translate\AdapterInterface::translate',
71+
'^_$' => 'Magento\Framework\Translate\AdapterInterface::translate',
7272
'^gz.*$' => null,
7373
'^header$' => null,
7474
'^highlight_file$' => null,
@@ -84,7 +84,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
8484
'^link$' => null,
8585
'^mail$' => null,
8686
'^mb_send_mail$' => null,
87-
'^mkdir$' => 'Magento\Framework\Filesystem\DriverInterface::createDirectory()',
87+
'^mkdir$' => 'Magento\Framework\Filesystem\DriverInterface::createDirectory',
8888
'^move_uploaded_file$' => null,
8989
'^msession_.*$' => null,
9090
'^msg_send$' => null,
@@ -102,7 +102,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
102102
'^parse_str$' => null,
103103
'^parse_url$' => null,
104104
'^parsekit_compile_string$' => null,
105-
'^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo()',
105+
'^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo',
106106
'^pcntl_.*$' => null,
107107
'^posix_.*$' => null,
108108
'^pfpro_.*$' => null,
@@ -112,30 +112,30 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
112112
'^print_r$' => null,
113113
'^printf$' => null,
114114
'^putenv$' => null,
115-
'^readfile$' => 'Magento\Framework\Filesystem\DriverInterface::fileRead()',
115+
'^readfile$' => 'Magento\Framework\Filesystem\DriverInterface::fileRead',
116116
'^readgzfile$' => null,
117-
'^readline$' => 'Magento\Framework\Filesystem\DriverInterface::fileReadLine()',
117+
'^readline$' => 'Magento\Framework\Filesystem\DriverInterface::fileReadLine',
118118
'^readlink$' => null,
119119
'^register_shutdown_function$' => null,
120120
'^register_tick_function$' => null,
121-
'^rename$' => 'Magento\Framework\Filesystem\DriverInterface::rename()',
122-
'^rmdir$' => 'Magento\Framework\Filesystem\DriverInterface::deleteDirectory()',
121+
'^rename$' => 'Magento\Framework\Filesystem\DriverInterface::rename',
122+
'^rmdir$' => 'Magento\Framework\Filesystem\DriverInterface::deleteDirectory',
123123
'^scandir$' => null,
124124
'^session_.*$' => null,
125125
'^set_include_path$' => null,
126126
'^ini_set$' => null,
127127
'^ini_alter$' => null,
128128
'^set_time_limit$' => null,
129129
'^setcookie$' => null,
130-
'^setlocale$' => 'Magento\Framework\Translate\AdapterInterface::setlocale()',
130+
'^setlocale$' => 'Magento\Framework\Translate\AdapterInterface::setLocale',
131131
'^setrawcookie$' => null,
132132
'^sleep$' => null,
133133
'^socket_.*$' => null,
134134
'^stream_.*$' => null,
135135
'^sybase_.*$' => null,
136-
'^symlink$' => 'Magento\Framework\Filesystem\DriverInterface::symlink()',
136+
'^symlink$' => 'Magento\Framework\Filesystem\DriverInterface::symlink',
137137
'^syslog$' => null,
138-
'^touch$' => 'Magento\Framework\Filesystem\DriverInterface::touch()',
138+
'^touch$' => 'Magento\Framework\Filesystem\DriverInterface::touch',
139139
'^trigger_error$' => null,
140140
'^unlink$' => null,
141141
'^vprintf$' => null,
@@ -158,7 +158,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
158158
'^fdf_.*$' => null,
159159
'^fget.*$' => null,
160160
'^fread$' => null,
161-
'^fflush$' => 'Magento\Framework\Filesystem\DriverInterface::fileFlush()',
161+
'^fflush$' => 'Magento\Framework\Filesystem\DriverInterface::fileFlush',
162162
'^get_browser$' => null,
163163
'^get_headers$' => null,
164164
'^get_meta_tags$' => null,
@@ -204,23 +204,23 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
204204
'^gettype$' => null,
205205
'^var_dump$' => null,
206206
'^tempnam$' => null,
207-
'^realpath$' => 'Magento\Framework\Filesystem\DriverInterface::getRealPath()',
207+
'^realpath$' => 'Magento\Framework\Filesystem\DriverInterface::getRealPath',
208208
'^linkinfo$' => null,
209-
'^lstat$' => 'Magento\Framework\Filesystem\DriverInterface::stat()',
209+
'^lstat$' => 'Magento\Framework\Filesystem\DriverInterface::stat',
210210
'^stat$' => null,
211211
'^lchgrp$' => null,
212212
'^lchown$' => null,
213-
'^is_dir$' => 'Magento\Framework\Filesystem\DriverInterface::isDirectory()',
213+
'^is_dir$' => 'Magento\Framework\Filesystem\DriverInterface::isDirectory',
214214
'^is_executable$' => null,
215-
'^is_file$' => 'Magento\Framework\Filesystem\DriverInterface::isFile()',
215+
'^is_file$' => 'Magento\Framework\Filesystem\DriverInterface::isFile',
216216
'^is_link$' => null,
217-
'^is_readable$' => 'Magento\Framework\Filesystem\DriverInterface::isReadable()',
218-
'^is_writable$' => 'Magento\Framework\Filesystem\DriverInterface::isWritable()',
219-
'^is_writeable$' => 'Magento\Framework\Filesystem\DriverInterface::isWritable()',
217+
'^is_readable$' => 'Magento\Framework\Filesystem\DriverInterface::isReadable',
218+
'^is_writable$' => 'Magento\Framework\Filesystem\DriverInterface::isWritable',
219+
'^is_writeable$' => 'Magento\Framework\Filesystem\DriverInterface::isWritable',
220220
'^is_uploaded_file$' => null,
221-
'^glob$' => 'Magento\Framework\Filesystem\Glob::glob()',
221+
'^glob$' => 'Magento\Framework\Filesystem\Glob::glob',
222222
'^ssh2_.*$' => null,
223-
'^delete$' => 'Magento\Framework\Filesystem\DriverInterface::deleteFile()',
223+
'^delete$' => 'Magento\Framework\Filesystem\DriverInterface::deleteFile',
224224
'^file.*$' => null,
225225
'^chop$' => 'rtrim()',
226226
'^sizeof$' => 'count()',
@@ -229,15 +229,15 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
229229
'^strval$' => '(string) construction',
230230
'^htmlspecialchars$' => '\Magento\Framework\Escaper->escapeHtml',
231231
'^getimagesize$' => 'getimagesizefromstring',
232-
'^file_exists$' => 'Magento\Framework\Filesystem\DriverInterface::isExists()',
233-
'^file_get_contents$' => 'Magento\Framework\Filesystem\DriverInterface::fileGetContents()',
234-
'^file_put_contents$' => 'Magento\Framework\Filesystem\DriverInterface::filePutContents()',
235-
'^fgetcsv$' => 'Magento\Framework\Filesystem\DriverInterface::fileGetCsv()',
236-
'^fputcsv$' => 'Magento\Framework\Filesystem\DriverInterface::filePutCsv()',
237-
'^ftell$' => 'Magento\Framework\Filesystem\DriverInterface::fileTell()',
238-
'^fseek$' => 'Magento\Framework\Filesystem\DriverInterface::fileSeek()',
239-
'^feof$' => 'Magento\Framework\Filesystem\DriverInterface::endOfFile()',
240-
'^flock$' => 'Magento\Framework\Filesystem\DriverInterface::fileLock()',
232+
'^file_exists$' => 'Magento\Framework\Filesystem\DriverInterface::isExists',
233+
'^file_get_contents$' => 'Magento\Framework\Filesystem\DriverInterface::fileGetContents',
234+
'^file_put_contents$' => 'Magento\Framework\Filesystem\DriverInterface::filePutContents',
235+
'^fgetcsv$' => 'Magento\Framework\Filesystem\DriverInterface::fileGetCsv',
236+
'^fputcsv$' => 'Magento\Framework\Filesystem\DriverInterface::filePutCsv',
237+
'^ftell$' => 'Magento\Framework\Filesystem\DriverInterface::fileTell',
238+
'^fseek$' => 'Magento\Framework\Filesystem\DriverInterface::fileSeek',
239+
'^feof$' => 'Magento\Framework\Filesystem\DriverInterface::endOfFile',
240+
'^flock$' => 'Magento\Framework\Filesystem\DriverInterface::fileLock',
241241
'^date_sunrise$' => 'date_sun_info',
242242
'^date_sunset$' => 'date_sun_info',
243243
'^strptime$' => 'date_parse_from_format',

0 commit comments

Comments
 (0)