Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#102 Add alternative for php pathinfo function is discouraged #123

Merged
merged 8 commits into from
Aug 12, 2019
48 changes: 24 additions & 24 deletions Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ 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()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix Line exceeds maximum limit of 120 characters; contains 171 characters here.

'^chown$' => null,
'^chroot$' => null,
'^com_load_typelib$' => null,
'^copy$' => null,
'^copy$' => '\Magento\Framework\Filesystem\Driver\File::copy()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^curl_.*$' => null,
'^cyrus_connect$' => null,
'^dba_.*$' => null,
Expand All @@ -53,17 +53,17 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^dcngettext$' => null,
'^dgettext$' => null,
'^dio_.*$' => null,
'^dirname$' => null,
'^dirname$' => '\Magento\Framework\Filesystem\DriverInterface::getParentDirectory()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^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()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^fclose$' => '\Magento\Framework\Filesystem\Driver\File::fileClose()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^fsockopen$' => null,
'^ftp_.*$' => null,
'^fwrite$' => null,
'^fwrite$' => '\Magento\Framework\Filesystem\Driver\File::fileWrite()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^gettext$' => null,
'^gz.*$' => null,
'^header$' => null,
Expand All @@ -79,7 +79,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^link$' => null,
'^mail$' => null,
'^mb_send_mail$' => null,
'^mkdir$' => null,
'^mkdir$' => '\Magento\Framework\Filesystem\DriverInterface::createDirectory()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^mkdir$' => '\Magento\Framework\Filesystem\DriverInterface::createDirectory()',
'^mkdir$' => 'Magento\Framework\Filesystem\DriverInterface::createDirectory()',

'^move_uploaded_file$' => null,
'^msession_.*$' => null,
'^msg_send$' => null,
Expand All @@ -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->()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo->()',
'^pathinfo$' => null,

'^pcntl_.*$' => null,
'^posix_.*$' => null,
'^pfpro_.*$' => null,
Expand All @@ -106,14 +106,14 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^print_r$' => null,
'^printf$' => null,
'^putenv$' => null,
'^readfile$' => null,
'^readfile$' => '\Magento\Framework\Filesystem\Driver\File::fileRead()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^readfile$' => '\Magento\Framework\Filesystem\Driver\File::fileRead()',
'^readfile$' => 'Magento\Framework\Filesystem\DriverInterface::fileRead()',

'^readgzfile$' => null,
'^readline$' => null,
'^readline$' => '\Magento\Framework\Filesystem\Driver\File::fileReadLine()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^readline$' => '\Magento\Framework\Filesystem\Driver\File::fileReadLine()',
'^readline$' => 'Magento\Framework\Filesystem\DriverInterface::fileReadLine()',

'^readlink$' => null,
'^register_shutdown_function$' => null,
'^register_tick_function$' => null,
'^rename$' => null,
'^rmdir$' => null,
'^rename$' => '\Magento\Framework\Filesystem\Driver\File::raname()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^rename$' => '\Magento\Framework\Filesystem\Driver\File::raname()',
'^rename$' => 'Magento\Framework\Filesystem\DriverInterface::raname()',

'^rmdir$' => '\Magento\Framework\Filesystem\DriverInterface::deleteDirectory()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^rmdir$' => '\Magento\Framework\Filesystem\DriverInterface::deleteDirectory()',
'^rmdir$' => 'Magento\Framework\Filesystem\DriverInterface::deleteDirectory()',

'^scandir$' => null,
'^session_.*$' => null,
'^set_include_path$' => null,
Expand All @@ -126,9 +126,9 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^socket_.*$' => null,
'^stream_.*$' => null,
'^sybase_.*$' => null,
'^symlink$' => null,
'^symlink$' => '\Magento\Framework\Filesystem\Driver\File::symlink()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^symlink$' => '\Magento\Framework\Filesystem\Driver\File::symlink()',
'^symlink$' => 'Magento\Framework\Filesystem\DriverInterface::symlink()',

'^syslog$' => null,
'^touch$' => null,
'^touch$' => '\Magento\Framework\Filesystem\Driver\File::touch()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^touch$' => '\Magento\Framework\Filesystem\Driver\File::touch()',
'^touch$' => 'Magento\Framework\Filesystem\DriverInterface::touch()',

'^trigger_error$' => null,
'^unlink$' => null,
'^vprintf$' => null,
Expand All @@ -149,7 +149,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^fdf_.*$' => null,
'^fget.*$' => null,
'^fread$' => null,
'^fflush$' => null,
'^fflush$' => '\Magento\Framework\Filesystem\Driver\File::fileFlush()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^fflush$' => '\Magento\Framework\Filesystem\Driver\File::fileFlush()',
'^fflush$' => 'Magento\Framework\Filesystem\DriverInterface::fileFlush()',

'^get_browser$' => null,
'^get_headers$' => null,
'^get_meta_tags$' => null,
Expand Down Expand Up @@ -194,24 +194,24 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
'^gettype$' => null,
'^var_dump$' => null,
'^tempnam$' => null,
'^realpath$' => null,
'^realpath$' => '\Magento\Framework\Filesystem\Driver\File::getRealPath()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^realpath$' => '\Magento\Framework\Filesystem\Driver\File::getRealPath()',
'^realpath$' => 'Magento\Framework\Filesystem\DriverInterface::getRealPath()',

'^linkinfo$' => null,
'^lstat$' => null,
'^lstat$' => '\Magento\Framework\Filesystem\Driver\File::stat()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^lstat$' => '\Magento\Framework\Filesystem\Driver\File::stat()',
'^lstat$' => 'Magento\Framework\Filesystem\DriverInterface::stat()',

'^stat$' => null,
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^lchgrp$' => null,
'^lchown$' => null,
'^show_source$' => null,
'^is_dir$' => null,
'^is_dir$' => '\Magento\Framework\Filesystem\Driver\File::isDirectory()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^is_dir$' => '\Magento\Framework\Filesystem\Driver\File::isDirectory()',
'^is_dir$' => 'Magento\Framework\Filesystem\DriverInterface::isDirectory()',

'^is_executable$' => null,
'^is_file$' => null,
'^is_file$' => '\Magento\Framework\Filesystem\Driver\File::isFile()',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'^is_file$' => '\Magento\Framework\Filesystem\Driver\File::isFile()',
'^is_file$' => 'Magento\Framework\Filesystem\DriverInterface::isFile()',

'^is_link$' => null,
'^is_readable$' => null,
'^is_writable$' => null,
'^is_writeable$' => null,
'^is_readable$' => '\Magento\Framework\Filesystem\Driver\File::isReadable()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^is_writable$' => '\Magento\Framework\Filesystem\DriverInterface::isWritable()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^is_writeable$' => '\Magento\Framework\Filesystem\DriverInterface::isWritable()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^is_uploaded_file$' => null,
'^glob$' => null,
'^glob$' => '\Magento\Framework\Filesystem\Glob::glob()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^ssh2_.*$' => null,
'^delete$' => null,
'^delete$' => '\Magento\Framework\Filesystem\Driver\File::deleteFile()',
diazwatson marked this conversation as resolved.
Show resolved Hide resolved
'^file.*$' => null,
'^chop$' => 'rtrim()',
'^sizeof$' => 'count()',
Expand Down