Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. namespace PHPSTORM_META {
  3. registerArgumentsSet(
  4. "bool",
  5. true,
  6. false
  7. );
  8. registerArgumentsSet(
  9. "compression_methods",
  10. \PhpZip\Constants\ZipCompressionMethod::STORED,
  11. \PhpZip\Constants\ZipCompressionMethod::DEFLATED,
  12. \PhpZip\Constants\ZipCompressionMethod::BZIP2
  13. );
  14. expectedArguments(\PhpZip\ZipFile::addFile(), 2, argumentsSet("compression_methods"));
  15. expectedArguments(\PhpZip\ZipFile::addFromStream(), 2, argumentsSet("compression_methods"));
  16. expectedArguments(\PhpZip\ZipFile::addFromString(), 2, argumentsSet("compression_methods"));
  17. expectedArguments(\PhpZip\ZipFile::addDir(), 2, argumentsSet("compression_methods"));
  18. expectedArguments(\PhpZip\ZipFile::addDirRecursive(), 2, argumentsSet("compression_methods"));
  19. expectedArguments(\PhpZip\ZipFile::addFilesFromIterator(), 2, argumentsSet("compression_methods"));
  20. expectedArguments(\PhpZip\ZipFile::addFilesFromIterator(), 2, argumentsSet("compression_methods"));
  21. expectedArguments(\PhpZip\ZipFile::addFilesFromGlob(), 3, argumentsSet("compression_methods"));
  22. expectedArguments(\PhpZip\ZipFile::addFilesFromGlobRecursive(), 3, argumentsSet("compression_methods"));
  23. expectedArguments(\PhpZip\ZipFile::addFilesFromRegex(), 3, argumentsSet("compression_methods"));
  24. expectedArguments(\PhpZip\ZipFile::addFilesFromRegexRecursive(), 3, argumentsSet("compression_methods"));
  25. expectedArguments(\PhpZip\ZipFile::setCompressionMethodEntry(), 1, argumentsSet("compression_methods"));
  26. expectedArguments(\PhpZip\Model\ZipEntry::setCompressionMethod(), 0, argumentsSet("compression_methods"));
  27. expectedArguments(\PhpZip\Model\ZipEntry::setMethod(), 0, argumentsSet("compression_methods"));
  28. registerArgumentsSet(
  29. 'compression_levels',
  30. \PhpZip\Constants\ZipCompressionLevel::MAXIMUM,
  31. \PhpZip\Constants\ZipCompressionLevel::NORMAL,
  32. \PhpZip\Constants\ZipCompressionLevel::FAST,
  33. \PhpZip\Constants\ZipCompressionLevel::SUPER_FAST
  34. );
  35. expectedArguments(\PhpZip\ZipFile::setCompressionLevel(), 0, argumentsSet("compression_levels"));
  36. expectedArguments(\PhpZip\ZipFile::setCompressionLevelEntry(), 1, argumentsSet("compression_levels"));
  37. expectedArguments(\PhpZip\Model\ZipEntry::setCompressionLevel(), 0, argumentsSet("compression_levels"));
  38. registerArgumentsSet(
  39. 'encryption_methods',
  40. \PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_256,
  41. \PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_192,
  42. \PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_128,
  43. \PhpZip\Constants\ZipEncryptionMethod::PKWARE
  44. );
  45. expectedArguments(\PhpZip\ZipFile::setPassword(), 1, argumentsSet("encryption_methods"));
  46. expectedArguments(\PhpZip\ZipFile::setPasswordEntry(), 2, argumentsSet("encryption_methods"));
  47. expectedArguments(\PhpZip\Model\ZipEntry::setEncryptionMethod(), 0, argumentsSet("encryption_methods"));
  48. expectedArguments(\PhpZip\Model\ZipEntry::setPassword(), 1, argumentsSet("encryption_methods"));
  49. registerArgumentsSet(
  50. 'zip_mime_types',
  51. null,
  52. 'application/zip',
  53. 'application/vnd.android.package-archive',
  54. 'application/java-archive'
  55. );
  56. expectedArguments(\PhpZip\ZipFile::outputAsAttachment(), 1, argumentsSet("zip_mime_types"));
  57. expectedArguments(\PhpZip\ZipFile::outputAsAttachment(), 2, argumentsSet("bool"));
  58. expectedArguments(\PhpZip\ZipFile::outputAsResponse(), 2, argumentsSet("zip_mime_types"));
  59. expectedArguments(\PhpZip\ZipFile::outputAsResponse(), 3, argumentsSet("bool"));
  60. registerArgumentsSet(
  61. 'dos_charset',
  62. \PhpZip\Constants\DosCodePage::CP_LATIN_US,
  63. \PhpZip\Constants\DosCodePage::CP_GREEK,
  64. \PhpZip\Constants\DosCodePage::CP_BALT_RIM,
  65. \PhpZip\Constants\DosCodePage::CP_LATIN1,
  66. \PhpZip\Constants\DosCodePage::CP_LATIN2,
  67. \PhpZip\Constants\DosCodePage::CP_CYRILLIC,
  68. \PhpZip\Constants\DosCodePage::CP_TURKISH,
  69. \PhpZip\Constants\DosCodePage::CP_PORTUGUESE,
  70. \PhpZip\Constants\DosCodePage::CP_ICELANDIC,
  71. \PhpZip\Constants\DosCodePage::CP_HEBREW,
  72. \PhpZip\Constants\DosCodePage::CP_CANADA,
  73. \PhpZip\Constants\DosCodePage::CP_ARABIC,
  74. \PhpZip\Constants\DosCodePage::CP_NORDIC,
  75. \PhpZip\Constants\DosCodePage::CP_CYRILLIC_RUSSIAN,
  76. \PhpZip\Constants\DosCodePage::CP_GREEK2,
  77. \PhpZip\Constants\DosCodePage::CP_THAI
  78. );
  79. expectedArguments(\PhpZip\Model\ZipEntry::setCharset(), 0, argumentsSet('dos_charset'));
  80. expectedArguments(\PhpZip\Constants\DosCodePage::toUTF8(), 1, argumentsSet('dos_charset'));
  81. expectedArguments(\PhpZip\Constants\DosCodePage::fromUTF8(), 1, argumentsSet('dos_charset'));
  82. registerArgumentsSet(
  83. "zip_os",
  84. \PhpZip\Constants\ZipPlatform::OS_UNIX,
  85. \PhpZip\Constants\ZipPlatform::OS_DOS,
  86. \PhpZip\Constants\ZipPlatform::OS_MAC_OSX
  87. );
  88. expectedArguments(\PhpZip\Model\ZipEntry::setCreatedOS(), 0, argumentsSet('zip_os'));
  89. expectedArguments(\PhpZip\Model\ZipEntry::setExtractedOS(), 0, argumentsSet('zip_os'));
  90. expectedArguments(\PhpZip\Model\ZipEntry::setPlatform(), 0, argumentsSet('zip_os'));
  91. registerArgumentsSet(
  92. "zip_gpbf",
  93. \PhpZip\Constants\GeneralPurposeBitFlag::ENCRYPTION |
  94. \PhpZip\Constants\GeneralPurposeBitFlag::DATA_DESCRIPTOR |
  95. \PhpZip\Constants\GeneralPurposeBitFlag::COMPRESSION_FLAG1 |
  96. \PhpZip\Constants\GeneralPurposeBitFlag::COMPRESSION_FLAG2 |
  97. \PhpZip\Constants\GeneralPurposeBitFlag::UTF8
  98. );
  99. expectedArguments(\PhpZip\Model\ZipEntry::setGeneralPurposeBitFlags(), 0, argumentsSet('zip_gpbf'));
  100. registerArgumentsSet(
  101. "winzip_aes_vendor_version",
  102. \PhpZip\Model\Extra\Fields\WinZipAesExtraField::VERSION_AE1,
  103. \PhpZip\Model\Extra\Fields\WinZipAesExtraField::VERSION_AE2
  104. );
  105. registerArgumentsSet(
  106. "winzip_aes_key_strength",
  107. \PhpZip\Model\Extra\Fields\WinZipAesExtraField::KEY_STRENGTH_256BIT,
  108. \PhpZip\Model\Extra\Fields\WinZipAesExtraField::KEY_STRENGTH_128BIT,
  109. \PhpZip\Model\Extra\Fields\WinZipAesExtraField::KEY_STRENGTH_192BIT
  110. );
  111. expectedArguments(\PhpZip\Model\Extra\Fields\WinZipAesExtraField::__construct(), 0, argumentsSet('winzip_aes_vendor_version'));
  112. expectedArguments(\PhpZip\Model\Extra\Fields\WinZipAesExtraField::__construct(), 1, argumentsSet('winzip_aes_key_strength'));
  113. expectedArguments(\PhpZip\Model\Extra\Fields\WinZipAesExtraField::__construct(), 2, argumentsSet('compression_methods'));
  114. expectedArguments(\PhpZip\Model\Extra\Fields\WinZipAesExtraField::setVendorVersion(), 0, argumentsSet('winzip_aes_vendor_version'));
  115. expectedArguments(\PhpZip\Model\Extra\Fields\WinZipAesExtraField::setKeyStrength(), 0, argumentsSet('winzip_aes_key_strength'));
  116. expectedArguments(\PhpZip\Model\Extra\Fields\WinZipAesExtraField::setCompressionMethod(), 0, argumentsSet('compression_methods'));
  117. }