Skip to content

Commit ceb63ee

Browse files
committed
#102 Add alternatives for php function is discouraged
1 parent 1e53f72 commit ceb63ee

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
5353
'^dcngettext$' => null,
5454
'^dgettext$' => null,
5555
'^dio_.*$' => null,
56-
'^dirname$' => null,
56+
'^dirname$' => 'Magento\Framework\Filesystem\Io\File->dirname()',
5757
'^dngettext$' => null,
5858
'^domxml_.*$' => null,
5959
'^fbsql_.*$' => null,
6060
'^fdf_add_doc_javascript$' => null,
6161
'^fdf_open$' => null,
62-
'^fopen$' => null,
63-
'^fclose$' => null,
62+
'^fopen$' => '\Magento\Framework\Filesystem\Driver\File->fileOpen()',
63+
'^fclose$' => '\Magento\Framework\Filesystem\Driver\File->fileClose()',
6464
'^fsockopen$' => null,
6565
'^ftp_.*$' => null,
6666
'^fwrite$' => null,
@@ -194,24 +194,24 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
194194
'^gettype$' => null,
195195
'^var_dump$' => null,
196196
'^tempnam$' => null,
197-
'^realpath$' => null,
197+
'^realpath$' => '\Magento\Framework\Filesystem\Driver\File->getRealPath()',
198198
'^linkinfo$' => null,
199199
'^lstat$' => null,
200200
'^stat$' => null,
201201
'^lchgrp$' => null,
202202
'^lchown$' => null,
203203
'^show_source$' => null,
204-
'^is_dir$' => null,
204+
'^is_dir$' => '\Magento\Framework\Filesystem\Driver\File->isDirectory()',
205205
'^is_executable$' => null,
206-
'^is_file$' => null,
206+
'^is_file$' => '\Magento\Framework\Filesystem\Driver\File->isFile()',
207207
'^is_link$' => null,
208-
'^is_readable$' => null,
209-
'^is_writable$' => null,
210-
'^is_writeable$' => null,
208+
'^is_readable$' => '\Magento\Framework\Filesystem\Driver\File->isReadable()',
209+
'^is_writable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable()',
210+
'^is_writeable$' => 'Magento\Framework\Filesystem\Io\File->isWriteable()',
211211
'^is_uploaded_file$' => null,
212212
'^glob$' => null,
213213
'^ssh2_.*$' => null,
214-
'^delete$' => null,
214+
'^delete$' => '\Magento\Framework\Filesystem\Driver\File->deleteFile()',
215215
'^file.*$' => null,
216216
'^chop$' => 'rtrim()',
217217
'^sizeof$' => 'count()',

0 commit comments

Comments
 (0)