Skip to content

Commit

Permalink
Changed file reference for native PHP functions via built-in meta.php (
Browse files Browse the repository at this point in the history
  • Loading branch information
King2500 committed Mar 3, 2020
1 parent 8a1a91a commit 7320b5a
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 14 deletions.
83 changes: 83 additions & 0 deletions resources/php-advanced-meta/.phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,87 @@ function xAdvancedInjectDirectoryReference($functionReference, $argumentIndex, $
registerArgumentsSet('x_advanced_fileref_relative_modes', '', '/', '.');
expectedArguments(\PHPSTORM_META\xAdvancedInjectFileReference(), 2, argumentsSet('x_advanced_fileref_relative_modes'));
expectedArguments(\PHPSTORM_META\xAdvancedInjectDirectoryReference(), 2, argumentsSet('x_advanced_fileref_relative_modes'));

xAdvancedInjectFileReference(\basename(), 0);
xAdvancedInjectFileReference(\chgrp(), 0);
xAdvancedInjectFileReference(\chmod(), 0);
xAdvancedInjectFileReference(\chown(), 0);
xAdvancedInjectFileReference(\clearstatcache(), 1);
xAdvancedInjectFileReference(\copy(), 0);
xAdvancedInjectFileReference(\copy(), 1);
xAdvancedInjectFileReference(\dirname(), 0);
xAdvancedInjectFileReference(\file_exists(), 0);
xAdvancedInjectFileReference(\file_get_contents(), 0);
xAdvancedInjectFileReference(\file_put_contents(), 0);
xAdvancedInjectFileReference(\file(), 0);
xAdvancedInjectFileReference(\fileatime(), 0);
xAdvancedInjectFileReference(\filectime(), 0);
xAdvancedInjectFileReference(\filegroup(), 0);
xAdvancedInjectFileReference(\fileinode(), 0);
xAdvancedInjectFileReference(\filemtime(), 0);
xAdvancedInjectFileReference(\fileowner(), 0);
xAdvancedInjectFileReference(\fileperms(), 0);
xAdvancedInjectFileReference(\filesize(), 0);
xAdvancedInjectFileReference(\filetype(), 0);
xAdvancedInjectFileReference(\fopen(), 0);
xAdvancedInjectFileReference(\is_executable(), 0);
xAdvancedInjectFileReference(\is_file(), 0);
xAdvancedInjectFileReference(\is_link(), 0);
xAdvancedInjectFileReference(\is_readable(), 0);
xAdvancedInjectFileReference(\is_writable(), 0);
xAdvancedInjectFileReference(\is_writeable(), 0);
xAdvancedInjectFileReference(\lchgrp(), 0);
xAdvancedInjectFileReference(\lchown(), 0);
xAdvancedInjectFileReference(\link(), 0);
xAdvancedInjectFileReference(\link(), 1);
xAdvancedInjectFileReference(\linkinfo(), 0);
xAdvancedInjectFileReference(\lstat(), 0);
xAdvancedInjectFileReference(\move_uploaded_file(), 0);
xAdvancedInjectFileReference(\parse_ini_file(), 0);
xAdvancedInjectFileReference(\pathinfo(), 0);
xAdvancedInjectFileReference(\readfile(), 0);
xAdvancedInjectFileReference(\readlink(), 0);
xAdvancedInjectFileReference(\realpath(), 0);
xAdvancedInjectFileReference(\rename(), 0);
xAdvancedInjectFileReference(\rename(), 1);
xAdvancedInjectFileReference(\stat(), 0);
xAdvancedInjectFileReference(\symlink(), 0);
xAdvancedInjectFileReference(\symlink(), 1);
xAdvancedInjectFileReference(\touch(), 0);
xAdvancedInjectFileReference(\unlink(), 0);
xAdvancedInjectFileReference(\SplFileInfo::__construct(), 0);
xAdvancedInjectFileReference(\SplFileObject::__construct(), 0);
xAdvancedInjectFileReference(\ZipArchive::open(), 0);
xAdvancedInjectFileReference(\ZipArchive::addFile(), 0);
xAdvancedInjectFileReference(\DOMDocument::load(), 0);
xAdvancedInjectFileReference(\simplexml_load_file(), 0);
xAdvancedInjectFileReference(\SimpleXMLElement::asXML(), 0);
xAdvancedInjectFileReference(\SimpleXMLElement::saveXML(), 0);
xAdvancedInjectFileReference(\XMLWriter::openUri(), 0);
xAdvancedInjectFileReference(\xmlwriter_open_uri(), 0);
xAdvancedInjectFileReference(\XMLReader::open(), 0);
xAdvancedInjectFileReference(\imagecreatefrombmp(), 0);
xAdvancedInjectFileReference(\imagecreatefromgd(), 0);
xAdvancedInjectFileReference(\imagecreatefromgd2(), 0);
xAdvancedInjectFileReference(\imagecreatefromgd2part(), 0);
xAdvancedInjectFileReference(\imagecreatefromgif(), 0);
xAdvancedInjectFileReference(\imagecreatefromjpeg(), 0);
xAdvancedInjectFileReference(\imagecreatefromwbmp(), 0);
xAdvancedInjectFileReference(\imagecreatefromwebp(), 0);
xAdvancedInjectFileReference(\imagecreatefrompng(), 0);
xAdvancedInjectFileReference(\imagecreatefromxbm(), 0);
xAdvancedInjectFileReference(\imagecreatefromxpm(), 0);

xAdvancedInjectDirectoryReference(\is_dir(), 0);
xAdvancedInjectDirectoryReference(\dir(), 0);
xAdvancedInjectDirectoryReference(\chdir(), 0);
xAdvancedInjectDirectoryReference(\chroot(), 0);
xAdvancedInjectDirectoryReference(\mkdir(), 0);
xAdvancedInjectDirectoryReference(\rmdir(), 0);
xAdvancedInjectDirectoryReference(\opendir(), 0);
xAdvancedInjectDirectoryReference(\scandir(), 0);
xAdvancedInjectDirectoryReference(\stream_resolve_include_path(), 0);
xAdvancedInjectDirectoryReference(\DirectoryIterator::__construct(), 0);
xAdvancedInjectDirectoryReference(\FilesystemIterator::__construct(), 0);
xAdvancedInjectDirectoryReference(\RecursiveDirectoryIterator::__construct(), 0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public class PhpCompletionTokens {
};

public static String[] fileFuncs = {
"basename:0",
/* "basename:0",
"chgrp:0",
"chmod:0",
"chown:0",
Expand All @@ -340,7 +340,7 @@ public class PhpCompletionTokens {
"filesize:0",
"filetype:0",
"fopen:0",
"is_dir:0:d",
"is_dir:0:d",
"is_executable:0",
"is_file:0",
"is_link:0",
Expand All @@ -366,19 +366,19 @@ public class PhpCompletionTokens {
"symlink:1",
"touch:0",
"unlink:0",
"dir:0:d",
"chdir:0:d",
"chroot:0:d",
"mkdir:0:d",
"rmdir:0:d",
"opendir:0:d",
"scandir:0:d",
"stream_resolve_include_path:0:d",
"dir:0:d",
"chdir:0:d",
"chroot:0:d",
"mkdir:0:d",
"rmdir:0:d",
"opendir:0:d",
"scandir:0:d",
"stream_resolve_include_path:0:d",
"SplFileInfo::__construct:0",
"SplFileObject::__construct:0",
"DirectoryIterator::__construct:0:d",
"FilesystemIterator::__construct:0:d",
"RecursiveDirectoryIterator::__construct:0:d",
"DirectoryIterator::__construct:0:d",
"FilesystemIterator::__construct:0:d",
"RecursiveDirectoryIterator::__construct:0:d",
"ZipArchive::open:0",
"ZipArchive::addFile:0",
"DOMDocument::load:0",
Expand All @@ -393,7 +393,7 @@ public class PhpCompletionTokens {
"imagecreatefrompng:0",
"ImageCreateFromPng:0",
"imagecreatefromgif:0",
"ImageCreateFromGif:0"
"ImageCreateFromGif:0"*/
};

public static String[] socketFuncs = { "fsockopen:0", "stream_socket_client:0" };
Expand Down

0 comments on commit 7320b5a

Please sign in to comment.