intelephense 1.10.3 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/lib/intelephense.js +3 -3
  3. package/lib/lib.decorators.d.ts +3 -6
  4. package/lib/lib.dom.asynciterable.d.ts +28 -0
  5. package/lib/lib.dom.d.ts +367 -153
  6. package/lib/lib.dom.iterable.d.ts +35 -28
  7. package/lib/lib.es2015.collection.d.ts +1 -2
  8. package/lib/lib.es2015.core.d.ts +1 -1
  9. package/lib/lib.es2015.iterable.d.ts +4 -5
  10. package/lib/lib.es2015.promise.d.ts +1 -1
  11. package/lib/lib.es2015.symbol.d.ts +1 -1
  12. package/lib/lib.es2016.array.include.d.ts +1 -1
  13. package/lib/lib.es2016.d.ts +2 -1
  14. package/lib/lib.es2016.full.d.ts +1 -1
  15. package/lib/lib.es2016.intl.d.ts +31 -0
  16. package/lib/lib.es2017.full.d.ts +1 -1
  17. package/lib/lib.es2017.intl.d.ts +11 -12
  18. package/lib/lib.es2017.object.d.ts +3 -3
  19. package/lib/lib.es2018.asynciterable.d.ts +1 -1
  20. package/lib/lib.es2018.full.d.ts +2 -1
  21. package/lib/lib.es2018.intl.d.ts +6 -6
  22. package/lib/lib.es2018.promise.d.ts +1 -1
  23. package/lib/lib.es2018.regexp.d.ts +5 -5
  24. package/lib/lib.es2019.array.d.ts +14 -18
  25. package/lib/lib.es2019.full.d.ts +1 -0
  26. package/lib/lib.es2019.intl.d.ts +1 -1
  27. package/lib/lib.es2019.object.d.ts +1 -1
  28. package/lib/lib.es2020.bigint.d.ts +7 -7
  29. package/lib/lib.es2020.date.d.ts +1 -1
  30. package/lib/lib.es2020.full.d.ts +1 -0
  31. package/lib/lib.es2020.intl.d.ts +45 -27
  32. package/lib/lib.es2020.promise.d.ts +1 -1
  33. package/lib/lib.es2020.string.d.ts +15 -1
  34. package/lib/lib.es2021.full.d.ts +1 -0
  35. package/lib/lib.es2021.intl.d.ts +6 -7
  36. package/lib/lib.es2021.promise.d.ts +3 -3
  37. package/lib/lib.es2021.weakref.d.ts +2 -2
  38. package/lib/lib.es2022.error.d.ts +2 -2
  39. package/lib/lib.es2022.full.d.ts +1 -0
  40. package/lib/lib.es2022.intl.d.ts +2 -3
  41. package/lib/lib.es2022.sharedmemory.d.ts +2 -2
  42. package/lib/lib.es2023.array.d.ts +72 -72
  43. package/lib/lib.es2023.full.d.ts +1 -0
  44. package/lib/lib.es5.d.ts +104 -95
  45. package/lib/lib.esnext.collection.d.ts +29 -0
  46. package/lib/lib.esnext.d.ts +3 -0
  47. package/lib/lib.esnext.disposable.d.ts +11 -11
  48. package/lib/lib.esnext.full.d.ts +2 -1
  49. package/lib/lib.esnext.intl.d.ts +7 -7
  50. package/lib/lib.esnext.object.d.ts +29 -0
  51. package/lib/lib.esnext.promise.d.ts +35 -0
  52. package/lib/lib.scripthost.d.ts +1 -4
  53. package/lib/lib.webworker.asynciterable.d.ts +28 -0
  54. package/lib/lib.webworker.d.ts +204 -111
  55. package/lib/lib.webworker.importscripts.d.ts +0 -1
  56. package/lib/lib.webworker.iterable.d.ts +29 -28
  57. package/lib/stub/Core/Core.php +24 -7
  58. package/lib/stub/Core/Core_c.php +32 -19
  59. package/lib/stub/Ev/Ev.php +6 -5
  60. package/lib/stub/FFI/FFI.php +11 -3
  61. package/lib/stub/PDO/PDO.php +17 -11
  62. package/lib/stub/Parle/Lexer.php +2 -2
  63. package/lib/stub/Parle/Parser.php +2 -2
  64. package/lib/stub/Parle/RLexer.php +2 -2
  65. package/lib/stub/Parle/RParser.php +2 -2
  66. package/lib/stub/Parle/Stack.php +7 -4
  67. package/lib/stub/Phar/Phar.php +18 -14
  68. package/lib/stub/Reflection/Reflection.php +4 -4
  69. package/lib/stub/Reflection/ReflectionAttribute.php +2 -2
  70. package/lib/stub/Reflection/ReflectionClass.php +13 -13
  71. package/lib/stub/Reflection/ReflectionClassConstant.php +10 -10
  72. package/lib/stub/Reflection/ReflectionEnum.php +3 -3
  73. package/lib/stub/Reflection/ReflectionEnumBackedCase.php +2 -2
  74. package/lib/stub/Reflection/ReflectionEnumUnitCase.php +2 -2
  75. package/lib/stub/Reflection/ReflectionExtension.php +9 -9
  76. package/lib/stub/Reflection/ReflectionFunction.php +8 -8
  77. package/lib/stub/Reflection/ReflectionFunctionAbstract.php +13 -13
  78. package/lib/stub/Reflection/ReflectionGenerator.php +3 -3
  79. package/lib/stub/Reflection/ReflectionIntersectionType.php +2 -2
  80. package/lib/stub/Reflection/ReflectionMethod.php +18 -13
  81. package/lib/stub/Reflection/ReflectionNamedType.php +3 -3
  82. package/lib/stub/Reflection/ReflectionObject.php +3 -3
  83. package/lib/stub/Reflection/ReflectionParameter.php +9 -9
  84. package/lib/stub/Reflection/ReflectionProperty.php +11 -11
  85. package/lib/stub/Reflection/ReflectionReference.php +3 -3
  86. package/lib/stub/Reflection/ReflectionType.php +7 -7
  87. package/lib/stub/Reflection/ReflectionUnionType.php +3 -3
  88. package/lib/stub/Reflection/ReflectionZendExtension.php +8 -8
  89. package/lib/stub/SPL/SPL.php +15 -15
  90. package/lib/stub/SPL/SPL_c1.php +23 -23
  91. package/lib/stub/SPL/SPL_f.php +3 -3
  92. package/lib/stub/SQLite/SQLite.php +2 -2
  93. package/lib/stub/SimpleXML/SimpleXML.php +9 -7
  94. package/lib/stub/Zend OPcache/OPcache.php +1 -1
  95. package/lib/stub/aerospike/aerospike.php +2 -1
  96. package/lib/stub/amqp/amqp.php +2 -1
  97. package/lib/stub/apache/apache.php +2 -2
  98. package/lib/stub/bcmath/bcmath.php +10 -10
  99. package/lib/stub/brotli/brotli.php +177 -0
  100. package/lib/stub/bz2/bz2.php +6 -6
  101. package/lib/stub/calendar/calendar.php +3 -3
  102. package/lib/stub/cassandra/cassandra.php +35 -19
  103. package/lib/stub/couchbase/couchbase.php +1 -1
  104. package/lib/stub/ctype/ctype.php +3 -3
  105. package/lib/stub/cubrid/cubrid.php +17 -0
  106. package/lib/stub/curl/curl.php +25 -10
  107. package/lib/stub/date/date.php +12 -13
  108. package/lib/stub/date/date_c.php +25 -25
  109. package/lib/stub/dba/dba.php +8 -8
  110. package/lib/stub/dom/dom.php +2 -2
  111. package/lib/stub/dom/dom_c.php +48 -48
  112. package/lib/stub/ds/ds.php +18 -0
  113. package/lib/stub/enchant/enchant.php +2 -2
  114. package/lib/stub/event/event.php +3 -3
  115. package/lib/stub/exif/exif.php +2 -2
  116. package/lib/stub/fileinfo/fileinfo.php +5 -5
  117. package/lib/stub/filter/filter.php +4 -2
  118. package/lib/stub/ftp/ftp.php +21 -57
  119. package/lib/stub/gd/gd.php +95 -95
  120. package/lib/stub/geoip/geoip.php +2 -2
  121. package/lib/stub/gettext/gettext.php +3 -3
  122. package/lib/stub/gmagick/gmagick.php +2 -2
  123. package/lib/stub/gmp/gmp.php +4 -4
  124. package/lib/stub/gnupg/gnupg.php +2 -2
  125. package/lib/stub/hash/hash.php +9 -9
  126. package/lib/stub/http/http.php +2 -2
  127. package/lib/stub/http/http3.php +12 -11
  128. package/lib/stub/ibm_db2/ibm_db2.php +13 -0
  129. package/lib/stub/iconv/iconv.php +2 -2
  130. package/lib/stub/imagick/imagick.php +6 -4
  131. package/lib/stub/imap/imap.php +8 -8
  132. package/lib/stub/intl/IntlChar.php +7 -7
  133. package/lib/stub/intl/intl.php +14 -20
  134. package/lib/stub/json/json.php +4 -4
  135. package/lib/stub/ldap/ldap.php +9 -5
  136. package/lib/stub/libxml/libxml.php +6 -6
  137. package/lib/stub/mbstring/mbstring.php +15 -14
  138. package/lib/stub/mcrypt/mcrypt.php +2 -2
  139. package/lib/stub/memcached/memcached.php +3 -3
  140. package/lib/stub/meta/.phpstorm.meta.php +1 -0
  141. package/lib/stub/meta/pest/.phpstorm.meta.php +9 -0
  142. package/lib/stub/mongo/mongo.php +2 -1
  143. package/lib/stub/mongodb/BSON/DBPointer.php +2 -2
  144. package/lib/stub/mongodb/BSON/Document.php +12 -0
  145. package/lib/stub/mongodb/BSON/PackedArray.php +12 -0
  146. package/lib/stub/mongodb/BSON/Persistable.php +7 -1
  147. package/lib/stub/mongodb/BSON/Serializable.php +3 -2
  148. package/lib/stub/mongodb/BSON/Symbol.php +2 -2
  149. package/lib/stub/mongodb/BSON/Undefined.php +2 -2
  150. package/lib/stub/mongodb/Monitoring/LogSubscriber.php +23 -0
  151. package/lib/stub/mongodb/ReadConcern.php +2 -1
  152. package/lib/stub/mongodb/ReadPreference.php +2 -1
  153. package/lib/stub/mongodb/ServerApi.php +3 -1
  154. package/lib/stub/mongodb/WriteConcern.php +2 -1
  155. package/lib/stub/mysql/mysql.php +2 -2
  156. package/lib/stub/mysqli/mysqli.php +36 -39
  157. package/lib/stub/newrelic/newrelic.php +2 -2
  158. package/lib/stub/oci8/oci8.php +3 -3
  159. package/lib/stub/oci8/oci8v3.php +12 -0
  160. package/lib/stub/odbc/odbc.php +3 -3
  161. package/lib/stub/openssl/openssl.php +26 -26
  162. package/lib/stub/pam/pam.php +2 -2
  163. package/lib/stub/pcntl/pcntl.php +8 -8
  164. package/lib/stub/pcre/pcre.php +18 -9
  165. package/lib/stub/pdflib/PDFlib.php +246 -23
  166. package/lib/stub/pgsql/pgsql.php +89 -89
  167. package/lib/stub/posix/posix.php +5 -5
  168. package/lib/stub/pq/pq.php +9 -9
  169. package/lib/stub/pspell/pspell.php +2 -2
  170. package/lib/stub/random/random.php +6 -6
  171. package/lib/stub/rdkafka/functions.php +2 -2
  172. package/lib/stub/readline/readline.php +1 -1
  173. package/lib/stub/redis/Redis.php +394 -98
  174. package/lib/stub/redis/RedisArray.php +3 -0
  175. package/lib/stub/redis/RedisCluster.php +303 -47
  176. package/lib/stub/redis/RedisSentinel.php +22 -0
  177. package/lib/stub/regex/ereg.php +2 -2
  178. package/lib/stub/relay/Cluster.php +2463 -0
  179. package/lib/stub/relay/Relay.php +42 -35
  180. package/lib/stub/relay/Sentinel.php +1 -2
  181. package/lib/stub/relay/Table.php +31 -10
  182. package/lib/stub/rpminfo/rpminfo.php +10 -0
  183. package/lib/stub/session/SessionHandler.php +3 -26
  184. package/lib/stub/session/session.php +6 -6
  185. package/lib/stub/shmop/shmop.php +3 -3
  186. package/lib/stub/simdjson/simdjson.php +95 -0
  187. package/lib/stub/soap/soap.php +8 -8
  188. package/lib/stub/sockets/sockets.php +9 -7
  189. package/lib/stub/sodium/sodium.php +29 -29
  190. package/lib/stub/sqlite3/sqlite3.php +19 -19
  191. package/lib/stub/ssh2/ssh2.php +15 -0
  192. package/lib/stub/standard/_types.php +1 -1
  193. package/lib/stub/standard/basic.php +3 -3
  194. package/lib/stub/standard/password.php +2 -2
  195. package/lib/stub/standard/standard_0.php +18 -18
  196. package/lib/stub/standard/standard_1.php +22 -20
  197. package/lib/stub/standard/standard_2.php +11 -11
  198. package/lib/stub/standard/standard_3.php +10 -10
  199. package/lib/stub/standard/standard_4.php +15 -15
  200. package/lib/stub/standard/standard_5.php +7 -6
  201. package/lib/stub/standard/standard_6.php +12 -12
  202. package/lib/stub/standard/standard_7.php +17 -17
  203. package/lib/stub/standard/standard_8.php +17 -17
  204. package/lib/stub/standard/standard_9.php +82 -78
  205. package/lib/stub/superglobals/_superglobals.php +49 -1
  206. package/lib/stub/svn/svn.php +3 -1
  207. package/lib/stub/swoole/functions.php +7 -2
  208. package/lib/stub/sysvmsg/sysvmsg.php +2 -2
  209. package/lib/stub/sysvsem/sysvsem.php +2 -2
  210. package/lib/stub/sysvshm/sysvshm.php +2 -2
  211. package/lib/stub/tokenizer/tokenizer.php +9 -9
  212. package/lib/stub/uv/UV.php +30 -1
  213. package/lib/stub/uv/uv_functions.php +186 -214
  214. package/lib/stub/wordpress/wordpress-stubs.php +54280 -27726
  215. package/lib/stub/xdiff/xdiff.php +2 -2
  216. package/lib/stub/xml/xml.php +3 -3
  217. package/lib/stub/xmlreader/xmlreader.php +5 -5
  218. package/lib/stub/xmlwriter/xmlwriter.php +8 -8
  219. package/lib/stub/yaf/yaf.php +371 -322
  220. package/lib/stub/yaf/yaf_namespace.php +18 -18
  221. package/lib/stub/zip/zip.php +3 -3
  222. package/lib/stub/zlib/zlib.php +4 -4
  223. package/lib/stub/zookeeper/zookeeper.php +2 -2
  224. package/package.json +31 -31
package/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # Change Log
2
2
 
3
+ ## [1.11.0 - 2024-06-29]
4
+
5
+ #### Added
6
+ - Type Hierarchy. **[Premium](https://intelephense.com)**
7
+ - Support for `key-of<Type>` utility type.
8
+ - Support for `T[K]` index access utility types.
9
+ - Completion suggestions for `$_SERVER` array keys.
10
+ - `unset()` now set variable type to `unset`.
11
+ - Phpdoc unsealed array shape syntax - `array{foo: 'bar', ...<int, object>}`.
12
+ - Support PHP 8.3 enum and class constant dynamic access syntax.
13
+ - Ability to turn formatter off/on with comments. Within PHP - `// @formatter:off`, `// @formatter:on`. Within HTML - `<!-- @formatter:off -->`. Within js/CSS - `/* @formatter:off */`.
14
+ - New setting to prefer `@psalm-`, `@phpstan-` prefixed annotations when determining symbol type. Defaults to `false`. `intelephense.compatibility.preferPsalmPhpstanPrefixedAnnotations`.
15
+ - Support for `@psalm-type` and `@psalm-import-type` type aliases. Set `intelephense.compatibility.preferPsalmPhpstanPrefixedAnnotations` to `true` to enable.
16
+ - Support `@see`, `@uses`, `@link` annotations and inline variants.
17
+ - Static member access completion/hover/references when scope is variable of type `class-string<Foo>`.
18
+ - Hover on array shape string keys.
19
+ - New `intelephense.diagnostics.relaxedTypeCheck` setting. Defaults to `true` (previous version behaviour). This setting makes type checking less thorough by allowing contravariant (wider) types to also satisfy a type constraint. This is useful for projects that may have incomplete or innacurate typings. Set to `false` for more thorough type checks. When this setting is `true`, the `noMixedTypeCheck` setting is ignored.
20
+ - New `intelephense.diagnostics.noMixedTypeCheck` setting. Defaults to `true` (previous version behaviour). This setting turns off type checking for the `mixed` type. This is useful for projects that may have incomplete or innacurate typings. Set to `false` to make type checking more thorough by not allowing `mixed` to satisy any type constraint. This setting has no effect when `relaxedTypeCheck` is `true`.
21
+ - New `completion.suggestObjectOperatorStaticMethods` setting. PHP permits the calling of static methods using the object operator eg `$obj->myStaticMethod();`. If you would prefer not to have static methods suggested in this context then set this value to `false`. Defaults to `true`.
22
+ - Parameter types are now injected into inline closure arguments to functions from the corresponding parameter annotated callable type. For example declaring `function doCallback($myCallback) {}` with annotation `/** @param \Closure(Foo $param): void $myCallback **/` will result in type hints for `$param` inside `doCallback(function ($param) { /* $param type is known */ });`
23
+ - Support `@var` annotated type above `define` constants.
24
+
25
+ #### Changed
26
+ - Minimum VSCode version 1.82.
27
+ - Recommended nodejs version 20.
28
+ - Literal types and array shapes are now used for constants. eg the type of `const FOO = 'bar';` is now `'bar'` instead of `string`, `const ARR = ['foo' => true]` is now `array{foo: true}` instead of `array`.
29
+ - `$argv` is now type `string[]`.
30
+ - `$http_response_header` is now type `array|unset`.
31
+ - `$php_errmsg` is now type `string|unset`.
32
+ - Updated stubs.
33
+ - Formatter now aims to be [PER](https://www.php-fig.org/per/coding-style/) compliant. As such, `psr12` setting in `intelephense.format.braces` has been removed and `per` added.
34
+ - Formatter now allows a single space or no space in unary logical negation.
35
+ - Empty class, trait, interface, enum, function, method bodies are formatted to `{}` with a single space preceeding `{`.
36
+ - Short anonymous functions are now formatted to have no space between `fn` and `(`.
37
+ - Improved multiline `foreach` expression formatting.
38
+ - Formatter now allows a single space or no space before colon in alternate control statements.
39
+ - Formatter now allows a single space or newline + indent before opening brace in anonymous class.
40
+ - Formatter now allows semicolon to be placed on a separate line in multiline chained expression statements.
41
+ - Multiline arrays are now formatted to a single element per line.
42
+ - Formatter will preserve wrapped attibutes in HTML.
43
+ - When multiple method/function candidates are found for a call expression, the result will be a union of the return types of the functions/methods.
44
+
45
+ #### Fixed
46
+ - Template type resolution from args when arg is subtype of param type.
47
+ - Various control flow fixes and improvements.
48
+ - Missing or poorly displayed code blocks in hover/completion documentation for some built-in symbols.
49
+ - Array destructure with skipped elements.
50
+ - Shorthand ternary type inference.
51
+ - Incorrect import folding range.
52
+ - Param with optional array shape element not indicating element is optional when hovering.
53
+ - Hover on named arg of closure showing incorrect type `unset`.
54
+ - Incorrect type inferred for dynamic object creation expression when dynamic type is union.
55
+ - Hover showing non php fenced codeblocks incorrectly.
56
+ - Stack overflow with deeply nested string concatenation (TYPO3 PackageArtifact.php).
57
+ - Incorrect return type for symbols with metadata and null default parameter value (Laravel `app()`);
58
+ - Incorrect type when generating phpdoc for variadic params.
59
+ - Declare statement should accept comma separated directive list.
60
+ - Incorrect `$matches` type after `preg_match_all` call.
61
+ - Promoted property highlight.
62
+ - Code actions not showing when narrow or zero length range provided.
63
+ - Unable to `@disregard` errors in method header.
64
+ - Unnecessary match expr format when operand of binary expr.
65
+ - Incorrect file rename if `composer.json` contains autoload paths without trailing `/`.
66
+ - `static::class` resolving to parent class name rather than child class name.
67
+ - Trait method `self` return type not resolving to consuming class when used as implementation for interface method.
68
+ - Don't show `iterable` as interface.
69
+ - Variables typed as `iterable<Foo>` not working with array access notation.
70
+ - Array destructure with `ArrayAccess`.
71
+
72
+ ## [1.10.4 - 2024-03-26]
73
+
74
+ #### Fixed
75
+ - Cannot read properties of undefined (reading kind) with `for` loops which have parse errors.
76
+
3
77
  ## [1.10.3 - 2024-03-25]
4
78
 
5
79
  #### Fixed