@flarum/cli 2.0.2 → 3.0.1

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 (623) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +40 -22
  3. package/boilerplate/skeleton/extension/.github/workflows/backend.yml +1 -1
  4. package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +2 -1
  5. package/boilerplate/skeleton/extension/.github/workflows/phpstan.yml +12 -0
  6. package/boilerplate/skeleton/extension/composer.json +8 -4
  7. package/boilerplate/skeleton/extension/gitignore +1 -0
  8. package/boilerplate/skeleton/extension/js/jest.config.cjs +1 -0
  9. package/boilerplate/skeleton/extension/js/package.json +6 -3
  10. package/boilerplate/skeleton/extension/js/src/admin/extend.js +8 -0
  11. package/boilerplate/skeleton/extension/js/src/admin/extend.ts +8 -0
  12. package/boilerplate/skeleton/extension/js/src/admin/index.js +2 -0
  13. package/boilerplate/skeleton/extension/js/src/admin/index.ts +3 -1
  14. package/boilerplate/skeleton/extension/js/src/common/extend.js +5 -0
  15. package/boilerplate/skeleton/extension/js/src/common/extend.ts +5 -0
  16. package/boilerplate/skeleton/extension/js/src/common/index.ts +1 -1
  17. package/boilerplate/skeleton/extension/js/src/forum/extend.js +8 -0
  18. package/boilerplate/skeleton/extension/js/src/forum/extend.ts +8 -0
  19. package/boilerplate/skeleton/extension/js/src/forum/index.js +2 -0
  20. package/boilerplate/skeleton/extension/js/src/forum/index.ts +3 -1
  21. package/boilerplate/skeleton/extension/js/tests/unit/.gitkeep +0 -0
  22. package/boilerplate/skeleton/extension/js/tsconfig.test.json +10 -0
  23. package/boilerplate/skeleton/extension/locale/en.yml +1 -1
  24. package/boilerplate/skeleton/extension/phpstan.neon +12 -0
  25. package/boilerplate/skeleton/extension/tests/phpunit.integration.xml +5 -7
  26. package/boilerplate/skeleton/extension/tests/phpunit.unit.xml +5 -10
  27. package/boilerplate/stubs/backend/advanced-api-resource.php +85 -0
  28. package/boilerplate/stubs/backend/api-resource.php +73 -0
  29. package/boilerplate/stubs/backend/command.php +2 -2
  30. package/boilerplate/stubs/backend/controller.php +19 -0
  31. package/boilerplate/stubs/backend/event-listener.php +1 -1
  32. package/boilerplate/stubs/backend/filter.php +25 -0
  33. package/boilerplate/stubs/backend/handler/command.php +6 -20
  34. package/boilerplate/stubs/backend/handler/handler.php +6 -14
  35. package/boilerplate/stubs/backend/integration-test.php +10 -7
  36. package/boilerplate/stubs/backend/job.php +6 -11
  37. package/boilerplate/stubs/backend/mail-driver.php +36 -0
  38. package/boilerplate/stubs/backend/middleware.php +19 -0
  39. package/boilerplate/stubs/backend/model.php +1 -1
  40. package/boilerplate/stubs/backend/notification-blueprint.php +42 -0
  41. package/boilerplate/stubs/backend/notification-driver.php +32 -0
  42. package/boilerplate/stubs/backend/policy.php +1 -1
  43. package/boilerplate/stubs/backend/post-type.php +35 -0
  44. package/boilerplate/stubs/backend/repository.php +2 -10
  45. package/boilerplate/stubs/backend/search/driver.php +13 -0
  46. package/boilerplate/stubs/backend/search/searcher.php +41 -0
  47. package/boilerplate/stubs/backend/service-provider.php +1 -1
  48. package/boilerplate/stubs/backend/validator.php +1 -1
  49. package/boilerplate/stubs/frontend/component.js +1 -1
  50. package/boilerplate/stubs/frontend/forum-page.js +68 -0
  51. package/boilerplate/stubs/frontend/gambit/boolean.js +12 -0
  52. package/boilerplate/stubs/frontend/gambit/key-value.js +16 -0
  53. package/boilerplate/stubs/frontend/modal.js +1 -1
  54. package/boilerplate/stubs/frontend/model.js +1 -1
  55. package/boilerplate/stubs/frontend/notification.js +22 -0
  56. package/boilerplate/stubs/frontend/post-type.js +13 -0
  57. package/boilerplate/stubs/migration.php +1 -1
  58. package/boilerplate/stubs/views/email/html/information.blade.php +8 -0
  59. package/boilerplate/stubs/views/email/html/notification.blade.php +8 -0
  60. package/boilerplate/stubs/views/email/plain/information.blade.php +7 -0
  61. package/boilerplate/stubs/views/email/plain/notification.blade.php +6 -0
  62. package/lib/base-command.d.ts +19 -5
  63. package/lib/base-command.js +73 -28
  64. package/lib/boilersmith/io.d.ts +9 -7
  65. package/lib/boilersmith/io.js +28 -15
  66. package/lib/boilersmith/paths.d.ts +1 -1
  67. package/lib/boilersmith/scaffolding/audit-step-factory.js +1 -1
  68. package/lib/boilersmith/scaffolding/module.d.ts +4 -4
  69. package/lib/boilersmith/scaffolding/module.js +6 -6
  70. package/lib/boilersmith/scaffolding/scaffolder.d.ts +1 -1
  71. package/lib/boilersmith/scaffolding/scaffolder.js +1 -1
  72. package/lib/boilersmith/scaffolding/template-param.d.ts +1 -1
  73. package/lib/boilersmith/step-manager.d.ts +15 -10
  74. package/lib/boilersmith/step-manager.js +35 -9
  75. package/lib/boilersmith/steps/stub-base.js +1 -1
  76. package/lib/boilersmith/utils/json-leaf-paths.d.ts +2 -2
  77. package/lib/commands/audit/infra.d.ts +1 -4
  78. package/lib/commands/audit/infra.js +1 -1
  79. package/lib/commands/flarum/change.js +2 -2
  80. package/lib/commands/flarum/info.js +1 -1
  81. package/lib/commands/infra.d.ts +1 -9
  82. package/lib/commands/infra.js +2 -2
  83. package/lib/commands/init.d.ts +1 -4
  84. package/lib/commands/init.js +3 -3
  85. package/lib/commands/make/backend/{api-serializer.d.ts → api-resource.d.ts} +2 -5
  86. package/lib/commands/make/backend/api-resource.js +26 -0
  87. package/lib/commands/make/backend/command.d.ts +1 -4
  88. package/lib/commands/make/backend/command.js +2 -2
  89. package/lib/commands/make/backend/{api-controller.d.ts → controller.d.ts} +2 -5
  90. package/lib/commands/make/backend/controller.js +31 -0
  91. package/lib/commands/make/backend/event-listener.d.ts +1 -4
  92. package/lib/commands/make/backend/event-listener.js +1 -1
  93. package/lib/commands/make/backend/{api-serializer-attributes.d.ts → filter.d.ts} +3 -6
  94. package/lib/commands/make/backend/filter.js +26 -0
  95. package/lib/commands/make/backend/handler.d.ts +2 -5
  96. package/lib/commands/make/backend/handler.js +6 -6
  97. package/lib/commands/make/backend/integration-test.d.ts +1 -4
  98. package/lib/commands/make/backend/integration-test.js +2 -2
  99. package/lib/commands/make/backend/job.d.ts +1 -4
  100. package/lib/commands/make/backend/job.js +2 -2
  101. package/lib/commands/make/backend/mail-driver.d.ts +12 -0
  102. package/lib/commands/make/backend/mail-driver.js +29 -0
  103. package/lib/commands/make/backend/middleware.d.ts +11 -0
  104. package/lib/commands/make/backend/middleware.js +26 -0
  105. package/lib/commands/make/backend/migration.d.ts +1 -4
  106. package/lib/commands/make/backend/migration.js +9 -2
  107. package/lib/commands/make/backend/model.d.ts +6 -7
  108. package/lib/commands/make/backend/model.js +68 -447
  109. package/lib/commands/make/backend/notification-blueprint.d.ts +12 -0
  110. package/lib/commands/make/backend/notification-blueprint.js +29 -0
  111. package/lib/commands/make/backend/notification-driver.d.ts +12 -0
  112. package/lib/commands/make/backend/notification-driver.js +29 -0
  113. package/lib/commands/make/backend/policy.d.ts +1 -4
  114. package/lib/commands/make/backend/policy.js +1 -1
  115. package/lib/commands/make/backend/post-type.d.ts +12 -0
  116. package/lib/commands/make/backend/post-type.js +29 -0
  117. package/lib/commands/make/backend/repository.d.ts +1 -4
  118. package/lib/commands/make/backend/repository.js +1 -1
  119. package/lib/commands/make/backend/route.d.ts +1 -4
  120. package/lib/commands/make/backend/route.js +1 -1
  121. package/lib/commands/make/backend/search-driver.d.ts +11 -0
  122. package/lib/commands/make/backend/search-driver.js +51 -0
  123. package/lib/commands/make/backend/service-provider.d.ts +1 -4
  124. package/lib/commands/make/backend/service-provider.js +2 -2
  125. package/lib/commands/make/backend/validator.d.ts +1 -4
  126. package/lib/commands/make/backend/validator.js +2 -2
  127. package/lib/commands/make/frontend/component.d.ts +4 -5
  128. package/lib/commands/make/frontend/component.js +7 -2
  129. package/lib/commands/make/frontend/forum-page.d.ts +11 -0
  130. package/lib/commands/make/frontend/forum-page.js +92 -0
  131. package/lib/commands/make/frontend/gambit.d.ts +11 -0
  132. package/lib/commands/make/frontend/gambit.js +30 -0
  133. package/lib/commands/make/frontend/modal.d.ts +1 -4
  134. package/lib/commands/make/frontend/modal.js +3 -2
  135. package/lib/commands/make/frontend/model.d.ts +6 -7
  136. package/lib/commands/make/frontend/model.js +26 -24
  137. package/lib/commands/make/frontend/notification.d.ts +12 -0
  138. package/lib/commands/make/frontend/notification.js +62 -0
  139. package/lib/commands/make/frontend/post-type.d.ts +12 -0
  140. package/lib/commands/make/frontend/post-type.js +59 -0
  141. package/lib/commands/make/locale.d.ts +11 -0
  142. package/lib/commands/make/locale.js +27 -0
  143. package/lib/commands/make/model.d.ts +12 -0
  144. package/lib/commands/make/model.js +29 -0
  145. package/lib/commands/make/notification.d.ts +11 -0
  146. package/lib/commands/make/notification.js +33 -0
  147. package/lib/commands/make/post-type.d.ts +11 -0
  148. package/lib/commands/make/post-type.js +31 -0
  149. package/lib/commands/monorepo/create.d.ts +1 -4
  150. package/lib/commands/monorepo/create.js +1 -1
  151. package/lib/commands/monorepo/split.d.ts +1 -4
  152. package/lib/commands/monorepo/split.js +1 -1
  153. package/lib/commands/update/js-imports.d.ts +1 -4
  154. package/lib/commands/update/js-imports.js +1 -1
  155. package/lib/commands/upgrade/2.0.d.ts +17 -0
  156. package/lib/commands/upgrade/2.0.js +113 -0
  157. package/lib/help.js +1 -1
  158. package/lib/providers/php-provider.d.ts +7 -1
  159. package/lib/providers/php-provider.js +16 -3
  160. package/lib/steps/extenders/{api-serializer.d.ts → api-resource.d.ts} +1 -1
  161. package/lib/steps/extenders/api-resource.js +38 -0
  162. package/lib/steps/extenders/base.d.ts +1 -1
  163. package/lib/steps/extenders/base.js +13 -1
  164. package/lib/steps/extenders/console-command.js +1 -1
  165. package/lib/steps/extenders/event.js +1 -1
  166. package/lib/steps/extenders/mail-driver.d.ts +5 -0
  167. package/lib/steps/extenders/mail-driver.js +58 -0
  168. package/lib/steps/extenders/middleware.d.ts +5 -0
  169. package/lib/steps/extenders/middleware.js +57 -0
  170. package/lib/steps/extenders/notification-driver.d.ts +5 -0
  171. package/lib/steps/extenders/notification-driver.js +58 -0
  172. package/lib/steps/extenders/notification-type.d.ts +5 -0
  173. package/lib/steps/extenders/notification-type.js +55 -0
  174. package/lib/steps/extenders/policy.js +1 -1
  175. package/lib/steps/extenders/post-type.d.ts +5 -0
  176. package/lib/steps/extenders/post-type.js +42 -0
  177. package/lib/steps/extenders/route.js +11 -2
  178. package/lib/steps/extenders/search-driver.d.ts +5 -0
  179. package/lib/steps/extenders/search-driver.js +38 -0
  180. package/lib/steps/extenders/search-filter.d.ts +5 -0
  181. package/lib/steps/extenders/search-filter.js +67 -0
  182. package/lib/steps/extenders/service-provider.js +1 -1
  183. package/lib/steps/gen-ext-scaffolder.d.ts +3 -3
  184. package/lib/steps/gen-ext-scaffolder.js +79 -7
  185. package/lib/steps/js/base.d.ts +14 -5
  186. package/lib/steps/js/base.js +101 -25
  187. package/lib/steps/js/model.d.ts +4 -7
  188. package/lib/steps/js/model.js +45 -19
  189. package/lib/steps/js/notification.d.ts +7 -0
  190. package/lib/steps/js/notification.js +58 -0
  191. package/lib/steps/js/post-type.d.ts +8 -0
  192. package/lib/steps/js/post-type.js +60 -0
  193. package/lib/steps/js/routes.d.ts +7 -0
  194. package/lib/steps/js/routes.js +63 -0
  195. package/lib/steps/js/search-driver-locale.d.ts +8 -0
  196. package/lib/steps/js/search-driver-locale.js +36 -0
  197. package/lib/steps/js/search-gambit.d.ts +7 -0
  198. package/lib/steps/js/search-gambit.js +51 -0
  199. package/lib/steps/locale/base.d.ts +32 -0
  200. package/lib/steps/locale/base.js +97 -0
  201. package/lib/steps/misc/git.js +1 -1
  202. package/lib/steps/monorepo/create.d.ts +2 -0
  203. package/lib/steps/monorepo/create.js +5 -4
  204. package/lib/steps/monorepo/split.js +1 -1
  205. package/lib/steps/stubs/backend/advanced-api-resource.d.ts +13 -0
  206. package/lib/steps/stubs/backend/advanced-api-resource.js +81 -0
  207. package/lib/steps/stubs/backend/{api-serializer.d.ts → api-resource.d.ts} +1 -1
  208. package/lib/steps/stubs/backend/{api-serializer.js → api-resource.js} +9 -9
  209. package/lib/steps/stubs/backend/command.d.ts +2 -16
  210. package/lib/steps/stubs/backend/command.js +14 -1
  211. package/lib/steps/stubs/backend/{api-controller.d.ts → controller.d.ts} +3 -13
  212. package/lib/steps/stubs/backend/controller.js +40 -0
  213. package/lib/steps/stubs/backend/event-listener.js +1 -1
  214. package/lib/steps/stubs/backend/filter.d.ts +8 -0
  215. package/lib/steps/stubs/backend/filter.js +44 -0
  216. package/lib/steps/stubs/backend/handler-command.d.ts +2 -27
  217. package/lib/steps/stubs/backend/handler-command.js +2 -1
  218. package/lib/steps/stubs/backend/handler.js +1 -1
  219. package/lib/steps/stubs/backend/integration-test.js +0 -5
  220. package/lib/steps/stubs/backend/mail-driver.d.ts +7 -0
  221. package/lib/steps/stubs/backend/mail-driver.js +30 -0
  222. package/lib/steps/stubs/backend/middleware.d.ts +22 -0
  223. package/lib/steps/stubs/backend/middleware.js +31 -0
  224. package/lib/steps/stubs/backend/model.d.ts +2 -24
  225. package/lib/steps/stubs/backend/model.js +2 -5
  226. package/lib/steps/stubs/backend/notification-blueprint.d.ts +7 -0
  227. package/lib/steps/stubs/backend/notification-blueprint.js +44 -0
  228. package/lib/steps/stubs/backend/notification-driver.d.ts +7 -0
  229. package/lib/steps/stubs/backend/notification-driver.js +30 -0
  230. package/lib/steps/stubs/backend/policy.js +1 -1
  231. package/lib/steps/stubs/backend/post-type.d.ts +7 -0
  232. package/lib/steps/stubs/backend/post-type.js +44 -0
  233. package/lib/steps/stubs/backend/repository.js +1 -1
  234. package/lib/steps/stubs/backend/search-driver-searcher.d.ts +24 -0
  235. package/lib/steps/stubs/backend/search-driver-searcher.js +32 -0
  236. package/lib/steps/stubs/backend/search-driver.d.ts +8 -0
  237. package/lib/steps/stubs/backend/search-driver.js +49 -0
  238. package/lib/steps/stubs/flarum-base.js +1 -1
  239. package/lib/steps/stubs/frontend/forum-page.d.ts +25 -0
  240. package/lib/steps/stubs/frontend/forum-page.js +37 -0
  241. package/lib/steps/stubs/frontend/gambit.d.ts +7 -0
  242. package/lib/steps/stubs/frontend/gambit.js +50 -0
  243. package/lib/steps/stubs/frontend/model.d.ts +12 -0
  244. package/lib/steps/stubs/frontend/model.js +5 -0
  245. package/lib/steps/stubs/frontend/notification.d.ts +11 -0
  246. package/lib/steps/stubs/frontend/notification.js +48 -0
  247. package/lib/steps/stubs/frontend/post-type.d.ts +11 -0
  248. package/lib/steps/stubs/frontend/post-type.js +48 -0
  249. package/lib/steps/stubs/js-base.js +5 -1
  250. package/lib/steps/stubs/php-base.js +3 -1
  251. package/lib/steps/update/js-imports.js +1 -1
  252. package/lib/steps/upgrade/twopointoh/backend/email-views.d.ts +18 -0
  253. package/lib/steps/upgrade/twopointoh/backend/email-views.js +81 -0
  254. package/lib/steps/upgrade/twopointoh/backend/filesystem.d.ts +8 -0
  255. package/lib/steps/upgrade/twopointoh/backend/filesystem.js +40 -0
  256. package/lib/steps/upgrade/twopointoh/backend/intervention-image.d.ts +8 -0
  257. package/lib/steps/upgrade/twopointoh/backend/intervention-image.js +44 -0
  258. package/lib/steps/upgrade/twopointoh/backend/json-api.d.ts +12 -0
  259. package/lib/steps/upgrade/twopointoh/backend/json-api.js +111 -0
  260. package/lib/steps/upgrade/twopointoh/backend/mailer.d.ts +8 -0
  261. package/lib/steps/upgrade/twopointoh/backend/mailer.js +37 -0
  262. package/lib/steps/upgrade/twopointoh/backend/misc.d.ts +8 -0
  263. package/lib/steps/upgrade/twopointoh/backend/misc.js +42 -0
  264. package/lib/steps/upgrade/twopointoh/backend/phpunit.d.ts +8 -0
  265. package/lib/steps/upgrade/twopointoh/backend/phpunit.js +52 -0
  266. package/lib/steps/upgrade/twopointoh/backend/search.d.ts +28 -0
  267. package/lib/steps/upgrade/twopointoh/backend/search.js +200 -0
  268. package/lib/steps/upgrade/twopointoh/base.d.ts +58 -0
  269. package/lib/steps/upgrade/twopointoh/base.js +284 -0
  270. package/lib/steps/upgrade/twopointoh/dependencies.d.ts +10 -0
  271. package/lib/steps/upgrade/twopointoh/dependencies.js +108 -0
  272. package/lib/steps/upgrade/twopointoh/frontend/code-splitting/usage-of-lazy-modules.d.ts +26 -0
  273. package/lib/steps/upgrade/twopointoh/frontend/code-splitting/usage-of-lazy-modules.js +418 -0
  274. package/lib/steps/upgrade/twopointoh/frontend/export-registry/compat.d.ts +12 -0
  275. package/lib/steps/upgrade/twopointoh/frontend/export-registry/compat.js +75 -0
  276. package/lib/steps/upgrade/twopointoh/frontend/export-registry/import-ext.d.ts +13 -0
  277. package/lib/steps/upgrade/twopointoh/frontend/export-registry/import-ext.js +126 -0
  278. package/lib/steps/upgrade/twopointoh/frontend/format.d.ts +8 -0
  279. package/lib/steps/upgrade/twopointoh/frontend/format.js +32 -0
  280. package/lib/steps/upgrade/twopointoh/frontend/misc.d.ts +17 -0
  281. package/lib/steps/upgrade/twopointoh/frontend/misc.js +433 -0
  282. package/lib/steps/upgrade/twopointoh/infra.d.ts +10 -0
  283. package/lib/steps/upgrade/twopointoh/infra.js +51 -0
  284. package/lib/steps/upgrade/twopointoh/less.d.ts +12 -0
  285. package/lib/steps/upgrade/twopointoh/less.js +217 -0
  286. package/lib/utils/add-extenders.d.ts +2 -0
  287. package/lib/utils/add-extenders.js +115 -0
  288. package/lib/utils/ast.d.ts +22 -0
  289. package/lib/utils/ast.js +235 -0
  290. package/lib/utils/composer.d.ts +1 -1
  291. package/lib/utils/model-name.d.ts +1 -0
  292. package/lib/utils/model-name.js +7 -3
  293. package/lib/utils/monorepo.d.ts +2 -2
  294. package/lib/utils/validation.d.ts +4 -1
  295. package/lib/utils/validation.js +9 -0
  296. package/oclif.manifest.json +1 -1
  297. package/package.json +20 -13
  298. package/php-subsystem/composer.json +3 -1
  299. package/php-subsystem/composer.lock +13 -11
  300. package/php-subsystem/index.php +41 -6
  301. package/php-subsystem/src/CustomPrettyPrinter.php +1 -1
  302. package/php-subsystem/src/ExtenderUtil.php +7 -13
  303. package/php-subsystem/src/NodeUtil.php +72 -0
  304. package/php-subsystem/src/NodeVisitors/AddExtender.php +28 -12
  305. package/php-subsystem/src/NodeVisitors/AddUses.php +24 -0
  306. package/php-subsystem/src/NodeVisitors/ChangeSignatures.php +200 -0
  307. package/php-subsystem/src/NodeVisitors/ReplaceUses.php +175 -0
  308. package/php-subsystem/src/Upgrade/Replacement.php +51 -0
  309. package/php-subsystem/src/Upgrade/ReplacementResult.php +17 -0
  310. package/php-subsystem/src/Upgrade/TwoPointOh/EmailViews.php +94 -0
  311. package/php-subsystem/src/Upgrade/TwoPointOh/Filesystem.php +88 -0
  312. package/php-subsystem/src/Upgrade/TwoPointOh/InterventionImage.php +86 -0
  313. package/php-subsystem/src/Upgrade/TwoPointOh/JsonApi.php +186 -0
  314. package/php-subsystem/src/Upgrade/TwoPointOh/Misc.php +584 -0
  315. package/php-subsystem/src/Upgrade/TwoPointOh/PhpUnit.php +241 -0
  316. package/php-subsystem/src/Upgrade/TwoPointOh/Search.php +589 -0
  317. package/php-subsystem/vendor/autoload.php +18 -0
  318. package/php-subsystem/vendor/bin/php-parse +119 -0
  319. package/php-subsystem/vendor/composer/ClassLoader.php +166 -32
  320. package/php-subsystem/vendor/composer/InstalledVersions.php +350 -209
  321. package/php-subsystem/vendor/composer/autoload_classmap.php +1 -1
  322. package/php-subsystem/vendor/composer/autoload_namespaces.php +1 -1
  323. package/php-subsystem/vendor/composer/autoload_psr4.php +1 -1
  324. package/php-subsystem/vendor/composer/autoload_real.php +3 -22
  325. package/php-subsystem/vendor/composer/installed.json +12 -10
  326. package/php-subsystem/vendor/composer/installed.php +29 -30
  327. package/php-subsystem/vendor/composer/platform_check.php +2 -2
  328. package/php-subsystem/vendor/nikic/php-parser/README.md +74 -62
  329. package/php-subsystem/vendor/nikic/php-parser/bin/php-parse +12 -11
  330. package/php-subsystem/vendor/nikic/php-parser/composer.json +6 -4
  331. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +58 -11
  332. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php +54 -25
  333. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +11 -4
  334. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +87 -0
  335. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +116 -0
  336. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +8 -9
  337. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php +22 -5
  338. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +26 -7
  339. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php +31 -13
  340. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +5 -5
  341. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +69 -26
  342. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +47 -18
  343. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +6 -5
  344. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +25 -28
  345. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +31 -8
  346. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php +8 -8
  347. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder.php +2 -3
  348. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +85 -70
  349. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +119 -71
  350. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php +1 -2
  351. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Comment.php +35 -67
  352. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +3 -3
  353. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +17 -9
  354. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Error.php +24 -33
  355. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +6 -9
  356. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +2 -3
  357. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php +2 -3
  358. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +11 -7
  359. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php +36 -22
  360. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +24 -14
  361. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php +237 -0
  362. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +63 -69
  363. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +15 -10
  364. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +74 -92
  365. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +11 -18
  366. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +10 -15
  367. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +45 -0
  368. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +19 -25
  369. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +6 -10
  370. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +22 -29
  371. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +31 -0
  372. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +31 -0
  373. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +6 -5
  374. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +10 -5
  375. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +70 -491
  376. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php +69 -0
  377. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NameContext.php +23 -24
  378. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +13 -14
  379. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php +43 -0
  380. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php +9 -10
  381. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +5 -7
  382. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php +36 -0
  383. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +13 -0
  384. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php +12 -13
  385. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php +37 -0
  386. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +10 -11
  387. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +1 -39
  388. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +11 -11
  389. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +35 -30
  390. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +9 -10
  391. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +2 -3
  392. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +2 -3
  393. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +2 -3
  394. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +2 -3
  395. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +2 -3
  396. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +2 -3
  397. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +2 -3
  398. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +2 -3
  399. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +2 -3
  400. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +2 -3
  401. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +2 -3
  402. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +2 -3
  403. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +2 -3
  404. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +7 -8
  405. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +9 -10
  406. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +4 -5
  407. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +4 -5
  408. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +4 -5
  409. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +4 -5
  410. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +4 -5
  411. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +4 -5
  412. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +4 -5
  413. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +4 -5
  414. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +4 -5
  415. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +4 -5
  416. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +4 -5
  417. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +4 -5
  418. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +4 -5
  419. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +4 -5
  420. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +4 -5
  421. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +4 -5
  422. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +4 -5
  423. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +4 -5
  424. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +4 -5
  425. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +4 -5
  426. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +4 -5
  427. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +4 -5
  428. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +4 -5
  429. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +4 -5
  430. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +4 -5
  431. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +4 -5
  432. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +4 -5
  433. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +8 -11
  434. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +7 -8
  435. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +7 -8
  436. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +35 -0
  437. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +2 -3
  438. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +2 -3
  439. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +5 -6
  440. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +2 -3
  441. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +2 -3
  442. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +2 -3
  443. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +2 -3
  444. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +5 -6
  445. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +12 -12
  446. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +7 -8
  447. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +34 -27
  448. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +1 -32
  449. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +7 -8
  450. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +7 -8
  451. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +5 -6
  452. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +7 -8
  453. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +7 -8
  454. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +10 -11
  455. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +15 -12
  456. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +13 -14
  457. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +11 -11
  458. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +7 -8
  459. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +12 -8
  460. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +8 -7
  461. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +18 -13
  462. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +17 -12
  463. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +18 -13
  464. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +10 -10
  465. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +7 -8
  466. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +7 -8
  467. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +6 -7
  468. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +7 -8
  469. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +7 -8
  470. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +10 -10
  471. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +9 -9
  472. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +19 -14
  473. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +11 -11
  474. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +12 -13
  475. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +6 -7
  476. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +7 -8
  477. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +7 -8
  478. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +6 -7
  479. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +7 -8
  480. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +10 -11
  481. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php +1 -2
  482. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +6 -9
  483. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php +13 -13
  484. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php +32 -0
  485. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +27 -0
  486. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +8 -9
  487. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +8 -9
  488. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +8 -9
  489. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +80 -53
  490. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +10 -11
  491. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +47 -23
  492. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php +37 -0
  493. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +1 -68
  494. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +1 -29
  495. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +1 -28
  496. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php +78 -0
  497. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php +82 -0
  498. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php +34 -0
  499. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +1 -71
  500. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +4 -5
  501. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +4 -5
  502. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +4 -5
  503. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +4 -5
  504. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +4 -5
  505. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +4 -5
  506. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +4 -5
  507. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +4 -5
  508. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +4 -5
  509. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +44 -24
  510. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php +1 -2
  511. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php +39 -0
  512. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php +29 -0
  513. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +8 -9
  514. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +10 -11
  515. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +11 -12
  516. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +33 -27
  517. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +15 -15
  518. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +66 -71
  519. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +48 -61
  520. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +7 -8
  521. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +8 -9
  522. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +1 -32
  523. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +12 -12
  524. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +9 -10
  525. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +7 -8
  526. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +9 -10
  527. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +7 -8
  528. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +11 -12
  529. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +17 -13
  530. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +7 -8
  531. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +7 -8
  532. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +19 -15
  533. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +20 -17
  534. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +31 -27
  535. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +7 -8
  536. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +7 -8
  537. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +16 -14
  538. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +7 -8
  539. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +18 -15
  540. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +7 -8
  541. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +13 -10
  542. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +7 -8
  543. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +11 -12
  544. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +4 -5
  545. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +35 -36
  546. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +1 -32
  547. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +8 -9
  548. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +1 -35
  549. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +8 -8
  550. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +9 -10
  551. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +8 -9
  552. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +12 -13
  553. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +9 -10
  554. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +3 -4
  555. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +10 -8
  556. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +11 -12
  557. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +7 -8
  558. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +1 -50
  559. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +16 -16
  560. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +9 -10
  561. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php +1 -2
  562. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +8 -11
  563. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php +55 -0
  564. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +2 -3
  565. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +27 -0
  566. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node.php +24 -29
  567. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +20 -20
  568. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +169 -82
  569. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php +28 -19
  570. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +71 -84
  571. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +4 -7
  572. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +1 -2
  573. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php +82 -0
  574. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +4 -5
  575. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +6 -7
  576. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +40 -24
  577. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +2 -3
  578. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +8 -11
  579. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php +59 -7
  580. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +1 -2
  581. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2011 -2058
  582. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php +2717 -0
  583. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser.php +9 -3
  584. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +466 -248
  585. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +31 -33
  586. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php +164 -0
  587. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +419 -338
  588. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php +51 -0
  589. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +587 -431
  590. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Token.php +18 -0
  591. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php +63 -0
  592. package/boilerplate/stubs/backend/api-controller/create.php +0 -53
  593. package/boilerplate/stubs/backend/api-controller/delete.php +0 -52
  594. package/boilerplate/stubs/backend/api-controller/list.php +0 -61
  595. package/boilerplate/stubs/backend/api-controller/normal.php +0 -29
  596. package/boilerplate/stubs/backend/api-controller/show.php +0 -48
  597. package/boilerplate/stubs/backend/api-controller/update.php +0 -54
  598. package/boilerplate/stubs/backend/api-serializer.php +0 -36
  599. package/lib/commands/make/backend/api-controller.js +0 -26
  600. package/lib/commands/make/backend/api-serializer-attributes.js +0 -14
  601. package/lib/commands/make/backend/api-serializer.js +0 -15
  602. package/lib/steps/extenders/api-serializer.js +0 -77
  603. package/lib/steps/stubs/backend/api-controller.js +0 -65
  604. package/lib/steps/stubs/frontend/migration.js +0 -1
  605. package/php-subsystem/vendor/nikic/php-parser/.editorconfig +0 -9
  606. package/php-subsystem/vendor/nikic/php-parser/grammar/README.md +0 -27
  607. package/php-subsystem/vendor/nikic/php-parser/grammar/parser.template +0 -106
  608. package/php-subsystem/vendor/nikic/php-parser/grammar/php5.y +0 -1026
  609. package/php-subsystem/vendor/nikic/php-parser/grammar/php7.y +0 -1152
  610. package/php-subsystem/vendor/nikic/php-parser/grammar/phpyLang.php +0 -192
  611. package/php-subsystem/vendor/nikic/php-parser/grammar/rebuildParsers.php +0 -81
  612. package/php-subsystem/vendor/nikic/php-parser/grammar/tokens.template +0 -17
  613. package/php-subsystem/vendor/nikic/php-parser/grammar/tokens.y +0 -115
  614. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +0 -47
  615. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +0 -76
  616. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +0 -23
  617. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +0 -105
  618. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +0 -30
  619. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +0 -55
  620. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +0 -2630
  621. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +0 -145
  622. /package/{lib/steps/stubs/frontend/migration.d.ts → boilerplate/skeleton/extension/js/tests/integration/.gitkeep} +0 -0
  623. /package/boilerplate/skeleton/extension/js/{webpack.config.js → webpack.config.cjs} +0 -0
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeneratePostTypeStub = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const validation_1 = require("../../../utils/validation");
6
+ const js_base_1 = require("../js-base");
7
+ const string_1 = tslib_1.__importDefault(require("string"));
8
+ class GeneratePostTypeStub extends js_base_1.BaseJsStubStep {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.type = 'Generate a new post type component';
12
+ this.additionalExposes = ['frontend', 'classNamespace', 'postType'];
13
+ this.schema = {
14
+ recommendedSubdir: 'forum/components',
15
+ sourceFile: 'frontend/post-type.js',
16
+ params: [
17
+ {
18
+ name: 'className',
19
+ type: 'text',
20
+ message: 'Post Type class name',
21
+ validate: validation_1.Validator.className,
22
+ },
23
+ {
24
+ name: 'classNamespace',
25
+ type: 'text',
26
+ message: 'Class Namespace',
27
+ },
28
+ {
29
+ name: 'postType',
30
+ message: 'Notification type',
31
+ type: 'text',
32
+ initial: (_prev, params) => {
33
+ return (0, string_1.default)(params.get('className'))
34
+ .underscore()
35
+ .toString()
36
+ .replace(/_post$/, '');
37
+ },
38
+ },
39
+ ],
40
+ };
41
+ }
42
+ async precompileParams(fs, paths, io) {
43
+ const params = await super.precompileParams(fs, paths, io);
44
+ params.frontend = 'forum';
45
+ return params;
46
+ }
47
+ }
48
+ exports.GeneratePostTypeStub = GeneratePostTypeStub;
@@ -16,12 +16,16 @@ class BaseJsStubStep extends flarum_base_1.FlarumBaseStubStep {
16
16
  }
17
17
  async precompileParams(fs, paths, io) {
18
18
  const params = await super.precompileParams(fs, paths, io);
19
+ io.pushCache(params);
19
20
  const paramDefs = this.schema.params.filter((param) => !this.implicitParams.includes(param.name));
20
21
  this.subdir =
21
22
  this.schema.forceRecommendedSubdir || paths.requestedDir() === null
22
23
  ? this.schema.recommendedSubdir
23
24
  : paths.requestedDir().slice(`${paths.package('js/src')}/`.length);
24
- params.frontend = await io.getParam(paramDefs.find((param) => param.name === 'frontend'));
25
+ const frontendParamDef = paramDefs.find((param) => param.name === 'frontend');
26
+ if (frontendParamDef) {
27
+ params.frontend = await io.getParam(frontendParamDef);
28
+ }
25
29
  params.className = await io.getParam(paramDefs.find((param) => param.name === 'className'));
26
30
  this.subdir = (0, clone_and_fill_1.cloneAndFill)(this.subdir, params);
27
31
  params.classNamespace = `${this.subdir}/${params.className}`;
@@ -15,7 +15,9 @@ class BasePhpStubStep extends flarum_base_1.FlarumBaseStubStep {
15
15
  return [...super.implicitParams, 'classNamespace'];
16
16
  }
17
17
  async precompileParams(fs, paths, io) {
18
+ var _a;
18
19
  const params = Object.assign(Object.assign({}, (await super.precompileParams(fs, paths, io))), { classNamespace: this.stubNamespace(await this.scaffolder.templateParamVal('packageNamespace', fs, paths, io), paths) });
20
+ io.pushCache(params);
19
21
  let paramDefs = this.schema.params.filter((param) => !this.implicitParams.includes(param.name));
20
22
  const classParams = [...this.phpClassParams];
21
23
  const classNameParam = paramDefs.find((param) => param.name === 'className');
@@ -34,7 +36,7 @@ class BasePhpStubStep extends flarum_base_1.FlarumBaseStubStep {
34
36
  }
35
37
  // eslint-disable-next-line no-await-in-loop
36
38
  params[classParam] = await io.getParam(paramDef);
37
- params[`${classParam}Name`] = params[classParam].split('\\').pop();
39
+ params[`${classParam}Name`] = (_a = params[classParam]) === null || _a === void 0 ? void 0 : _a.split('\\').pop();
38
40
  paramDefs = paramDefs.filter((param) => param.name !== classParam && param.name !== `${classParam}Name`);
39
41
  }
40
42
  return params;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateJSImports = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const globby_1 = (0, tslib_1.__importDefault)(require("globby"));
5
+ const globby_1 = tslib_1.__importDefault(require("globby"));
6
6
  const mem_fs_editor_1 = require("mem-fs-editor");
7
7
  const CORE_JS_NAMESPACES = ['admin', 'common', 'forum'];
8
8
  const CORE_NAMESPACE_REGEX = new RegExp(`^(${CORE_JS_NAMESPACES.join('|')})/`);
@@ -0,0 +1,18 @@
1
+ import { BaseUpgradeStep, GitCommit, Replacement } from '../base';
2
+ export default class EmailViews extends BaseUpgradeStep {
3
+ type: string;
4
+ protected collected: {
5
+ [file: string]: {
6
+ html: string;
7
+ text: string;
8
+ };
9
+ };
10
+ protected templates: {
11
+ html: string;
12
+ text: string;
13
+ };
14
+ replacements(file: string): Replacement[];
15
+ targets(): string[];
16
+ gitCommit(): GitCommit;
17
+ pauseMessage(): string;
18
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const ejs_1 = tslib_1.__importDefault(require("ejs"));
5
+ const base_1 = require("../base");
6
+ class EmailViews extends base_1.BaseUpgradeStep {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.type = 'Email notifications now require both Plain Text and HTML views.';
10
+ this.collected = {};
11
+ this.templates = {
12
+ html: '/../../../../../boilerplate/stubs/views/email/html/notification.blade.php',
13
+ text: '/../../../../../boilerplate/stubs/views/email/plain/notification.blade.php',
14
+ };
15
+ }
16
+ replacements(file) {
17
+ if (!file.endsWith('.php'))
18
+ return [];
19
+ return [
20
+ async (file, code) => {
21
+ if (!code.includes('MailableInterface')) {
22
+ return null;
23
+ }
24
+ const output = this.php.run('upgrade.2-0.email-views', { file, code });
25
+ this.collected[file] = output.collected;
26
+ return {
27
+ updated: output.code,
28
+ };
29
+ },
30
+ async (file, code) => {
31
+ if (Object.keys(this.collected).length === 0)
32
+ return null;
33
+ const fileName = file.split('/').pop();
34
+ const newFiles = [];
35
+ Object.keys(this.collected).forEach((classFile) => {
36
+ if (!this.collected[classFile]) {
37
+ return;
38
+ }
39
+ if (!this.collected[classFile].html && !this.collected[classFile].text) {
40
+ return;
41
+ }
42
+ // if there is a text view but no html view, use the same content for both.
43
+ // same for html view but no text view.
44
+ ['text', 'html'].forEach((view) => {
45
+ const viewType = view;
46
+ const viewPath = this.collected[classFile][viewType] || this.collected[classFile][viewType === 'html' ? 'text' : 'html'];
47
+ const viewFileName = viewPath.split('::')[1].split('.').pop();
48
+ if (fileName === `${viewFileName}.blade.php`) {
49
+ const templateContent = this.fsEditor.read(__dirname + this.templates[viewType]);
50
+ const viewTypePath = viewType === 'text' ? 'plain' : 'html';
51
+ newFiles.push({
52
+ path: file.split('/views/')[0] + '/views/email/' + viewTypePath + '/' + viewFileName + '.blade.php',
53
+ code: ejs_1.default.render(templateContent, { content: code.trimEnd() }),
54
+ });
55
+ }
56
+ });
57
+ });
58
+ return {
59
+ updated: code,
60
+ delete: newFiles.length > 0,
61
+ newFiles,
62
+ };
63
+ },
64
+ ];
65
+ }
66
+ targets() {
67
+ return ['src/**/*', 'views/**/*.blade.php', 'resources/views/**/*.blade.php'];
68
+ }
69
+ gitCommit() {
70
+ return {
71
+ message: 'chore(2.0): notification emails now require both plain text and HTML views',
72
+ description: 'You now need to provide both plain text and HTML views for notification emails.',
73
+ };
74
+ }
75
+ pauseMessage() {
76
+ return `Flarum 2.0 requires both plain text and HTML views for notification emails.
77
+ The upgrader has attempted to convert your email views to include both.
78
+ Please review the changes and ensure that both views are present. Then proceed.`;
79
+ }
80
+ }
81
+ exports.default = EmailViews;
@@ -0,0 +1,8 @@
1
+ import { BaseUpgradeStep, GitCommit, Replacement } from '../base';
2
+ export default class Filesystem extends BaseUpgradeStep {
3
+ type: string;
4
+ replacements(file: string): Replacement[];
5
+ targets(): string[];
6
+ gitCommit(): GitCommit;
7
+ pauseMessage(): string;
8
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = require("../base");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ class Filesystem extends base_1.BaseUpgradeStep {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.type = 'Filesystem dependencies changes.';
10
+ }
11
+ replacements(file) {
12
+ if (!file.endsWith('.php'))
13
+ return [];
14
+ return [
15
+ (file, code) => ({
16
+ updated: this.php.run('upgrade.2-0.filesystem', { file, code }).code,
17
+ }),
18
+ ];
19
+ }
20
+ targets() {
21
+ return ['extend.php', 'src/**/*'];
22
+ }
23
+ gitCommit() {
24
+ return {
25
+ message: 'chore(2.0): filesystem changes',
26
+ description: 'Flysystem 3.x changes',
27
+ };
28
+ }
29
+ pauseMessage() {
30
+ const link = 'https://docs.flarum.org/2.x/extend/update-2_0#flysystem-updated-from-1x-to-3x';
31
+ const readMore = chalk_1.default.dim(`Read more: ${link}`);
32
+ const otherLink = 'https://flysystem.thephpleague.com/docs/upgrade-from-1.x/';
33
+ const otherReadMore = chalk_1.default.dim(`For more details, read the Flysystem 1.x to V2 & V3 upgrade guide: ${otherLink}`);
34
+ return `Flarum 2.0 uses Flysystem 3.x. The tool has attempted to update your code accordingly.
35
+ Some filesystem methods have been renamed or removed. Please review the changes and ensure everything is correct.
36
+ ${readMore}
37
+ ${otherReadMore}`;
38
+ }
39
+ }
40
+ exports.default = Filesystem;
@@ -0,0 +1,8 @@
1
+ import { BaseUpgradeStep, GitCommit, Replacement } from '../base';
2
+ export default class InterventionImage extends BaseUpgradeStep {
3
+ type: string;
4
+ replacements(file: string): Replacement[];
5
+ targets(): string[];
6
+ gitCommit(): GitCommit;
7
+ pauseMessage(): string;
8
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = require("../base");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ class InterventionImage extends base_1.BaseUpgradeStep {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.type = 'Intervention Image Library v3';
10
+ }
11
+ replacements(file) {
12
+ if (!file.endsWith('.php'))
13
+ return [];
14
+ return [
15
+ (file, code) => ({
16
+ updated: this.php.run('upgrade.2-0.intervention-image', { file, code }).code,
17
+ }),
18
+ ];
19
+ }
20
+ targets() {
21
+ return ['src/**/*'];
22
+ }
23
+ gitCommit() {
24
+ return {
25
+ message: 'chore(2.0): `intervention/image` v3 changes',
26
+ description: 'Intervention Image Library v3 changes',
27
+ };
28
+ }
29
+ pauseMessage() {
30
+ const link = 'https://docs.flarum.org/2.x/extend/update-2_0#intervention-image-v3';
31
+ const readMore = chalk_1.default.dim(`Read more: ${link}`);
32
+ const otherLink = 'https://image.intervention.io/v3/introduction/upgrade';
33
+ const otherReadMore = chalk_1.default.dim(`For more details, read the library's v3 upgrade guide: ${otherLink}`);
34
+ const additionalLink = 'https://github.com/flarum/framework/pull/3947/files';
35
+ const additionalReadMore = chalk_1.default.dim(`Additionally, you can see the changes made to the core code here: ${additionalLink}`);
36
+ return `Flarum 2.0 uses intervention/image v3. The tool cannot automatically update your code to the new version.
37
+ Comments have been added where changes are needed. You should make these changes now, then test and adapt your code once the upgrade process is over.
38
+ ${readMore}
39
+ ${otherReadMore}
40
+
41
+ ${additionalReadMore}`;
42
+ }
43
+ }
44
+ exports.default = InterventionImage;
@@ -0,0 +1,12 @@
1
+ import { AdvancedContent, BaseUpgradeStep, GitCommit, Replacement } from '../base';
2
+ export default class JsonApi extends BaseUpgradeStep {
3
+ type: string;
4
+ beforeHook: boolean;
5
+ protected modelEndpoints: Record<string, any>;
6
+ protected models: Record<string, any>;
7
+ before(file: string, code: string, _advanced: AdvancedContent): void;
8
+ replacements(file: string): Replacement[];
9
+ targets(): string[];
10
+ gitCommit(): GitCommit;
11
+ pauseMessage(): string;
12
+ }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = require("../base");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const gen_ext_scaffolder_1 = require("../../../gen-ext-scaffolder");
7
+ const api_resource_1 = require("../../../extenders/api-resource");
8
+ const step_manager_1 = require("boilersmith/step-manager");
9
+ const advanced_api_resource_1 = require("../../../stubs/backend/advanced-api-resource");
10
+ class JsonApi extends base_1.BaseUpgradeStep {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.type = 'Prepare for JSON:API changes.';
14
+ this.beforeHook = true;
15
+ this.modelEndpoints = {};
16
+ this.models = {};
17
+ }
18
+ before(file, code, _advanced) {
19
+ var _a, _b;
20
+ var _c;
21
+ // files with the patterns CreateXController, DeleteXController, ListXController, ShowXController, UpdateXController
22
+ const matches = file.match(/(Create|Delete|List|Show|Update)([A-Z][A-z]+)+Controller\.php/);
23
+ if (matches) {
24
+ let model = matches[2];
25
+ if (matches[1].startsWith('List')) {
26
+ model = model.endsWith('ies') ? model.slice(0, -3) + 'y' : model.endsWith('s') ? model.slice(0, -1) : model;
27
+ }
28
+ (_a = (_c = this.modelEndpoints)[model]) !== null && _a !== void 0 ? _a : (_c[model] = []);
29
+ this.modelEndpoints[model].push(matches[1].toLowerCase());
30
+ return;
31
+ }
32
+ if ((code.includes(' extends AbstractModel') && code.includes('use Flarum\\Database\\AbstractModel')) ||
33
+ (code.includes(' extends Model') && code.includes('use Illuminate\\Database\\Eloquent\\Model'))) {
34
+ const className = file.split('/').pop().replace('.php', '');
35
+ const namespace = (_b = code.match(/namespace ([^;]+);/)) === null || _b === void 0 ? void 0 : _b[1];
36
+ this.models[className] = `${namespace}\\${className}`;
37
+ }
38
+ }
39
+ replacements(file) {
40
+ if (!file.endsWith('.php'))
41
+ return [];
42
+ let collected = null;
43
+ return [
44
+ async (file, code) => {
45
+ const output = this.php.run('upgrade.2-0.json-api', { file, code });
46
+ collected = output.collected;
47
+ return {
48
+ updated: output.code,
49
+ };
50
+ },
51
+ async (file) => {
52
+ var _a;
53
+ if (!collected)
54
+ return null;
55
+ if (file.endsWith('extend.php'))
56
+ return null;
57
+ if (Object.keys(collected).length > 0 && collected.serializer) {
58
+ const modelClassName = collected.model ? collected.model.split('\\').pop() : collected.serializer.replace('Serializer', '');
59
+ const predefinedParams = {
60
+ className: `${modelClassName}Resource`,
61
+ modelClass: collected.model || this.models[modelClassName],
62
+ modelType: collected.type,
63
+ endpoints: (_a = this.modelEndpoints[modelClassName]) !== null && _a !== void 0 ? _a : [],
64
+ relations: collected.relations,
65
+ };
66
+ const result = await this.command.runSteps(new step_manager_1.StepManager().silentGroup((steps) => {
67
+ steps
68
+ .namedStep('api-resource-stub', new advanced_api_resource_1.GenerateAdvancedApiResourceStub(this.command.STUB_PATH, (0, gen_ext_scaffolder_1.genExtScaffolder)()), {}, [], predefinedParams)
69
+ .step(new api_resource_1.GenerateApiResourceExtender(), {}, [
70
+ {
71
+ sourceStep: 'api-resource-stub',
72
+ exposedName: 'class',
73
+ consumedName: 'resourceClass',
74
+ },
75
+ ]);
76
+ }));
77
+ if (!result.succeeded) {
78
+ this.command.error(result.error);
79
+ }
80
+ }
81
+ return null;
82
+ },
83
+ ];
84
+ }
85
+ targets() {
86
+ return ['src/**/*', 'extend.php'];
87
+ }
88
+ gitCommit() {
89
+ return {
90
+ message: 'chore(2.0): JSON:API changes',
91
+ description: 'Flarum 2.0 completely changes the JSON:API implementation',
92
+ };
93
+ }
94
+ pauseMessage() {
95
+ const link = 'https://docs.flarum.org/2.x/extend/update-2_0#jsonapi';
96
+ const readMore = chalk_1.default.dim(`Read more: ${link}`);
97
+ const guideLink = 'https://docs.flarum.org/2.x/extend/update-2_0-api';
98
+ const exampleReadMore = chalk_1.default.dim(`Checkout our additional guide which provides concrete examples for the upgrading process of the JSON:API layer:`);
99
+ return `Flarum 2.0 completely refactors the JSON:API implementation. The way resource CRUD operations,
100
+ serialization and extending other resources is done has completely changed.
101
+
102
+ The tool cannot completely automate this change, but it has added some boilerplate code and TODO comments to help you get started.
103
+ You should make whatever changes you can now, then properly test and adapt your code once the upgrade process is over.
104
+
105
+ ${readMore}
106
+
107
+ ${exampleReadMore}
108
+ ${guideLink}`;
109
+ }
110
+ }
111
+ exports.default = JsonApi;
@@ -0,0 +1,8 @@
1
+ import { BaseUpgradeStep, GitCommit, Replacement } from '../base';
2
+ export default class Mailer extends BaseUpgradeStep {
3
+ type: string;
4
+ replacements(file: string): Replacement[];
5
+ targets(): string[];
6
+ gitCommit(): GitCommit;
7
+ pauseMessage(): string;
8
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = require("../base");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ class Mailer extends base_1.BaseUpgradeStep {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.type = 'Check for Swift mailer usage.';
10
+ }
11
+ replacements(file) {
12
+ if (!file.endsWith('.php'))
13
+ return [];
14
+ return [
15
+ (_file, code) => ({
16
+ updated: code.replace(/^(.*Swift_Mailer.*)$/gm, `$1 // TODO: Swift mailer was replaced with Symfony mailer`),
17
+ }),
18
+ ];
19
+ }
20
+ targets() {
21
+ return ['extend.php', 'src/**/*'];
22
+ }
23
+ gitCommit() {
24
+ return {
25
+ message: 'chore(2.0): swift mailer was replaced with symfony mailer',
26
+ description: 'Swift mailer was replaced with Symfony mailer',
27
+ };
28
+ }
29
+ pauseMessage() {
30
+ const link = 'https://symfony.com/doc/current/mailer.html';
31
+ const readMore = chalk_1.default.dim(`Read more: ${link}`);
32
+ return `Flarum 2.0 uses Symfony mailer instead of Swift mailer. TODO comments have been added to your code to indicate where Swift mailer is currently being used.
33
+ Update your code to use Symfony mailer instead. Then proceed. Or proceed now and update your code later.
34
+ ${readMore}`;
35
+ }
36
+ }
37
+ exports.default = Mailer;
@@ -0,0 +1,8 @@
1
+ import { BaseUpgradeStep, GitCommit, Replacement } from '../base';
2
+ export default class MiscBackendChanges extends BaseUpgradeStep {
3
+ type: string;
4
+ replacements(file: string): Replacement[];
5
+ targets(): string[];
6
+ gitCommit(): GitCommit;
7
+ pauseMessage(): string;
8
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = require("../base");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ class MiscBackendChanges extends base_1.BaseUpgradeStep {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.type = 'Miscellaneous backend changes.';
10
+ }
11
+ replacements(file) {
12
+ if (!file.endsWith('.php'))
13
+ return [];
14
+ return [
15
+ (file, code) => ({
16
+ updated: this.php.run('upgrade.2-0.misc', { file, code }).code,
17
+ }),
18
+ ];
19
+ }
20
+ targets() {
21
+ return ['extend.php', 'src/**/*'];
22
+ }
23
+ gitCommit() {
24
+ return {
25
+ message: 'chore(2.0): misc backend changes',
26
+ description: 'Miscellaneous backend changes',
27
+ };
28
+ }
29
+ pauseMessage() {
30
+ const link = 'https://docs.flarum.org/2.x/extend/update-2_0#miscellaneous-1';
31
+ const readMore = chalk_1.default.dim(`Read more: ${link}`);
32
+ const requiresManualChangeLink = 'https://laravel.com/docs/11.x/upgrade#modifying-columns';
33
+ return `Various breaking backend changes have been made in 2.0. The tool has attempted to update your code accordingly.
34
+ Please review the changes and ensure everything is correct.
35
+ ${readMore}
36
+
37
+ Additionally, check every reference to a column definition change in your migrations, and make sure
38
+ they are using the entire column definition. For more details, see:
39
+ ${chalk_1.default.underline(requiresManualChangeLink)}`;
40
+ }
41
+ }
42
+ exports.default = MiscBackendChanges;
@@ -0,0 +1,8 @@
1
+ import { BaseUpgradeStep, GitCommit, Replacement } from '../base';
2
+ export default class PhpUnit extends BaseUpgradeStep {
3
+ type: string;
4
+ replacements(file: string): Replacement[];
5
+ targets(): string[];
6
+ gitCommit(): GitCommit;
7
+ pauseMessage(): string;
8
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = require("../base");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ class PhpUnit extends base_1.BaseUpgradeStep {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.type = 'PHPUnit 9 to 11 changes';
10
+ }
11
+ replacements(file) {
12
+ if (!file.endsWith('.php'))
13
+ return [];
14
+ return [
15
+ (_file, code) => ({
16
+ updated: this.php.run('upgrade.2-0.phpunit', { file, code }).code,
17
+ }),
18
+ (file, code) => {
19
+ if (!file.endsWith('.xml'))
20
+ return null;
21
+ return {
22
+ updated: code.replace('xsi:noNamespaceSchemaLocation="([^"]+)"', 'xsi:noNamespaceSchemaLocation="../vendor/phpunit/phpunit/phpunit.xsd"'),
23
+ };
24
+ },
25
+ ];
26
+ }
27
+ targets() {
28
+ return ['tests/**/*'];
29
+ }
30
+ gitCommit() {
31
+ return {
32
+ message: 'chore(2.0): Backend tests + PHPUnit 9 to 11 changes',
33
+ description: 'Flarum 2.0 uses PHPUnit 11 and encourages use of model factories for easier cross-database testing.',
34
+ };
35
+ }
36
+ pauseMessage() {
37
+ const links = [
38
+ 'https://github.com/sebastianbergmann/phpunit/blob/9.6/DEPRECATIONS.md',
39
+ 'https://github.com/sebastianbergmann/phpunit/blob/10.5/DEPRECATIONS.md',
40
+ 'https://github.com/sebastianbergmann/phpunit/blob/11.3.0/DEPRECATIONS.md',
41
+ ];
42
+ const dbLink = 'http://localhost:3000/extend/testing#model-factories';
43
+ return `Flarum 2.0 uses PHPUnit 11. The tool has applied the most significant changes, but you might still run into other deprecations.
44
+ Please refer to the following links for more information:
45
+ ${links.map((link) => chalk_1.default.underline(link)).join('\n ')}
46
+
47
+ Additionally, Flarum 2.0 encourages the use of model factories when preparing data for tests, this simplifies cross-database testing
48
+ as PgSQL and SQLite are more strict about constraints.
49
+ ${chalk_1.default.underline(dbLink)}`;
50
+ }
51
+ }
52
+ exports.default = PhpUnit;
@@ -0,0 +1,28 @@
1
+ import { AdvancedContent, BaseUpgradeStep, GitCommit, Replacement } from '../base';
2
+ type Gambit = {
3
+ name: string;
4
+ pattern: string;
5
+ filterKey?: string;
6
+ filterFile: string;
7
+ };
8
+ export default class Search extends BaseUpgradeStep {
9
+ type: string;
10
+ beforeHook: boolean;
11
+ generatedFrontendStuff: boolean;
12
+ protected gambits: Gambit[];
13
+ protected data: {
14
+ collectedData: any;
15
+ replacements: {
16
+ from: string;
17
+ to: string;
18
+ }[];
19
+ filterClasses: string[];
20
+ };
21
+ protected searchers: Record<string, string>;
22
+ before(file: string, code: string, _advanced: AdvancedContent): void;
23
+ replacements(_file: string): Replacement[];
24
+ targets(): string[];
25
+ gitCommit(): GitCommit;
26
+ pauseMessage(): string;
27
+ }
28
+ export {};