@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.
- package/LICENSE +1 -1
- package/README.md +40 -22
- package/boilerplate/skeleton/extension/.github/workflows/backend.yml +1 -1
- package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +2 -1
- package/boilerplate/skeleton/extension/.github/workflows/phpstan.yml +12 -0
- package/boilerplate/skeleton/extension/composer.json +8 -4
- package/boilerplate/skeleton/extension/gitignore +1 -0
- package/boilerplate/skeleton/extension/js/jest.config.cjs +1 -0
- package/boilerplate/skeleton/extension/js/package.json +6 -3
- package/boilerplate/skeleton/extension/js/src/admin/extend.js +8 -0
- package/boilerplate/skeleton/extension/js/src/admin/extend.ts +8 -0
- package/boilerplate/skeleton/extension/js/src/admin/index.js +2 -0
- package/boilerplate/skeleton/extension/js/src/admin/index.ts +3 -1
- package/boilerplate/skeleton/extension/js/src/common/extend.js +5 -0
- package/boilerplate/skeleton/extension/js/src/common/extend.ts +5 -0
- package/boilerplate/skeleton/extension/js/src/common/index.ts +1 -1
- package/boilerplate/skeleton/extension/js/src/forum/extend.js +8 -0
- package/boilerplate/skeleton/extension/js/src/forum/extend.ts +8 -0
- package/boilerplate/skeleton/extension/js/src/forum/index.js +2 -0
- package/boilerplate/skeleton/extension/js/src/forum/index.ts +3 -1
- package/boilerplate/skeleton/extension/js/tests/unit/.gitkeep +0 -0
- package/boilerplate/skeleton/extension/js/tsconfig.test.json +10 -0
- package/boilerplate/skeleton/extension/locale/en.yml +1 -1
- package/boilerplate/skeleton/extension/phpstan.neon +12 -0
- package/boilerplate/skeleton/extension/tests/phpunit.integration.xml +5 -7
- package/boilerplate/skeleton/extension/tests/phpunit.unit.xml +5 -10
- package/boilerplate/stubs/backend/advanced-api-resource.php +85 -0
- package/boilerplate/stubs/backend/api-resource.php +73 -0
- package/boilerplate/stubs/backend/command.php +2 -2
- package/boilerplate/stubs/backend/controller.php +19 -0
- package/boilerplate/stubs/backend/event-listener.php +1 -1
- package/boilerplate/stubs/backend/filter.php +25 -0
- package/boilerplate/stubs/backend/handler/command.php +6 -20
- package/boilerplate/stubs/backend/handler/handler.php +6 -14
- package/boilerplate/stubs/backend/integration-test.php +10 -7
- package/boilerplate/stubs/backend/job.php +6 -11
- package/boilerplate/stubs/backend/mail-driver.php +36 -0
- package/boilerplate/stubs/backend/middleware.php +19 -0
- package/boilerplate/stubs/backend/model.php +1 -1
- package/boilerplate/stubs/backend/notification-blueprint.php +42 -0
- package/boilerplate/stubs/backend/notification-driver.php +32 -0
- package/boilerplate/stubs/backend/policy.php +1 -1
- package/boilerplate/stubs/backend/post-type.php +35 -0
- package/boilerplate/stubs/backend/repository.php +2 -10
- package/boilerplate/stubs/backend/search/driver.php +13 -0
- package/boilerplate/stubs/backend/search/searcher.php +41 -0
- package/boilerplate/stubs/backend/service-provider.php +1 -1
- package/boilerplate/stubs/backend/validator.php +1 -1
- package/boilerplate/stubs/frontend/component.js +1 -1
- package/boilerplate/stubs/frontend/forum-page.js +68 -0
- package/boilerplate/stubs/frontend/gambit/boolean.js +12 -0
- package/boilerplate/stubs/frontend/gambit/key-value.js +16 -0
- package/boilerplate/stubs/frontend/modal.js +1 -1
- package/boilerplate/stubs/frontend/model.js +1 -1
- package/boilerplate/stubs/frontend/notification.js +22 -0
- package/boilerplate/stubs/frontend/post-type.js +13 -0
- package/boilerplate/stubs/migration.php +1 -1
- package/boilerplate/stubs/views/email/html/information.blade.php +8 -0
- package/boilerplate/stubs/views/email/html/notification.blade.php +8 -0
- package/boilerplate/stubs/views/email/plain/information.blade.php +7 -0
- package/boilerplate/stubs/views/email/plain/notification.blade.php +6 -0
- package/lib/base-command.d.ts +19 -5
- package/lib/base-command.js +73 -28
- package/lib/boilersmith/io.d.ts +9 -7
- package/lib/boilersmith/io.js +28 -15
- package/lib/boilersmith/paths.d.ts +1 -1
- package/lib/boilersmith/scaffolding/audit-step-factory.js +1 -1
- package/lib/boilersmith/scaffolding/module.d.ts +4 -4
- package/lib/boilersmith/scaffolding/module.js +6 -6
- package/lib/boilersmith/scaffolding/scaffolder.d.ts +1 -1
- package/lib/boilersmith/scaffolding/scaffolder.js +1 -1
- package/lib/boilersmith/scaffolding/template-param.d.ts +1 -1
- package/lib/boilersmith/step-manager.d.ts +15 -10
- package/lib/boilersmith/step-manager.js +35 -9
- package/lib/boilersmith/steps/stub-base.js +1 -1
- package/lib/boilersmith/utils/json-leaf-paths.d.ts +2 -2
- package/lib/commands/audit/infra.d.ts +1 -4
- package/lib/commands/audit/infra.js +1 -1
- package/lib/commands/flarum/change.js +2 -2
- package/lib/commands/flarum/info.js +1 -1
- package/lib/commands/infra.d.ts +1 -9
- package/lib/commands/infra.js +2 -2
- package/lib/commands/init.d.ts +1 -4
- package/lib/commands/init.js +3 -3
- package/lib/commands/make/backend/{api-serializer.d.ts → api-resource.d.ts} +2 -5
- package/lib/commands/make/backend/api-resource.js +26 -0
- package/lib/commands/make/backend/command.d.ts +1 -4
- package/lib/commands/make/backend/command.js +2 -2
- package/lib/commands/make/backend/{api-controller.d.ts → controller.d.ts} +2 -5
- package/lib/commands/make/backend/controller.js +31 -0
- package/lib/commands/make/backend/event-listener.d.ts +1 -4
- package/lib/commands/make/backend/event-listener.js +1 -1
- package/lib/commands/make/backend/{api-serializer-attributes.d.ts → filter.d.ts} +3 -6
- package/lib/commands/make/backend/filter.js +26 -0
- package/lib/commands/make/backend/handler.d.ts +2 -5
- package/lib/commands/make/backend/handler.js +6 -6
- package/lib/commands/make/backend/integration-test.d.ts +1 -4
- package/lib/commands/make/backend/integration-test.js +2 -2
- package/lib/commands/make/backend/job.d.ts +1 -4
- package/lib/commands/make/backend/job.js +2 -2
- package/lib/commands/make/backend/mail-driver.d.ts +12 -0
- package/lib/commands/make/backend/mail-driver.js +29 -0
- package/lib/commands/make/backend/middleware.d.ts +11 -0
- package/lib/commands/make/backend/middleware.js +26 -0
- package/lib/commands/make/backend/migration.d.ts +1 -4
- package/lib/commands/make/backend/migration.js +9 -2
- package/lib/commands/make/backend/model.d.ts +6 -7
- package/lib/commands/make/backend/model.js +68 -447
- package/lib/commands/make/backend/notification-blueprint.d.ts +12 -0
- package/lib/commands/make/backend/notification-blueprint.js +29 -0
- package/lib/commands/make/backend/notification-driver.d.ts +12 -0
- package/lib/commands/make/backend/notification-driver.js +29 -0
- package/lib/commands/make/backend/policy.d.ts +1 -4
- package/lib/commands/make/backend/policy.js +1 -1
- package/lib/commands/make/backend/post-type.d.ts +12 -0
- package/lib/commands/make/backend/post-type.js +29 -0
- package/lib/commands/make/backend/repository.d.ts +1 -4
- package/lib/commands/make/backend/repository.js +1 -1
- package/lib/commands/make/backend/route.d.ts +1 -4
- package/lib/commands/make/backend/route.js +1 -1
- package/lib/commands/make/backend/search-driver.d.ts +11 -0
- package/lib/commands/make/backend/search-driver.js +51 -0
- package/lib/commands/make/backend/service-provider.d.ts +1 -4
- package/lib/commands/make/backend/service-provider.js +2 -2
- package/lib/commands/make/backend/validator.d.ts +1 -4
- package/lib/commands/make/backend/validator.js +2 -2
- package/lib/commands/make/frontend/component.d.ts +4 -5
- package/lib/commands/make/frontend/component.js +7 -2
- package/lib/commands/make/frontend/forum-page.d.ts +11 -0
- package/lib/commands/make/frontend/forum-page.js +92 -0
- package/lib/commands/make/frontend/gambit.d.ts +11 -0
- package/lib/commands/make/frontend/gambit.js +30 -0
- package/lib/commands/make/frontend/modal.d.ts +1 -4
- package/lib/commands/make/frontend/modal.js +3 -2
- package/lib/commands/make/frontend/model.d.ts +6 -7
- package/lib/commands/make/frontend/model.js +26 -24
- package/lib/commands/make/frontend/notification.d.ts +12 -0
- package/lib/commands/make/frontend/notification.js +62 -0
- package/lib/commands/make/frontend/post-type.d.ts +12 -0
- package/lib/commands/make/frontend/post-type.js +59 -0
- package/lib/commands/make/locale.d.ts +11 -0
- package/lib/commands/make/locale.js +27 -0
- package/lib/commands/make/model.d.ts +12 -0
- package/lib/commands/make/model.js +29 -0
- package/lib/commands/make/notification.d.ts +11 -0
- package/lib/commands/make/notification.js +33 -0
- package/lib/commands/make/post-type.d.ts +11 -0
- package/lib/commands/make/post-type.js +31 -0
- package/lib/commands/monorepo/create.d.ts +1 -4
- package/lib/commands/monorepo/create.js +1 -1
- package/lib/commands/monorepo/split.d.ts +1 -4
- package/lib/commands/monorepo/split.js +1 -1
- package/lib/commands/update/js-imports.d.ts +1 -4
- package/lib/commands/update/js-imports.js +1 -1
- package/lib/commands/upgrade/2.0.d.ts +17 -0
- package/lib/commands/upgrade/2.0.js +113 -0
- package/lib/help.js +1 -1
- package/lib/providers/php-provider.d.ts +7 -1
- package/lib/providers/php-provider.js +16 -3
- package/lib/steps/extenders/{api-serializer.d.ts → api-resource.d.ts} +1 -1
- package/lib/steps/extenders/api-resource.js +38 -0
- package/lib/steps/extenders/base.d.ts +1 -1
- package/lib/steps/extenders/base.js +13 -1
- package/lib/steps/extenders/console-command.js +1 -1
- package/lib/steps/extenders/event.js +1 -1
- package/lib/steps/extenders/mail-driver.d.ts +5 -0
- package/lib/steps/extenders/mail-driver.js +58 -0
- package/lib/steps/extenders/middleware.d.ts +5 -0
- package/lib/steps/extenders/middleware.js +57 -0
- package/lib/steps/extenders/notification-driver.d.ts +5 -0
- package/lib/steps/extenders/notification-driver.js +58 -0
- package/lib/steps/extenders/notification-type.d.ts +5 -0
- package/lib/steps/extenders/notification-type.js +55 -0
- package/lib/steps/extenders/policy.js +1 -1
- package/lib/steps/extenders/post-type.d.ts +5 -0
- package/lib/steps/extenders/post-type.js +42 -0
- package/lib/steps/extenders/route.js +11 -2
- package/lib/steps/extenders/search-driver.d.ts +5 -0
- package/lib/steps/extenders/search-driver.js +38 -0
- package/lib/steps/extenders/search-filter.d.ts +5 -0
- package/lib/steps/extenders/search-filter.js +67 -0
- package/lib/steps/extenders/service-provider.js +1 -1
- package/lib/steps/gen-ext-scaffolder.d.ts +3 -3
- package/lib/steps/gen-ext-scaffolder.js +79 -7
- package/lib/steps/js/base.d.ts +14 -5
- package/lib/steps/js/base.js +101 -25
- package/lib/steps/js/model.d.ts +4 -7
- package/lib/steps/js/model.js +45 -19
- package/lib/steps/js/notification.d.ts +7 -0
- package/lib/steps/js/notification.js +58 -0
- package/lib/steps/js/post-type.d.ts +8 -0
- package/lib/steps/js/post-type.js +60 -0
- package/lib/steps/js/routes.d.ts +7 -0
- package/lib/steps/js/routes.js +63 -0
- package/lib/steps/js/search-driver-locale.d.ts +8 -0
- package/lib/steps/js/search-driver-locale.js +36 -0
- package/lib/steps/js/search-gambit.d.ts +7 -0
- package/lib/steps/js/search-gambit.js +51 -0
- package/lib/steps/locale/base.d.ts +32 -0
- package/lib/steps/locale/base.js +97 -0
- package/lib/steps/misc/git.js +1 -1
- package/lib/steps/monorepo/create.d.ts +2 -0
- package/lib/steps/monorepo/create.js +5 -4
- package/lib/steps/monorepo/split.js +1 -1
- package/lib/steps/stubs/backend/advanced-api-resource.d.ts +13 -0
- package/lib/steps/stubs/backend/advanced-api-resource.js +81 -0
- package/lib/steps/stubs/backend/{api-serializer.d.ts → api-resource.d.ts} +1 -1
- package/lib/steps/stubs/backend/{api-serializer.js → api-resource.js} +9 -9
- package/lib/steps/stubs/backend/command.d.ts +2 -16
- package/lib/steps/stubs/backend/command.js +14 -1
- package/lib/steps/stubs/backend/{api-controller.d.ts → controller.d.ts} +3 -13
- package/lib/steps/stubs/backend/controller.js +40 -0
- package/lib/steps/stubs/backend/event-listener.js +1 -1
- package/lib/steps/stubs/backend/filter.d.ts +8 -0
- package/lib/steps/stubs/backend/filter.js +44 -0
- package/lib/steps/stubs/backend/handler-command.d.ts +2 -27
- package/lib/steps/stubs/backend/handler-command.js +2 -1
- package/lib/steps/stubs/backend/handler.js +1 -1
- package/lib/steps/stubs/backend/integration-test.js +0 -5
- package/lib/steps/stubs/backend/mail-driver.d.ts +7 -0
- package/lib/steps/stubs/backend/mail-driver.js +30 -0
- package/lib/steps/stubs/backend/middleware.d.ts +22 -0
- package/lib/steps/stubs/backend/middleware.js +31 -0
- package/lib/steps/stubs/backend/model.d.ts +2 -24
- package/lib/steps/stubs/backend/model.js +2 -5
- package/lib/steps/stubs/backend/notification-blueprint.d.ts +7 -0
- package/lib/steps/stubs/backend/notification-blueprint.js +44 -0
- package/lib/steps/stubs/backend/notification-driver.d.ts +7 -0
- package/lib/steps/stubs/backend/notification-driver.js +30 -0
- package/lib/steps/stubs/backend/policy.js +1 -1
- package/lib/steps/stubs/backend/post-type.d.ts +7 -0
- package/lib/steps/stubs/backend/post-type.js +44 -0
- package/lib/steps/stubs/backend/repository.js +1 -1
- package/lib/steps/stubs/backend/search-driver-searcher.d.ts +24 -0
- package/lib/steps/stubs/backend/search-driver-searcher.js +32 -0
- package/lib/steps/stubs/backend/search-driver.d.ts +8 -0
- package/lib/steps/stubs/backend/search-driver.js +49 -0
- package/lib/steps/stubs/flarum-base.js +1 -1
- package/lib/steps/stubs/frontend/forum-page.d.ts +25 -0
- package/lib/steps/stubs/frontend/forum-page.js +37 -0
- package/lib/steps/stubs/frontend/gambit.d.ts +7 -0
- package/lib/steps/stubs/frontend/gambit.js +50 -0
- package/lib/steps/stubs/frontend/model.d.ts +12 -0
- package/lib/steps/stubs/frontend/model.js +5 -0
- package/lib/steps/stubs/frontend/notification.d.ts +11 -0
- package/lib/steps/stubs/frontend/notification.js +48 -0
- package/lib/steps/stubs/frontend/post-type.d.ts +11 -0
- package/lib/steps/stubs/frontend/post-type.js +48 -0
- package/lib/steps/stubs/js-base.js +5 -1
- package/lib/steps/stubs/php-base.js +3 -1
- package/lib/steps/update/js-imports.js +1 -1
- package/lib/steps/upgrade/twopointoh/backend/email-views.d.ts +18 -0
- package/lib/steps/upgrade/twopointoh/backend/email-views.js +81 -0
- package/lib/steps/upgrade/twopointoh/backend/filesystem.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/filesystem.js +40 -0
- package/lib/steps/upgrade/twopointoh/backend/intervention-image.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/intervention-image.js +44 -0
- package/lib/steps/upgrade/twopointoh/backend/json-api.d.ts +12 -0
- package/lib/steps/upgrade/twopointoh/backend/json-api.js +111 -0
- package/lib/steps/upgrade/twopointoh/backend/mailer.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/mailer.js +37 -0
- package/lib/steps/upgrade/twopointoh/backend/misc.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/misc.js +42 -0
- package/lib/steps/upgrade/twopointoh/backend/phpunit.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/phpunit.js +52 -0
- package/lib/steps/upgrade/twopointoh/backend/search.d.ts +28 -0
- package/lib/steps/upgrade/twopointoh/backend/search.js +200 -0
- package/lib/steps/upgrade/twopointoh/base.d.ts +58 -0
- package/lib/steps/upgrade/twopointoh/base.js +284 -0
- package/lib/steps/upgrade/twopointoh/dependencies.d.ts +10 -0
- package/lib/steps/upgrade/twopointoh/dependencies.js +108 -0
- package/lib/steps/upgrade/twopointoh/frontend/code-splitting/usage-of-lazy-modules.d.ts +26 -0
- package/lib/steps/upgrade/twopointoh/frontend/code-splitting/usage-of-lazy-modules.js +418 -0
- package/lib/steps/upgrade/twopointoh/frontend/export-registry/compat.d.ts +12 -0
- package/lib/steps/upgrade/twopointoh/frontend/export-registry/compat.js +75 -0
- package/lib/steps/upgrade/twopointoh/frontend/export-registry/import-ext.d.ts +13 -0
- package/lib/steps/upgrade/twopointoh/frontend/export-registry/import-ext.js +126 -0
- package/lib/steps/upgrade/twopointoh/frontend/format.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/frontend/format.js +32 -0
- package/lib/steps/upgrade/twopointoh/frontend/misc.d.ts +17 -0
- package/lib/steps/upgrade/twopointoh/frontend/misc.js +433 -0
- package/lib/steps/upgrade/twopointoh/infra.d.ts +10 -0
- package/lib/steps/upgrade/twopointoh/infra.js +51 -0
- package/lib/steps/upgrade/twopointoh/less.d.ts +12 -0
- package/lib/steps/upgrade/twopointoh/less.js +217 -0
- package/lib/utils/add-extenders.d.ts +2 -0
- package/lib/utils/add-extenders.js +115 -0
- package/lib/utils/ast.d.ts +22 -0
- package/lib/utils/ast.js +235 -0
- package/lib/utils/composer.d.ts +1 -1
- package/lib/utils/model-name.d.ts +1 -0
- package/lib/utils/model-name.js +7 -3
- package/lib/utils/monorepo.d.ts +2 -2
- package/lib/utils/validation.d.ts +4 -1
- package/lib/utils/validation.js +9 -0
- package/oclif.manifest.json +1 -1
- package/package.json +20 -13
- package/php-subsystem/composer.json +3 -1
- package/php-subsystem/composer.lock +13 -11
- package/php-subsystem/index.php +41 -6
- package/php-subsystem/src/CustomPrettyPrinter.php +1 -1
- package/php-subsystem/src/ExtenderUtil.php +7 -13
- package/php-subsystem/src/NodeUtil.php +72 -0
- package/php-subsystem/src/NodeVisitors/AddExtender.php +28 -12
- package/php-subsystem/src/NodeVisitors/AddUses.php +24 -0
- package/php-subsystem/src/NodeVisitors/ChangeSignatures.php +200 -0
- package/php-subsystem/src/NodeVisitors/ReplaceUses.php +175 -0
- package/php-subsystem/src/Upgrade/Replacement.php +51 -0
- package/php-subsystem/src/Upgrade/ReplacementResult.php +17 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/EmailViews.php +94 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/Filesystem.php +88 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/InterventionImage.php +86 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/JsonApi.php +186 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/Misc.php +584 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/PhpUnit.php +241 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/Search.php +589 -0
- package/php-subsystem/vendor/autoload.php +18 -0
- package/php-subsystem/vendor/bin/php-parse +119 -0
- package/php-subsystem/vendor/composer/ClassLoader.php +166 -32
- package/php-subsystem/vendor/composer/InstalledVersions.php +350 -209
- package/php-subsystem/vendor/composer/autoload_classmap.php +1 -1
- package/php-subsystem/vendor/composer/autoload_namespaces.php +1 -1
- package/php-subsystem/vendor/composer/autoload_psr4.php +1 -1
- package/php-subsystem/vendor/composer/autoload_real.php +3 -22
- package/php-subsystem/vendor/composer/installed.json +12 -10
- package/php-subsystem/vendor/composer/installed.php +29 -30
- package/php-subsystem/vendor/composer/platform_check.php +2 -2
- package/php-subsystem/vendor/nikic/php-parser/README.md +74 -62
- package/php-subsystem/vendor/nikic/php-parser/bin/php-parse +12 -11
- package/php-subsystem/vendor/nikic/php-parser/composer.json +6 -4
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +58 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php +54 -25
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +11 -4
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +87 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +116 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php +22 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +26 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php +31 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +5 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +69 -26
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +47 -18
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +6 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +25 -28
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +31 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php +8 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +85 -70
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +119 -71
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Comment.php +35 -67
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +3 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +17 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Error.php +24 -33
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +6 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +11 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php +36 -22
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +24 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php +237 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +63 -69
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +15 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +74 -92
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +11 -18
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +10 -15
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +45 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +19 -25
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +6 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +22 -29
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +31 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +31 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +6 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +10 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +70 -491
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php +69 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NameContext.php +23 -24
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +13 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php +43 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +5 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php +36 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +13 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php +12 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php +37 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +1 -39
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +11 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +35 -30
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +8 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +35 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +5 -6
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +5 -6
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +12 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +34 -27
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +1 -32
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +5 -6
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +15 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +13 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +11 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +12 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +8 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +18 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +17 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +18 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +10 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +6 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +10 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +9 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +19 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +11 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +12 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +6 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +6 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +6 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php +13 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php +32 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +27 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +80 -53
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +47 -23
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php +37 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +1 -68
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +1 -29
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +1 -28
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php +78 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php +82 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php +34 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +1 -71
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +44 -24
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php +39 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php +29 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +11 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +33 -27
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +15 -15
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +66 -71
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +48 -61
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +1 -32
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +12 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +11 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +17 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +19 -15
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +20 -17
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +31 -27
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +16 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +18 -15
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +13 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +11 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +35 -36
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +1 -32
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +1 -35
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +8 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +12 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +3 -4
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +10 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +11 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +1 -50
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +16 -16
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +8 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php +55 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +27 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node.php +24 -29
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +20 -20
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +169 -82
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php +28 -19
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +71 -84
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +4 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php +82 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +6 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +40 -24
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +8 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php +59 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2011 -2058
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php +2717 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser.php +9 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +466 -248
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +31 -33
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php +164 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +419 -338
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php +51 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +587 -431
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Token.php +18 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php +63 -0
- package/boilerplate/stubs/backend/api-controller/create.php +0 -53
- package/boilerplate/stubs/backend/api-controller/delete.php +0 -52
- package/boilerplate/stubs/backend/api-controller/list.php +0 -61
- package/boilerplate/stubs/backend/api-controller/normal.php +0 -29
- package/boilerplate/stubs/backend/api-controller/show.php +0 -48
- package/boilerplate/stubs/backend/api-controller/update.php +0 -54
- package/boilerplate/stubs/backend/api-serializer.php +0 -36
- package/lib/commands/make/backend/api-controller.js +0 -26
- package/lib/commands/make/backend/api-serializer-attributes.js +0 -14
- package/lib/commands/make/backend/api-serializer.js +0 -15
- package/lib/steps/extenders/api-serializer.js +0 -77
- package/lib/steps/stubs/backend/api-controller.js +0 -65
- package/lib/steps/stubs/frontend/migration.js +0 -1
- package/php-subsystem/vendor/nikic/php-parser/.editorconfig +0 -9
- package/php-subsystem/vendor/nikic/php-parser/grammar/README.md +0 -27
- package/php-subsystem/vendor/nikic/php-parser/grammar/parser.template +0 -106
- package/php-subsystem/vendor/nikic/php-parser/grammar/php5.y +0 -1026
- package/php-subsystem/vendor/nikic/php-parser/grammar/php7.y +0 -1152
- package/php-subsystem/vendor/nikic/php-parser/grammar/phpyLang.php +0 -192
- package/php-subsystem/vendor/nikic/php-parser/grammar/rebuildParsers.php +0 -81
- package/php-subsystem/vendor/nikic/php-parser/grammar/tokens.template +0 -17
- package/php-subsystem/vendor/nikic/php-parser/grammar/tokens.y +0 -115
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +0 -47
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +0 -76
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +0 -23
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +0 -105
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +0 -30
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +0 -55
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +0 -2630
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +0 -145
- /package/{lib/steps/stubs/frontend/migration.d.ts → boilerplate/skeleton/extension/js/tests/integration/.gitkeep} +0 -0
- /package/boilerplate/skeleton/extension/js/{webpack.config.js → webpack.config.cjs} +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021-
|
|
3
|
+
Copyright (c) 2021-2024 Stichting Flarum (Flarum Foundation)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ This tool was built to simplify the development of Flarum extensions by automati
|
|
|
26
26
|
<!-- installation -->
|
|
27
27
|
|
|
28
28
|
```sh-session
|
|
29
|
-
$ npm install -g @flarum/cli@^
|
|
29
|
+
$ npm install -g @flarum/cli@^3.0.0
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
<!-- installationstop -->
|
|
@@ -49,7 +49,7 @@ $ npm install -g @flarum/cli
|
|
|
49
49
|
$ flarum-cli COMMAND
|
|
50
50
|
running command...
|
|
51
51
|
$ flarum-cli (-v|--version|version)
|
|
52
|
-
@flarum/cli/
|
|
52
|
+
@flarum/cli/3.0.1 linux-x64 node-v18.19.1
|
|
53
53
|
$ flarum-cli --help [COMMAND]
|
|
54
54
|
USAGE
|
|
55
55
|
$ flarum-cli COMMAND
|
|
@@ -83,33 +83,51 @@ The CLI has different types of commands for different tasks:
|
|
|
83
83
|
|
|
84
84
|
- `flarum-cli infra [MODULE] [PATH]`: Adds (or updates) infrastructure for some part of extension infrastructure. You can see all available modules by running `fl-dev infra --help`.
|
|
85
85
|
|
|
86
|
-
**Audit**: These commands help you make sure your extension is up
|
|
86
|
+
**Audit**: These commands help you make sure your extension is up-to-date.
|
|
87
87
|
|
|
88
|
-
- `flarum-cli audit infra [--monorepo] [--fix]` Check that infrastructure files are up
|
|
88
|
+
- `flarum-cli audit infra [--monorepo] [--fix]` Check that infrastructure files are up-to-date for all enabled modules.
|
|
89
|
+
|
|
90
|
+
**Backend/Frontend Boilerplate Generation**: These commands generate boilerplate code for different parts of an extension.
|
|
91
|
+
|
|
92
|
+
- `flarum-cli make model [className] [PATH] [-n|--no-interaction]`: Generates a backend model, the corresponding table migration, policy, API resource, routes, frontend equivalent, and related extenders.
|
|
93
|
+
- `flarum-cli make notification [className] [PATH] [-n|--no-interaction]`: Generates a backend notification blueprint, the corresponding backend extender, and the frontend equivalent.
|
|
94
|
+
- `flarum-cli make post-type [className] [PATH] [-n|--no-interaction]`: Generates a post type, the corresponding extenders, and the frontend equivalent.
|
|
95
|
+
|
|
96
|
+
**Localized text generation**: This command generates a locale key-value pair for a given string.
|
|
97
|
+
|
|
98
|
+
- `flarum-cli make locale [key] [value] [PATH] [-n|--no-interaction]`
|
|
89
99
|
|
|
90
100
|
**Backend Boilerplate Generation**: Generates different types of backend classes and/or extenders, ready to be used.
|
|
91
101
|
|
|
92
|
-
- `flarum-cli make backend
|
|
93
|
-
- `flarum-cli make backend
|
|
94
|
-
- `flarum-cli make backend api-
|
|
95
|
-
- `flarum-cli make backend command [PATH]`
|
|
96
|
-
- `flarum-cli make backend event-listener [PATH]`
|
|
97
|
-
- `flarum-cli make backend handler [PATH]`
|
|
98
|
-
- `flarum-cli make backend integration-test [PATH]`
|
|
99
|
-
- `flarum-cli make backend job [PATH]`
|
|
100
|
-
- `flarum-cli make backend migration [PATH]`
|
|
101
|
-
- `flarum-cli make backend
|
|
102
|
-
- `flarum-cli make backend
|
|
103
|
-
- `flarum-cli make backend
|
|
104
|
-
- `flarum-cli make backend
|
|
105
|
-
- `flarum-cli make backend
|
|
106
|
-
- `flarum-cli make backend
|
|
102
|
+
- `flarum-cli make backend model [className] [PATH] [-n|--no-interaction]`
|
|
103
|
+
- `flarum-cli make backend controller [className] [PATH] [-n|--no-interaction]`
|
|
104
|
+
- `flarum-cli make backend api-resource [PATH] [-n|--no-interaction]`
|
|
105
|
+
- `flarum-cli make backend command [className] [PATH] [-n|--no-interaction]`
|
|
106
|
+
- `flarum-cli make backend event-listener [PATH] [-n|--no-interaction]`
|
|
107
|
+
- `flarum-cli make backend handler [className] [PATH] [-n|--no-interaction]`
|
|
108
|
+
- `flarum-cli make backend integration-test [className] [PATH] [-n|--no-interaction]`
|
|
109
|
+
- `flarum-cli make backend job [className] [PATH] [-n|--no-interaction]`
|
|
110
|
+
- `flarum-cli make backend migration [name] [PATH] [-n|--no-interaction]`
|
|
111
|
+
- `flarum-cli make backend policy [PATH] [-n|--no-interaction]`
|
|
112
|
+
- `flarum-cli make backend repository [PATH] [-n|--no-interaction]`
|
|
113
|
+
- `flarum-cli make backend route [PATH] [-n|--no-interaction]`
|
|
114
|
+
- `flarum-cli make backend service-provider [className] [PATH] [-n|--no-interaction]`
|
|
115
|
+
- `flarum-cli make backend validator [className] [PATH] [-n|--no-interaction]`
|
|
116
|
+
- `flarum-cli make backend filter [className] [PATH] [-n|--no-interaction]`
|
|
117
|
+
- `flarum-cli make backend notification-blueprint [className] [PATH] [-n|--no-interaction]`
|
|
118
|
+
- `flarum-cli make backend notification-driver [className] [PATH] [-n|--no-interaction]`
|
|
119
|
+
- `flarum-cli make backend post-type [className] [PATH] [-n|--no-interaction]`
|
|
120
|
+
- `flarum-cli make backend mail-driver [className] [PATH] [-n|--no-interaction]`
|
|
107
121
|
|
|
108
122
|
**Frontend Boilerplate Generation**: Generate frontend components/classes, ready to be used.
|
|
109
123
|
|
|
110
|
-
- `flarum-cli make frontend component [PATH]`
|
|
111
|
-
- `flarum-cli make frontend modal [PATH]`
|
|
112
|
-
- `flarum-cli make frontend model [PATH]`
|
|
124
|
+
- `flarum-cli make frontend component [frontend] [className] [PATH] [-n|--no-interaction]`
|
|
125
|
+
- `flarum-cli make frontend modal [frontend] [className] [PATH] [-n|--no-interaction]`
|
|
126
|
+
- `flarum-cli make frontend model [className] [PATH] [-n|--no-interaction]`
|
|
127
|
+
- `flarum-cli make frontend forum-page [className] [routeName] [routePath] [PATH] [-n|--no-interaction]`
|
|
128
|
+
- `flarum-cli make frontend gambit [PATH] [-n|--no-interaction]`
|
|
129
|
+
- `flarum-cli make frontend notification [className] [PATH] [-n|--no-interaction]`
|
|
130
|
+
- `flarum-cli make frontend post-type [className] [PATH] [-n|--no-interaction]`
|
|
113
131
|
|
|
114
132
|
**Code Updates**: These commands help update extensions for newer versions of Flarum.
|
|
115
133
|
|
|
@@ -4,11 +4,12 @@ on: [workflow_dispatch, push, pull_request]
|
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
6
|
run:
|
|
7
|
-
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@
|
|
7
|
+
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@2.x
|
|
8
8
|
with:
|
|
9
9
|
enable_bundlewatch: <%= modules.bundlewatch %>
|
|
10
10
|
enable_prettier: <%= modules.prettier %>
|
|
11
11
|
enable_typescript: <%= modules.typescript %>
|
|
12
|
+
enable_tests: <%= modules.frontendTesting %>
|
|
12
13
|
|
|
13
14
|
frontend_directory: <%= params.frontendDirectory %>
|
|
14
15
|
backend_directory: <%= params.backendDirectory %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: Static Code Analysis
|
|
2
|
+
|
|
3
|
+
on: [workflow_dispatch, push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
run:
|
|
7
|
+
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@2.x
|
|
8
|
+
with:
|
|
9
|
+
enable_backend_testing: false
|
|
10
|
+
enable_phpstan: <%= modules.phpstan %>
|
|
11
|
+
|
|
12
|
+
backend_directory: <%= params.backendDirectory %>
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
"type": "flarum-extension",
|
|
8
8
|
"license": "<%= params.licenseType %>",
|
|
9
9
|
"require": {
|
|
10
|
-
"flarum/core": "^
|
|
10
|
+
"flarum/core": "^2.0"
|
|
11
11
|
},
|
|
12
12
|
"require-dev": {
|
|
13
|
-
"flarum/testing": "^
|
|
13
|
+
"flarum/testing": "^2.0",
|
|
14
|
+
"flarum/phpstan": "^2.0"
|
|
14
15
|
},
|
|
15
16
|
"authors": [<% if (params.authorName) { %>
|
|
16
17
|
{
|
|
@@ -49,13 +50,16 @@
|
|
|
49
50
|
],
|
|
50
51
|
"test:unit": "phpunit -c tests/phpunit.unit.xml",
|
|
51
52
|
"test:integration": "phpunit -c tests/phpunit.integration.xml",
|
|
52
|
-
"test:setup": "@php tests/integration/setup.php"
|
|
53
|
+
"test:setup": "@php tests/integration/setup.php",
|
|
54
|
+
"analyse:phpstan": "phpstan analyse",
|
|
55
|
+
"clear-cache:phpstan": "phpstan clear-result-cache"
|
|
53
56
|
},
|
|
54
57
|
"scripts-descriptions": {
|
|
55
58
|
"test": "Runs all tests.",
|
|
56
59
|
"test:unit": "Runs all unit tests.",
|
|
57
60
|
"test:integration": "Runs all integration tests.",
|
|
58
|
-
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
|
|
61
|
+
"test:setup": "Sets up a database for use with integration tests. Execute this only once.",
|
|
62
|
+
"analyse:phpstan": "Run static analysis"
|
|
59
63
|
},
|
|
60
64
|
"minimum-stability": "dev",
|
|
61
65
|
"prefer-stable": true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@flarum/jest-config')({});
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@<%= params.packageName %>",
|
|
3
3
|
"private": true,
|
|
4
|
+
"type": "module",
|
|
4
5
|
"version": "0.0.0",
|
|
5
6
|
"prettier": "@flarum/prettier-config",
|
|
6
7
|
"dependencies": {
|
|
7
8
|
},
|
|
8
9
|
"devDependencies": {
|
|
10
|
+
"@flarum/jest-config": "^1.0.1",
|
|
9
11
|
"@flarum/prettier-config": "^1.0.0",
|
|
10
|
-
"flarum-tsconfig": "^
|
|
11
|
-
"flarum-webpack-config": "^
|
|
12
|
+
"flarum-tsconfig": "^2.0.0",
|
|
13
|
+
"flarum-webpack-config": "^3.0.0",
|
|
12
14
|
"prettier": "^2.5.1",
|
|
13
15
|
"typescript": "^4.5.4",
|
|
14
16
|
"typescript-coverage-report": "^0.6.1",
|
|
@@ -25,6 +27,7 @@
|
|
|
25
27
|
"build-typings": "<%= params.jsPackageManager %> run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && <%= params.jsPackageManager %> run post-build-typings",
|
|
26
28
|
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'",
|
|
27
29
|
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
|
28
|
-
"check-typings-coverage": "typescript-coverage-report"
|
|
30
|
+
"check-typings-coverage": "typescript-coverage-report",
|
|
31
|
+
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import app from 'flarum/admin/app';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export { default as extend } from './extend';
|
|
4
|
+
|
|
5
|
+
app.initializers.add('<%= params.extensionId %>', () => {
|
|
4
6
|
console.log('[<%= params.packageName %>] Hello, admin!');
|
|
5
7
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import app from 'flarum/forum/app';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export { default as extend } from './extend';
|
|
4
|
+
|
|
5
|
+
app.initializers.add('<%= params.extensionId %>', () => {
|
|
4
6
|
console.log('[<%= params.packageName %>] Hello, forum!');
|
|
5
7
|
});
|
|
File without changes
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<phpunit
|
|
3
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
-
xsi:noNamespaceSchemaLocation="
|
|
4
|
+
xsi:noNamespaceSchemaLocation="../vendor/phpunit/phpunit/phpunit.xsd"
|
|
5
5
|
backupGlobals="false"
|
|
6
|
-
|
|
6
|
+
cacheDirectory=".phpunit.cache"
|
|
7
|
+
backupStaticProperties="false"
|
|
7
8
|
colors="true"
|
|
8
|
-
convertErrorsToExceptions="true"
|
|
9
|
-
convertNoticesToExceptions="true"
|
|
10
|
-
convertWarningsToExceptions="true"
|
|
11
9
|
processIsolation="true"
|
|
12
10
|
stopOnFailure="false"
|
|
13
11
|
>
|
|
14
|
-
<
|
|
12
|
+
<source>
|
|
15
13
|
<include>
|
|
16
14
|
<directory suffix=".php">../src/</directory>
|
|
17
15
|
</include>
|
|
18
|
-
</
|
|
16
|
+
</source>
|
|
19
17
|
<testsuites>
|
|
20
18
|
<testsuite name="Flarum Integration Tests">
|
|
21
19
|
<directory suffix="Test.php">./integration</directory>
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<phpunit
|
|
3
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/
|
|
4
|
+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
|
|
5
5
|
backupGlobals="false"
|
|
6
|
-
|
|
6
|
+
cacheDirectory=".phpunit.cache"
|
|
7
|
+
backupStaticProperties="false"
|
|
7
8
|
colors="true"
|
|
8
|
-
convertErrorsToExceptions="true"
|
|
9
|
-
convertNoticesToExceptions="true"
|
|
10
|
-
convertWarningsToExceptions="true"
|
|
11
9
|
processIsolation="false"
|
|
12
10
|
stopOnFailure="false"
|
|
13
11
|
>
|
|
14
|
-
<
|
|
12
|
+
<source>
|
|
15
13
|
<include>
|
|
16
14
|
<directory suffix=".php">../src/</directory>
|
|
17
15
|
</include>
|
|
18
|
-
</
|
|
16
|
+
</source>
|
|
19
17
|
<testsuites>
|
|
20
18
|
<testsuite name="Flarum Unit Tests">
|
|
21
19
|
<directory suffix="Test.php">./unit</directory>
|
|
22
20
|
</testsuite>
|
|
23
21
|
</testsuites>
|
|
24
|
-
<listeners>
|
|
25
|
-
<listener class="\Mockery\Adapter\Phpunit\TestListener" />
|
|
26
|
-
</listeners>
|
|
27
22
|
</phpunit>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace <%= classNamespace %>;
|
|
4
|
+
|
|
5
|
+
use Flarum\Api\Context;
|
|
6
|
+
use Flarum\Api\Endpoint;
|
|
7
|
+
use Flarum\Api\Resource;
|
|
8
|
+
use Flarum\Api\Schema;<% if (modelClassName) { %>
|
|
9
|
+
use Flarum\Api\Sort\SortColumn;
|
|
10
|
+
use <%= modelClass %>;
|
|
11
|
+
use Illuminate\Database\Eloquent\Builder;<% } %>
|
|
12
|
+
use Tobyz\JsonApiServer\Context as OriginalContext;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @extends <% if (modelClassName) { %>Resource\AbstractDatabaseResource<<%= modelClassName %>><% } else { %>Resource\AbstractResource<object><% } %>
|
|
16
|
+
*/
|
|
17
|
+
class <%= className %> extends <% if (modelClassName) { %>Resource\AbstractDatabaseResource<% } else { %>Resource\AbstractResource<% if (interfaces.length > 0) %> implements <%= interfaces.join(', ') %><% } %>
|
|
18
|
+
{
|
|
19
|
+
public function type(): string
|
|
20
|
+
{
|
|
21
|
+
return '<%= modelType %>';
|
|
22
|
+
}<% if (modelClassName) { %>
|
|
23
|
+
|
|
24
|
+
public function model(): string
|
|
25
|
+
{
|
|
26
|
+
return <%= modelClassName %>::class;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public function scope(Builder $query, OriginalContext $context): void
|
|
30
|
+
{
|
|
31
|
+
$query->whereVisibleTo($context->getActor());
|
|
32
|
+
}<% } %>
|
|
33
|
+
|
|
34
|
+
public function endpoints(): array
|
|
35
|
+
{
|
|
36
|
+
return [<% if (endpoints.includes('create')) { %>
|
|
37
|
+
Endpoint\Create::make()<% if (modelClassName) { %>
|
|
38
|
+
->can('create<%= modelClassName %>'),<% } %><% } %><% if (endpoints.includes('update')) { %>
|
|
39
|
+
Endpoint\Update::make()
|
|
40
|
+
->can('update'),<% } %><% if (endpoints.includes('delete')) { %>
|
|
41
|
+
Endpoint\Delete::make()
|
|
42
|
+
->can('delete'),<% } %><% if (endpoints.includes('show')) { %>
|
|
43
|
+
Endpoint\Show::make()
|
|
44
|
+
->authenticated(),<% } %><% if (endpoints.includes('list')) { %>
|
|
45
|
+
Endpoint\Index::make()
|
|
46
|
+
->paginate(),<% } %>
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public function fields(): array
|
|
51
|
+
{
|
|
52
|
+
return [
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @todo migrate logic from old serializer and controllers to this API Resource.
|
|
56
|
+
* @see https://docs.flarum.org/2.x/extend/api#api-resources
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
// Example:
|
|
60
|
+
Schema\Str::make('name')
|
|
61
|
+
->requiredOnCreate()
|
|
62
|
+
->minLength(3)
|
|
63
|
+
->maxLength(255)
|
|
64
|
+
->writable(),
|
|
65
|
+
|
|
66
|
+
<% (relations || []).forEach(([name,type]) => { %>
|
|
67
|
+
Schema\Relationship\<% if (type === 'hasOne') { %>ToOne<% } else { %>ToMany<% } %>::make('<%= name %>')
|
|
68
|
+
->includable()
|
|
69
|
+
// ->inverse('?') // the inverse relationship name if any.
|
|
70
|
+
->type('<%= name %>s'), // the serialized type of this relation (type of the relation model's API resource).<% }) %>
|
|
71
|
+
];
|
|
72
|
+
}<% if (modelClassName) { %>
|
|
73
|
+
|
|
74
|
+
public function sorts(): array
|
|
75
|
+
{
|
|
76
|
+
return [
|
|
77
|
+
// SortColumn::make('createdAt'),
|
|
78
|
+
];
|
|
79
|
+
}<% } else { %>
|
|
80
|
+
|
|
81
|
+
public function getId(object $model, OriginalContext $context): string
|
|
82
|
+
{
|
|
83
|
+
return $model->id;
|
|
84
|
+
}<% } %>
|
|
85
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace <%= classNamespace %>;
|
|
4
|
+
|
|
5
|
+
use Flarum\Api\Context;
|
|
6
|
+
use Flarum\Api\Endpoint;
|
|
7
|
+
use Flarum\Api\Resource;
|
|
8
|
+
use Flarum\Api\Schema;
|
|
9
|
+
use Flarum\Api\Sort\SortColumn;
|
|
10
|
+
use <%= modelClass %>;
|
|
11
|
+
use Illuminate\Database\Eloquent\Builder;
|
|
12
|
+
use Tobyz\JsonApiServer\Context as OriginalContext;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @extends Resource\AbstractDatabaseResource<<%= modelClassName %>>
|
|
16
|
+
*/
|
|
17
|
+
class <%= className %> extends Resource\AbstractDatabaseResource
|
|
18
|
+
{
|
|
19
|
+
public function type(): string
|
|
20
|
+
{
|
|
21
|
+
return '<%= modelType %>';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public function model(): string
|
|
25
|
+
{
|
|
26
|
+
return <%= modelClassName %>::class;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public function scope(Builder $query, OriginalContext $context): void
|
|
30
|
+
{
|
|
31
|
+
$query->whereVisibleTo($context->getActor());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public function endpoints(): array
|
|
35
|
+
{
|
|
36
|
+
return [
|
|
37
|
+
Endpoint\Create::make()
|
|
38
|
+
->can('create<%= modelClassName %>'),
|
|
39
|
+
Endpoint\Update::make()
|
|
40
|
+
->can('update'),
|
|
41
|
+
Endpoint\Delete::make()
|
|
42
|
+
->can('delete'),
|
|
43
|
+
Endpoint\Show::make()
|
|
44
|
+
->authenticated(),
|
|
45
|
+
Endpoint\Index::make()
|
|
46
|
+
->paginate(),
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public function fields(): array
|
|
51
|
+
{
|
|
52
|
+
return [
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @see https://docs.flarum.org/2.x/extend/api#api-resources
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
// Example:
|
|
59
|
+
Schema\Str::make('name')
|
|
60
|
+
->requiredOnCreate()
|
|
61
|
+
->minLength(3)
|
|
62
|
+
->maxLength(255)
|
|
63
|
+
->writable(),
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public function sorts(): array
|
|
68
|
+
{
|
|
69
|
+
return [
|
|
70
|
+
SortColumn::make('createdAt'),
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -13,9 +13,9 @@ class <%= className %> extends AbstractCommand
|
|
|
13
13
|
->setDescription('<%= commandDescription %>');
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
protected function fire()
|
|
16
|
+
protected function fire(): int
|
|
17
17
|
{
|
|
18
|
-
// See https://docs.flarum.org/extend/console.html#console and
|
|
18
|
+
// See https://docs.flarum.org/2.x/extend/console.html#console and
|
|
19
19
|
// https://symfony.com/doc/current/console.html#configuring-the-command for more information.
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace <%= classNamespace %>;
|
|
4
|
+
|
|
5
|
+
use Flarum\Http\RequestUtil;
|
|
6
|
+
use Laminas\Diactoros\Response;
|
|
7
|
+
use Psr\Http\Message\ServerRequestInterface;
|
|
8
|
+
use Psr\Http\Message\ResponseInterface;
|
|
9
|
+
use Psr\Http\Server\RequestHandlerInterface;
|
|
10
|
+
|
|
11
|
+
class <%= className %> implements RequestHandlerInterface
|
|
12
|
+
{
|
|
13
|
+
public function handle(ServerRequestInterface $request): ResponseInterface
|
|
14
|
+
{
|
|
15
|
+
$actor = RequestUtil::getActor($request);
|
|
16
|
+
|
|
17
|
+
return new Response(200);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -9,6 +9,6 @@ class <%= className %>
|
|
|
9
9
|
public function handle(<%= eventClassName %> $event)
|
|
10
10
|
{
|
|
11
11
|
// Add logic to handle the event here.
|
|
12
|
-
// See https://docs.flarum.org/extend/backend-events.html for more information.
|
|
12
|
+
// See https://docs.flarum.org/2.x/extend/backend-events.html for more information.
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace <%= classNamespace %>;
|
|
4
|
+
|
|
5
|
+
use Flarum\Search\Database\DatabaseSearchState;
|
|
6
|
+
use Flarum\Search\Filter\FilterInterface;
|
|
7
|
+
use Flarum\Search\SearchState;
|
|
8
|
+
use Flarum\User\User;
|
|
9
|
+
use Illuminate\Database\Query\Builder;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @implements FilterInterface<DatabaseSearchState>
|
|
13
|
+
*/
|
|
14
|
+
class <%= className %> implements FilterInterface
|
|
15
|
+
{
|
|
16
|
+
public function getFilterKey(): string
|
|
17
|
+
{
|
|
18
|
+
return '<%= filterKey %>';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public function filter(SearchState $state, string|array $value, bool $negate): void
|
|
22
|
+
{
|
|
23
|
+
// @TODO: implement filter logic
|
|
24
|
+
}
|
|
25
|
+
}
|