@flarum/cli 2.0.0-beta.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +178 -48
- package/bin/run +2 -1
- package/bin/splitsh-lite-darwin +0 -0
- package/bin/splitsh-lite-linux +0 -0
- package/boilerplate/skeleton/extension/.gitattributes +16 -14
- package/boilerplate/skeleton/extension/.github/workflows/backend.yml +2 -6
- package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +5 -6
- package/boilerplate/skeleton/extension/.github/workflows/phpstan.yml +12 -0
- package/boilerplate/skeleton/extension/LICENSE.md +1 -1
- package/boilerplate/skeleton/extension/README.md +1 -1
- package/boilerplate/skeleton/extension/composer.json +13 -7
- package/boilerplate/skeleton/extension/extend.php +2 -2
- package/boilerplate/skeleton/extension/gitignore +1 -0
- package/boilerplate/skeleton/extension/js/admin.ts +2 -0
- package/boilerplate/skeleton/extension/js/forum.ts +2 -0
- package/boilerplate/skeleton/extension/js/jest.config.cjs +1 -0
- package/boilerplate/skeleton/extension/js/package.json +11 -4
- 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 +7 -0
- 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 +5 -0
- 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 +7 -0
- package/boilerplate/skeleton/extension/js/tests/unit/.gitkeep +0 -0
- package/boilerplate/skeleton/extension/js/tsconfig.json +10 -2
- 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 +6 -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 +22 -6
- package/lib/base-command.js +114 -56
- package/lib/boilersmith/io.d.ts +33 -11
- package/lib/boilersmith/io.js +32 -17
- package/lib/boilersmith/paths.d.ts +3 -3
- package/lib/boilersmith/paths.js +7 -7
- package/lib/boilersmith/scaffolding/audit-step-factory.js +12 -12
- package/lib/boilersmith/scaffolding/infra-step-factory.js +2 -2
- package/lib/boilersmith/scaffolding/init-step-factory.js +5 -5
- package/lib/boilersmith/scaffolding/module.d.ts +30 -10
- package/lib/boilersmith/scaffolding/module.js +61 -19
- package/lib/boilersmith/scaffolding/scaffolder.d.ts +4 -1
- package/lib/boilersmith/scaffolding/scaffolder.js +33 -33
- package/lib/boilersmith/scaffolding/template-param.d.ts +2 -2
- package/lib/boilersmith/scaffolding/template-param.js +2 -2
- package/lib/boilersmith/step-manager.d.ts +15 -11
- package/lib/boilersmith/step-manager.js +45 -29
- package/lib/boilersmith/steps/stub-base.js +4 -4
- package/lib/boilersmith/utils/clone-and-fill.js +1 -1
- package/lib/boilersmith/utils/commit-async.d.ts +2 -0
- package/lib/boilersmith/utils/commit-async.js +15 -0
- package/lib/boilersmith/utils/json-leaf-paths.d.ts +2 -2
- package/lib/boilersmith/utils/read-tpl.js +2 -2
- package/lib/commands/audit/infra.d.ts +2 -5
- package/lib/commands/audit/infra.js +31 -9
- package/lib/commands/infra.d.ts +2 -10
- package/lib/commands/infra.js +20 -14
- package/lib/commands/init.d.ts +2 -5
- package/lib/commands/init.js +7 -5
- 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 +3 -4
- 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 +2 -3
- 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 +8 -11
- package/lib/commands/make/backend/integration-test.d.ts +1 -4
- package/lib/commands/make/backend/integration-test.js +4 -6
- 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 +10 -4
- package/lib/commands/make/backend/model.d.ts +6 -7
- package/lib/commands/make/backend/model.js +69 -449
- 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 +2 -3
- 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 +2 -3
- 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 +3 -4
- 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 +27 -28
- 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 +12 -0
- package/lib/commands/monorepo/create.js +20 -0
- package/lib/commands/monorepo/split.d.ts +12 -0
- package/lib/commands/monorepo/split.js +19 -0
- package/lib/commands/update/js-imports.d.ts +1 -4
- package/lib/commands/update/js-imports.js +2 -3
- package/lib/commands/upgrade/2.0.d.ts +17 -0
- package/lib/commands/upgrade/2.0.js +113 -0
- package/lib/help.js +2 -2
- package/lib/providers/php-provider.d.ts +7 -1
- package/lib/providers/php-provider.js +18 -5
- 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 +4 -4
- package/lib/steps/gen-ext-scaffolder.js +262 -56
- package/lib/steps/js/base.d.ts +14 -5
- package/lib/steps/js/base.js +101 -27
- 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/composer.js +2 -2
- package/lib/steps/misc/git.d.ts +1 -1
- package/lib/steps/misc/git.js +3 -3
- package/lib/steps/misc/npm.d.ts +11 -0
- package/lib/steps/misc/npm.js +19 -0
- package/lib/steps/misc/yarn.js +2 -2
- package/lib/steps/monorepo/create.d.ts +19 -0
- package/lib/steps/monorepo/create.js +187 -0
- package/lib/steps/monorepo/split.d.ts +14 -0
- package/lib/steps/monorepo/split.js +99 -0
- 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} +2 -2
- package/lib/steps/stubs/backend/{api-serializer.js → api-resource.js} +12 -9
- package/lib/steps/stubs/backend/command.d.ts +2 -21
- package/lib/steps/stubs/backend/command.js +15 -1
- package/lib/steps/stubs/backend/{api-controller.d.ts → controller.d.ts} +4 -14
- package/lib/steps/stubs/backend/controller.js +40 -0
- package/lib/steps/stubs/backend/event-listener.d.ts +1 -1
- package/lib/steps/stubs/backend/event-listener.js +3 -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 +3 -1
- package/lib/steps/stubs/backend/handler.d.ts +1 -1
- package/lib/steps/stubs/backend/handler.js +5 -1
- package/lib/steps/stubs/backend/integration-test.d.ts +1 -1
- package/lib/steps/stubs/backend/integration-test.js +1 -4
- package/lib/steps/stubs/backend/job.d.ts +1 -1
- package/lib/steps/stubs/backend/job.js +1 -0
- 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/migration.js +6 -3
- package/lib/steps/stubs/backend/model.d.ts +2 -24
- package/lib/steps/stubs/backend/model.js +3 -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.d.ts +1 -1
- package/lib/steps/stubs/backend/policy.js +3 -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.d.ts +1 -1
- package/lib/steps/stubs/backend/repository.js +3 -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/backend/service-provider.d.ts +1 -1
- package/lib/steps/stubs/backend/service-provider.js +1 -0
- package/lib/steps/stubs/backend/validator.d.ts +1 -1
- package/lib/steps/stubs/backend/validator.js +1 -0
- package/lib/steps/stubs/flarum-base.js +1 -1
- package/lib/steps/stubs/frontend/component.d.ts +0 -5
- package/lib/steps/stubs/frontend/component.js +1 -0
- 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/modal.d.ts +0 -5
- package/lib/steps/stubs/frontend/modal.js +1 -0
- package/lib/steps/stubs/frontend/model.d.ts +8 -1
- package/lib/steps/stubs/frontend/model.js +6 -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 +12 -5
- package/lib/steps/stubs/php-base.js +13 -9
- package/lib/steps/update/js-imports.js +9 -3
- 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 +2 -1
- package/lib/utils/migration.js +3 -1
- package/lib/utils/model-name.d.ts +1 -0
- package/lib/utils/model-name.js +7 -3
- package/lib/utils/monorepo.d.ts +24 -0
- package/lib/utils/monorepo.js +24 -0
- package/lib/utils/validation.d.ts +6 -1
- package/lib/utils/validation.js +15 -0
- package/oclif.manifest.json +1 -1
- package/package.json +27 -14
- package/php-subsystem/composer.json +11 -9
- package/php-subsystem/composer.lock +66 -71
- 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 +564 -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 +56 -61
- 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 +21 -13
- package/php-subsystem/vendor/nikic/php-parser/bin/php-parse +12 -11
- package/php-subsystem/vendor/nikic/php-parser/composer.json +41 -39
- 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 -27
- package/lib/commands/make/backend/api-serializer-attributes.js +0 -15
- 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 -62
- 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 -30
- 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
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
namespace PhpParser;
|
|
4
4
|
|
|
5
|
-
interface Node
|
|
6
|
-
{
|
|
5
|
+
interface Node {
|
|
7
6
|
/**
|
|
8
7
|
* Gets the type of the node.
|
|
9
8
|
*
|
|
10
9
|
* @return string Type of the node
|
|
11
10
|
*/
|
|
12
|
-
public function getType()
|
|
11
|
+
public function getType(): string;
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Gets the names of the sub nodes.
|
|
16
15
|
*
|
|
17
|
-
* @return
|
|
16
|
+
* @return string[] Names of sub nodes
|
|
18
17
|
*/
|
|
19
|
-
public function getSubNodeNames()
|
|
18
|
+
public function getSubNodeNames(): array;
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Gets line the node started in (alias of getStartLine).
|
|
23
22
|
*
|
|
24
23
|
* @return int Start line (or -1 if not available)
|
|
24
|
+
*
|
|
25
|
+
* @deprecated Use getStartLine() instead
|
|
25
26
|
*/
|
|
26
|
-
public function getLine()
|
|
27
|
+
public function getLine(): int;
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Gets line the node started in.
|
|
@@ -32,7 +33,7 @@ interface Node
|
|
|
32
33
|
*
|
|
33
34
|
* @return int Start line (or -1 if not available)
|
|
34
35
|
*/
|
|
35
|
-
public function getStartLine()
|
|
36
|
+
public function getStartLine(): int;
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Gets the line the node ended in.
|
|
@@ -41,7 +42,7 @@ interface Node
|
|
|
41
42
|
*
|
|
42
43
|
* @return int End line (or -1 if not available)
|
|
43
44
|
*/
|
|
44
|
-
public function getEndLine()
|
|
45
|
+
public function getEndLine(): int;
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
48
|
* Gets the token offset of the first token that is part of this node.
|
|
@@ -52,7 +53,7 @@ interface Node
|
|
|
52
53
|
*
|
|
53
54
|
* @return int Token start position (or -1 if not available)
|
|
54
55
|
*/
|
|
55
|
-
public function getStartTokenPos()
|
|
56
|
+
public function getStartTokenPos(): int;
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* Gets the token offset of the last token that is part of this node.
|
|
@@ -63,7 +64,7 @@ interface Node
|
|
|
63
64
|
*
|
|
64
65
|
* @return int Token end position (or -1 if not available)
|
|
65
66
|
*/
|
|
66
|
-
public function getEndTokenPos()
|
|
67
|
+
public function getEndTokenPos(): int;
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
70
|
* Gets the file offset of the first character that is part of this node.
|
|
@@ -72,7 +73,7 @@ interface Node
|
|
|
72
73
|
*
|
|
73
74
|
* @return int File start position (or -1 if not available)
|
|
74
75
|
*/
|
|
75
|
-
public function getStartFilePos()
|
|
76
|
+
public function getStartFilePos(): int;
|
|
76
77
|
|
|
77
78
|
/**
|
|
78
79
|
* Gets the file offset of the last character that is part of this node.
|
|
@@ -81,7 +82,7 @@ interface Node
|
|
|
81
82
|
*
|
|
82
83
|
* @return int File end position (or -1 if not available)
|
|
83
84
|
*/
|
|
84
|
-
public function getEndFilePos()
|
|
85
|
+
public function getEndFilePos(): int;
|
|
85
86
|
|
|
86
87
|
/**
|
|
87
88
|
* Gets all comments directly preceding this node.
|
|
@@ -90,14 +91,14 @@ interface Node
|
|
|
90
91
|
*
|
|
91
92
|
* @return Comment[]
|
|
92
93
|
*/
|
|
93
|
-
public function getComments()
|
|
94
|
+
public function getComments(): array;
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
97
|
* Gets the doc comment of the node.
|
|
97
98
|
*
|
|
98
99
|
* @return null|Comment\Doc Doc comment object or null
|
|
99
100
|
*/
|
|
100
|
-
public function getDocComment();
|
|
101
|
+
public function getDocComment(): ?Comment\Doc;
|
|
101
102
|
|
|
102
103
|
/**
|
|
103
104
|
* Sets the doc comment of the node.
|
|
@@ -106,30 +107,24 @@ interface Node
|
|
|
106
107
|
*
|
|
107
108
|
* @param Comment\Doc $docComment Doc comment to set
|
|
108
109
|
*/
|
|
109
|
-
public function setDocComment(Comment\Doc $docComment);
|
|
110
|
+
public function setDocComment(Comment\Doc $docComment): void;
|
|
110
111
|
|
|
111
112
|
/**
|
|
112
113
|
* Sets an attribute on a node.
|
|
113
114
|
*
|
|
114
|
-
* @param
|
|
115
|
-
* @param mixed $value
|
|
115
|
+
* @param mixed $value
|
|
116
116
|
*/
|
|
117
|
-
public function setAttribute(string $key, $value);
|
|
117
|
+
public function setAttribute(string $key, $value): void;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
120
|
* Returns whether an attribute exists.
|
|
121
|
-
*
|
|
122
|
-
* @param string $key
|
|
123
|
-
*
|
|
124
|
-
* @return bool
|
|
125
121
|
*/
|
|
126
|
-
public function hasAttribute(string $key)
|
|
122
|
+
public function hasAttribute(string $key): bool;
|
|
127
123
|
|
|
128
124
|
/**
|
|
129
125
|
* Returns the value of an attribute.
|
|
130
126
|
*
|
|
131
|
-
* @param
|
|
132
|
-
* @param mixed $default
|
|
127
|
+
* @param mixed $default
|
|
133
128
|
*
|
|
134
129
|
* @return mixed
|
|
135
130
|
*/
|
|
@@ -138,14 +133,14 @@ interface Node
|
|
|
138
133
|
/**
|
|
139
134
|
* Returns all the attributes of this node.
|
|
140
135
|
*
|
|
141
|
-
* @return array
|
|
136
|
+
* @return array<string, mixed>
|
|
142
137
|
*/
|
|
143
|
-
public function getAttributes()
|
|
138
|
+
public function getAttributes(): array;
|
|
144
139
|
|
|
145
140
|
/**
|
|
146
141
|
* Replaces all the attributes of this node.
|
|
147
142
|
*
|
|
148
|
-
* @param array $attributes
|
|
143
|
+
* @param array<string, mixed> $attributes
|
|
149
144
|
*/
|
|
150
|
-
public function setAttributes(array $attributes);
|
|
145
|
+
public function setAttributes(array $attributes): void;
|
|
151
146
|
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
namespace PhpParser;
|
|
4
4
|
|
|
5
|
-
abstract class NodeAbstract implements Node, \JsonSerializable
|
|
6
|
-
|
|
7
|
-
protected $attributes;
|
|
5
|
+
abstract class NodeAbstract implements Node, \JsonSerializable {
|
|
6
|
+
/** @var array<string, mixed> Attributes */
|
|
7
|
+
protected array $attributes;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Creates a Node.
|
|
11
11
|
*
|
|
12
|
-
* @param array $attributes Array of attributes
|
|
12
|
+
* @param array<string, mixed> $attributes Array of attributes
|
|
13
13
|
*/
|
|
14
14
|
public function __construct(array $attributes = []) {
|
|
15
15
|
$this->attributes = $attributes;
|
|
@@ -20,7 +20,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
20
20
|
*
|
|
21
21
|
* @return int Start line (or -1 if not available)
|
|
22
22
|
*/
|
|
23
|
-
public function getLine()
|
|
23
|
+
public function getLine(): int {
|
|
24
24
|
return $this->attributes['startLine'] ?? -1;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -31,7 +31,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
31
31
|
*
|
|
32
32
|
* @return int Start line (or -1 if not available)
|
|
33
33
|
*/
|
|
34
|
-
public function getStartLine()
|
|
34
|
+
public function getStartLine(): int {
|
|
35
35
|
return $this->attributes['startLine'] ?? -1;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -42,7 +42,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
42
42
|
*
|
|
43
43
|
* @return int End line (or -1 if not available)
|
|
44
44
|
*/
|
|
45
|
-
public function getEndLine()
|
|
45
|
+
public function getEndLine(): int {
|
|
46
46
|
return $this->attributes['endLine'] ?? -1;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -55,7 +55,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
55
55
|
*
|
|
56
56
|
* @return int Token start position (or -1 if not available)
|
|
57
57
|
*/
|
|
58
|
-
public function getStartTokenPos()
|
|
58
|
+
public function getStartTokenPos(): int {
|
|
59
59
|
return $this->attributes['startTokenPos'] ?? -1;
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -68,7 +68,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
68
68
|
*
|
|
69
69
|
* @return int Token end position (or -1 if not available)
|
|
70
70
|
*/
|
|
71
|
-
public function getEndTokenPos()
|
|
71
|
+
public function getEndTokenPos(): int {
|
|
72
72
|
return $this->attributes['endTokenPos'] ?? -1;
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -79,7 +79,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
79
79
|
*
|
|
80
80
|
* @return int File start position (or -1 if not available)
|
|
81
81
|
*/
|
|
82
|
-
public function getStartFilePos()
|
|
82
|
+
public function getStartFilePos(): int {
|
|
83
83
|
return $this->attributes['startFilePos'] ?? -1;
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -90,7 +90,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
90
90
|
*
|
|
91
91
|
* @return int File end position (or -1 if not available)
|
|
92
92
|
*/
|
|
93
|
-
public function getEndFilePos()
|
|
93
|
+
public function getEndFilePos(): int {
|
|
94
94
|
return $this->attributes['endFilePos'] ?? -1;
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -101,7 +101,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
101
101
|
*
|
|
102
102
|
* @return Comment[]
|
|
103
103
|
*/
|
|
104
|
-
public function getComments()
|
|
104
|
+
public function getComments(): array {
|
|
105
105
|
return $this->attributes['comments'] ?? [];
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -110,7 +110,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
110
110
|
*
|
|
111
111
|
* @return null|Comment\Doc Doc comment object or null
|
|
112
112
|
*/
|
|
113
|
-
public function getDocComment() {
|
|
113
|
+
public function getDocComment(): ?Comment\Doc {
|
|
114
114
|
$comments = $this->getComments();
|
|
115
115
|
for ($i = count($comments) - 1; $i >= 0; $i--) {
|
|
116
116
|
$comment = $comments[$i];
|
|
@@ -129,7 +129,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
129
129
|
*
|
|
130
130
|
* @param Comment\Doc $docComment Doc comment to set
|
|
131
131
|
*/
|
|
132
|
-
public function setDocComment(Comment\Doc $docComment) {
|
|
132
|
+
public function setDocComment(Comment\Doc $docComment): void {
|
|
133
133
|
$comments = $this->getComments();
|
|
134
134
|
for ($i = count($comments) - 1; $i >= 0; $i--) {
|
|
135
135
|
if ($comments[$i] instanceof Comment\Doc) {
|
|
@@ -145,11 +145,11 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
145
145
|
$this->setAttribute('comments', $comments);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
public function setAttribute(string $key, $value) {
|
|
148
|
+
public function setAttribute(string $key, $value): void {
|
|
149
149
|
$this->attributes[$key] = $value;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
public function hasAttribute(string $key)
|
|
152
|
+
public function hasAttribute(string $key): bool {
|
|
153
153
|
return array_key_exists($key, $this->attributes);
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -161,18 +161,18 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
|
161
161
|
return $default;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
public function getAttributes()
|
|
164
|
+
public function getAttributes(): array {
|
|
165
165
|
return $this->attributes;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
public function setAttributes(array $attributes) {
|
|
168
|
+
public function setAttributes(array $attributes): void {
|
|
169
169
|
$this->attributes = $attributes;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
/**
|
|
173
|
-
* @return array
|
|
173
|
+
* @return array<string, mixed>
|
|
174
174
|
*/
|
|
175
|
-
public function jsonSerialize()
|
|
175
|
+
public function jsonSerialize(): array {
|
|
176
176
|
return ['nodeType' => $this->getType()] + get_object_vars($this);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -2,17 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
namespace PhpParser;
|
|
4
4
|
|
|
5
|
+
use PhpParser\Node\Expr\Array_;
|
|
5
6
|
use PhpParser\Node\Expr\Include_;
|
|
6
|
-
use PhpParser\Node\
|
|
7
|
+
use PhpParser\Node\Expr\List_;
|
|
8
|
+
use PhpParser\Node\Scalar\Int_;
|
|
9
|
+
use PhpParser\Node\Scalar\InterpolatedString;
|
|
10
|
+
use PhpParser\Node\Scalar\String_;
|
|
7
11
|
use PhpParser\Node\Stmt\GroupUse;
|
|
8
12
|
use PhpParser\Node\Stmt\Use_;
|
|
9
|
-
use PhpParser\Node\
|
|
13
|
+
use PhpParser\Node\UseItem;
|
|
10
14
|
|
|
11
|
-
class NodeDumper
|
|
12
|
-
|
|
13
|
-
private $
|
|
14
|
-
private $
|
|
15
|
-
private $code;
|
|
15
|
+
class NodeDumper {
|
|
16
|
+
private bool $dumpComments;
|
|
17
|
+
private bool $dumpPositions;
|
|
18
|
+
private bool $dumpOtherAttributes;
|
|
19
|
+
private ?string $code;
|
|
20
|
+
private string $res;
|
|
21
|
+
private string $nl;
|
|
22
|
+
|
|
23
|
+
private const IGNORE_ATTRIBUTES = [
|
|
24
|
+
'comments' => true,
|
|
25
|
+
'startLine' => true,
|
|
26
|
+
'endLine' => true,
|
|
27
|
+
'startFilePos' => true,
|
|
28
|
+
'endFilePos' => true,
|
|
29
|
+
'startTokenPos' => true,
|
|
30
|
+
'endTokenPos' => true,
|
|
31
|
+
];
|
|
16
32
|
|
|
17
33
|
/**
|
|
18
34
|
* Constructs a NodeDumper.
|
|
@@ -21,147 +37,218 @@ class NodeDumper
|
|
|
21
37
|
* * bool dumpComments: Whether comments should be dumped.
|
|
22
38
|
* * bool dumpPositions: Whether line/offset information should be dumped. To dump offset
|
|
23
39
|
* information, the code needs to be passed to dump().
|
|
40
|
+
* * bool dumpOtherAttributes: Whether non-comment, non-position attributes should be dumped.
|
|
24
41
|
*
|
|
25
42
|
* @param array $options Options (see description)
|
|
26
43
|
*/
|
|
27
44
|
public function __construct(array $options = []) {
|
|
28
45
|
$this->dumpComments = !empty($options['dumpComments']);
|
|
29
46
|
$this->dumpPositions = !empty($options['dumpPositions']);
|
|
47
|
+
$this->dumpOtherAttributes = !empty($options['dumpOtherAttributes']);
|
|
30
48
|
}
|
|
31
49
|
|
|
32
50
|
/**
|
|
33
51
|
* Dumps a node or array.
|
|
34
52
|
*
|
|
35
|
-
* @param array|Node
|
|
53
|
+
* @param array|Node $node Node or array to dump
|
|
36
54
|
* @param string|null $code Code corresponding to dumped AST. This only needs to be passed if
|
|
37
55
|
* the dumpPositions option is enabled and the dumping of node offsets
|
|
38
56
|
* is desired.
|
|
39
57
|
*
|
|
40
58
|
* @return string Dumped value
|
|
41
59
|
*/
|
|
42
|
-
public function dump($node, string $code = null)
|
|
60
|
+
public function dump($node, ?string $code = null): string {
|
|
43
61
|
$this->code = $code;
|
|
44
|
-
|
|
62
|
+
$this->res = '';
|
|
63
|
+
$this->nl = "\n";
|
|
64
|
+
$this->dumpRecursive($node, false);
|
|
65
|
+
return $this->res;
|
|
45
66
|
}
|
|
46
67
|
|
|
47
|
-
|
|
68
|
+
/** @param mixed $node */
|
|
69
|
+
protected function dumpRecursive($node, bool $indent = true): void {
|
|
70
|
+
if ($indent) {
|
|
71
|
+
$this->nl .= " ";
|
|
72
|
+
}
|
|
48
73
|
if ($node instanceof Node) {
|
|
49
|
-
$
|
|
74
|
+
$this->res .= $node->getType();
|
|
50
75
|
if ($this->dumpPositions && null !== $p = $this->dumpPosition($node)) {
|
|
51
|
-
$
|
|
76
|
+
$this->res .= $p;
|
|
52
77
|
}
|
|
53
|
-
$
|
|
78
|
+
$this->res .= '(';
|
|
54
79
|
|
|
55
80
|
foreach ($node->getSubNodeNames() as $key) {
|
|
56
|
-
$
|
|
81
|
+
$this->res .= "$this->nl " . $key . ': ';
|
|
57
82
|
|
|
58
83
|
$value = $node->$key;
|
|
59
|
-
if (
|
|
60
|
-
$r .= 'null';
|
|
61
|
-
} elseif (false === $value) {
|
|
62
|
-
$r .= 'false';
|
|
63
|
-
} elseif (true === $value) {
|
|
64
|
-
$r .= 'true';
|
|
65
|
-
} elseif (is_scalar($value)) {
|
|
84
|
+
if (\is_int($value)) {
|
|
66
85
|
if ('flags' === $key || 'newModifier' === $key) {
|
|
67
|
-
$
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
86
|
+
$this->res .= $this->dumpFlags($value);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if ('type' === $key && $node instanceof Include_) {
|
|
90
|
+
$this->res .= $this->dumpIncludeType($value);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if ('type' === $key
|
|
94
|
+
&& ($node instanceof Use_ || $node instanceof UseItem || $node instanceof GroupUse)) {
|
|
95
|
+
$this->res .= $this->dumpUseType($value);
|
|
96
|
+
continue;
|
|
75
97
|
}
|
|
76
|
-
} else {
|
|
77
|
-
$r .= str_replace("\n", "\n ", $this->dumpRecursive($value));
|
|
78
98
|
}
|
|
99
|
+
$this->dumpRecursive($value);
|
|
79
100
|
}
|
|
80
101
|
|
|
81
102
|
if ($this->dumpComments && $comments = $node->getComments()) {
|
|
82
|
-
$
|
|
103
|
+
$this->res .= "$this->nl comments: ";
|
|
104
|
+
$this->dumpRecursive($comments);
|
|
83
105
|
}
|
|
84
|
-
} elseif (is_array($node)) {
|
|
85
|
-
$r = 'array(';
|
|
86
106
|
|
|
87
|
-
|
|
88
|
-
$
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
$
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
if ($this->dumpOtherAttributes) {
|
|
108
|
+
foreach ($node->getAttributes() as $key => $value) {
|
|
109
|
+
if (isset(self::IGNORE_ATTRIBUTES[$key])) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
$this->res .= "$this->nl $key: ";
|
|
114
|
+
if (\is_int($value)) {
|
|
115
|
+
if ('kind' === $key) {
|
|
116
|
+
if ($node instanceof Int_) {
|
|
117
|
+
$this->res .= $this->dumpIntKind($value);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if ($node instanceof String_ || $node instanceof InterpolatedString) {
|
|
121
|
+
$this->res .= $this->dumpStringKind($value);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if ($node instanceof Array_) {
|
|
125
|
+
$this->res .= $this->dumpArrayKind($value);
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if ($node instanceof List_) {
|
|
129
|
+
$this->res .= $this->dumpListKind($value);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
$this->dumpRecursive($value);
|
|
100
135
|
}
|
|
101
136
|
}
|
|
137
|
+
$this->res .= "$this->nl)";
|
|
138
|
+
} elseif (\is_array($node)) {
|
|
139
|
+
$this->res .= 'array(';
|
|
140
|
+
foreach ($node as $key => $value) {
|
|
141
|
+
$this->res .= "$this->nl " . $key . ': ';
|
|
142
|
+
$this->dumpRecursive($value);
|
|
143
|
+
}
|
|
144
|
+
$this->res .= "$this->nl)";
|
|
102
145
|
} elseif ($node instanceof Comment) {
|
|
103
|
-
|
|
146
|
+
$this->res .= \str_replace("\n", $this->nl, $node->getReformattedText());
|
|
147
|
+
} elseif (\is_string($node)) {
|
|
148
|
+
$this->res .= \str_replace("\n", $this->nl, (string)$node);
|
|
149
|
+
} elseif (\is_int($node) || \is_float($node)) {
|
|
150
|
+
$this->res .= $node;
|
|
151
|
+
} elseif (null === $node) {
|
|
152
|
+
$this->res .= 'null';
|
|
153
|
+
} elseif (false === $node) {
|
|
154
|
+
$this->res .= 'false';
|
|
155
|
+
} elseif (true === $node) {
|
|
156
|
+
$this->res .= 'true';
|
|
104
157
|
} else {
|
|
105
158
|
throw new \InvalidArgumentException('Can only dump nodes and arrays.');
|
|
106
159
|
}
|
|
107
|
-
|
|
108
|
-
|
|
160
|
+
if ($indent) {
|
|
161
|
+
$this->nl = \substr($this->nl, 0, -4);
|
|
162
|
+
}
|
|
109
163
|
}
|
|
110
164
|
|
|
111
|
-
protected function dumpFlags($flags) {
|
|
165
|
+
protected function dumpFlags(int $flags): string {
|
|
112
166
|
$strs = [];
|
|
113
|
-
if ($flags &
|
|
114
|
-
$strs[] = '
|
|
167
|
+
if ($flags & Modifiers::PUBLIC) {
|
|
168
|
+
$strs[] = 'PUBLIC';
|
|
169
|
+
}
|
|
170
|
+
if ($flags & Modifiers::PROTECTED) {
|
|
171
|
+
$strs[] = 'PROTECTED';
|
|
115
172
|
}
|
|
116
|
-
if ($flags &
|
|
117
|
-
$strs[] = '
|
|
173
|
+
if ($flags & Modifiers::PRIVATE) {
|
|
174
|
+
$strs[] = 'PRIVATE';
|
|
118
175
|
}
|
|
119
|
-
if ($flags &
|
|
120
|
-
$strs[] = '
|
|
176
|
+
if ($flags & Modifiers::ABSTRACT) {
|
|
177
|
+
$strs[] = 'ABSTRACT';
|
|
121
178
|
}
|
|
122
|
-
if ($flags &
|
|
123
|
-
$strs[] = '
|
|
179
|
+
if ($flags & Modifiers::STATIC) {
|
|
180
|
+
$strs[] = 'STATIC';
|
|
124
181
|
}
|
|
125
|
-
if ($flags &
|
|
126
|
-
$strs[] = '
|
|
182
|
+
if ($flags & Modifiers::FINAL) {
|
|
183
|
+
$strs[] = 'FINAL';
|
|
127
184
|
}
|
|
128
|
-
if ($flags &
|
|
129
|
-
$strs[] = '
|
|
185
|
+
if ($flags & Modifiers::READONLY) {
|
|
186
|
+
$strs[] = 'READONLY';
|
|
130
187
|
}
|
|
131
188
|
|
|
132
189
|
if ($strs) {
|
|
133
190
|
return implode(' | ', $strs) . ' (' . $flags . ')';
|
|
134
191
|
} else {
|
|
135
|
-
return $flags;
|
|
192
|
+
return (string) $flags;
|
|
136
193
|
}
|
|
137
194
|
}
|
|
138
195
|
|
|
139
|
-
|
|
140
|
-
|
|
196
|
+
/** @param array<int, string> $map */
|
|
197
|
+
private function dumpEnum(int $value, array $map): string {
|
|
198
|
+
if (!isset($map[$value])) {
|
|
199
|
+
return (string) $value;
|
|
200
|
+
}
|
|
201
|
+
return $map[$value] . ' (' . $value . ')';
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
private function dumpIncludeType(int $type): string {
|
|
205
|
+
return $this->dumpEnum($type, [
|
|
141
206
|
Include_::TYPE_INCLUDE => 'TYPE_INCLUDE',
|
|
142
207
|
Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE',
|
|
143
208
|
Include_::TYPE_REQUIRE => 'TYPE_REQUIRE',
|
|
144
209
|
Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE',
|
|
145
|
-
];
|
|
146
|
-
|
|
147
|
-
if (!isset($map[$type])) {
|
|
148
|
-
return $type;
|
|
149
|
-
}
|
|
150
|
-
return $map[$type] . ' (' . $type . ')';
|
|
210
|
+
]);
|
|
151
211
|
}
|
|
152
212
|
|
|
153
|
-
|
|
154
|
-
$
|
|
213
|
+
private function dumpUseType(int $type): string {
|
|
214
|
+
return $this->dumpEnum($type, [
|
|
155
215
|
Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN',
|
|
156
216
|
Use_::TYPE_NORMAL => 'TYPE_NORMAL',
|
|
157
217
|
Use_::TYPE_FUNCTION => 'TYPE_FUNCTION',
|
|
158
218
|
Use_::TYPE_CONSTANT => 'TYPE_CONSTANT',
|
|
159
|
-
];
|
|
219
|
+
]);
|
|
220
|
+
}
|
|
160
221
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
222
|
+
private function dumpIntKind(int $kind): string {
|
|
223
|
+
return $this->dumpEnum($kind, [
|
|
224
|
+
Int_::KIND_BIN => 'KIND_BIN',
|
|
225
|
+
Int_::KIND_OCT => 'KIND_OCT',
|
|
226
|
+
Int_::KIND_DEC => 'KIND_DEC',
|
|
227
|
+
Int_::KIND_HEX => 'KIND_HEX',
|
|
228
|
+
]);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
private function dumpStringKind(int $kind): string {
|
|
232
|
+
return $this->dumpEnum($kind, [
|
|
233
|
+
String_::KIND_SINGLE_QUOTED => 'KIND_SINGLE_QUOTED',
|
|
234
|
+
String_::KIND_DOUBLE_QUOTED => 'KIND_DOUBLE_QUOTED',
|
|
235
|
+
String_::KIND_HEREDOC => 'KIND_HEREDOC',
|
|
236
|
+
String_::KIND_NOWDOC => 'KIND_NOWDOC',
|
|
237
|
+
]);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
private function dumpArrayKind(int $kind): string {
|
|
241
|
+
return $this->dumpEnum($kind, [
|
|
242
|
+
Array_::KIND_LONG => 'KIND_LONG',
|
|
243
|
+
Array_::KIND_SHORT => 'KIND_SHORT',
|
|
244
|
+
]);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
private function dumpListKind(int $kind): string {
|
|
248
|
+
return $this->dumpEnum($kind, [
|
|
249
|
+
List_::KIND_LIST => 'KIND_LIST',
|
|
250
|
+
List_::KIND_ARRAY => 'KIND_ARRAY',
|
|
251
|
+
]);
|
|
165
252
|
}
|
|
166
253
|
|
|
167
254
|
/**
|
|
@@ -171,7 +258,7 @@ class NodeDumper
|
|
|
171
258
|
*
|
|
172
259
|
* @return string|null Dump of position, or null if position information not available
|
|
173
260
|
*/
|
|
174
|
-
protected function dumpPosition(Node $node) {
|
|
261
|
+
protected function dumpPosition(Node $node): ?string {
|
|
175
262
|
if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) {
|
|
176
263
|
return null;
|
|
177
264
|
}
|
|
@@ -188,7 +275,7 @@ class NodeDumper
|
|
|
188
275
|
}
|
|
189
276
|
|
|
190
277
|
// Copied from Error class
|
|
191
|
-
private function toColumn($code, $pos) {
|
|
278
|
+
private function toColumn(string $code, int $pos): int {
|
|
192
279
|
if ($pos > strlen($code)) {
|
|
193
280
|
throw new \RuntimeException('Invalid position information');
|
|
194
281
|
}
|