@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
|
@@ -10,8 +10,20 @@ use PhpParser\Node\Name;
|
|
|
10
10
|
use PhpParser\Node\Scalar\String_;
|
|
11
11
|
use PhpParser\Node\Stmt\Use_;
|
|
12
12
|
|
|
13
|
-
class BuilderFactory
|
|
14
|
-
|
|
13
|
+
class BuilderFactory {
|
|
14
|
+
/**
|
|
15
|
+
* Creates an attribute node.
|
|
16
|
+
*
|
|
17
|
+
* @param string|Name $name Name of the attribute
|
|
18
|
+
* @param array $args Attribute named arguments
|
|
19
|
+
*/
|
|
20
|
+
public function attribute($name, array $args = []): Node\Attribute {
|
|
21
|
+
return new Node\Attribute(
|
|
22
|
+
BuilderHelpers::normalizeName($name),
|
|
23
|
+
$this->args($args)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
15
27
|
/**
|
|
16
28
|
* Creates a namespace builder.
|
|
17
29
|
*
|
|
@@ -19,7 +31,7 @@ class BuilderFactory
|
|
|
19
31
|
*
|
|
20
32
|
* @return Builder\Namespace_ The created namespace builder
|
|
21
33
|
*/
|
|
22
|
-
public function namespace($name)
|
|
34
|
+
public function namespace($name): Builder\Namespace_ {
|
|
23
35
|
return new Builder\Namespace_($name);
|
|
24
36
|
}
|
|
25
37
|
|
|
@@ -30,7 +42,7 @@ class BuilderFactory
|
|
|
30
42
|
*
|
|
31
43
|
* @return Builder\Class_ The created class builder
|
|
32
44
|
*/
|
|
33
|
-
public function class(string $name)
|
|
45
|
+
public function class(string $name): Builder\Class_ {
|
|
34
46
|
return new Builder\Class_($name);
|
|
35
47
|
}
|
|
36
48
|
|
|
@@ -41,7 +53,7 @@ class BuilderFactory
|
|
|
41
53
|
*
|
|
42
54
|
* @return Builder\Interface_ The created interface builder
|
|
43
55
|
*/
|
|
44
|
-
public function interface(string $name)
|
|
56
|
+
public function interface(string $name): Builder\Interface_ {
|
|
45
57
|
return new Builder\Interface_($name);
|
|
46
58
|
}
|
|
47
59
|
|
|
@@ -52,30 +64,41 @@ class BuilderFactory
|
|
|
52
64
|
*
|
|
53
65
|
* @return Builder\Trait_ The created trait builder
|
|
54
66
|
*/
|
|
55
|
-
public function trait(string $name)
|
|
67
|
+
public function trait(string $name): Builder\Trait_ {
|
|
56
68
|
return new Builder\Trait_($name);
|
|
57
69
|
}
|
|
58
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Creates an enum builder.
|
|
73
|
+
*
|
|
74
|
+
* @param string $name Name of the enum
|
|
75
|
+
*
|
|
76
|
+
* @return Builder\Enum_ The created enum builder
|
|
77
|
+
*/
|
|
78
|
+
public function enum(string $name): Builder\Enum_ {
|
|
79
|
+
return new Builder\Enum_($name);
|
|
80
|
+
}
|
|
81
|
+
|
|
59
82
|
/**
|
|
60
83
|
* Creates a trait use builder.
|
|
61
84
|
*
|
|
62
85
|
* @param Node\Name|string ...$traits Trait names
|
|
63
86
|
*
|
|
64
|
-
* @return Builder\TraitUse The
|
|
87
|
+
* @return Builder\TraitUse The created trait use builder
|
|
65
88
|
*/
|
|
66
|
-
public function useTrait(...$traits)
|
|
89
|
+
public function useTrait(...$traits): Builder\TraitUse {
|
|
67
90
|
return new Builder\TraitUse(...$traits);
|
|
68
91
|
}
|
|
69
92
|
|
|
70
93
|
/**
|
|
71
94
|
* Creates a trait use adaptation builder.
|
|
72
95
|
*
|
|
73
|
-
* @param Node\Name|string|null
|
|
96
|
+
* @param Node\Name|string|null $trait Trait name
|
|
74
97
|
* @param Node\Identifier|string $method Method name
|
|
75
98
|
*
|
|
76
|
-
* @return Builder\TraitUseAdaptation The
|
|
99
|
+
* @return Builder\TraitUseAdaptation The created trait use adaptation builder
|
|
77
100
|
*/
|
|
78
|
-
public function traitUseAdaptation($trait, $method = null)
|
|
101
|
+
public function traitUseAdaptation($trait, $method = null): Builder\TraitUseAdaptation {
|
|
79
102
|
if ($method === null) {
|
|
80
103
|
$method = $trait;
|
|
81
104
|
$trait = null;
|
|
@@ -91,7 +114,7 @@ class BuilderFactory
|
|
|
91
114
|
*
|
|
92
115
|
* @return Builder\Method The created method builder
|
|
93
116
|
*/
|
|
94
|
-
public function method(string $name)
|
|
117
|
+
public function method(string $name): Builder\Method {
|
|
95
118
|
return new Builder\Method($name);
|
|
96
119
|
}
|
|
97
120
|
|
|
@@ -102,7 +125,7 @@ class BuilderFactory
|
|
|
102
125
|
*
|
|
103
126
|
* @return Builder\Param The created parameter builder
|
|
104
127
|
*/
|
|
105
|
-
public function param(string $name)
|
|
128
|
+
public function param(string $name): Builder\Param {
|
|
106
129
|
return new Builder\Param($name);
|
|
107
130
|
}
|
|
108
131
|
|
|
@@ -113,7 +136,7 @@ class BuilderFactory
|
|
|
113
136
|
*
|
|
114
137
|
* @return Builder\Property The created property builder
|
|
115
138
|
*/
|
|
116
|
-
public function property(string $name)
|
|
139
|
+
public function property(string $name): Builder\Property {
|
|
117
140
|
return new Builder\Property($name);
|
|
118
141
|
}
|
|
119
142
|
|
|
@@ -124,7 +147,7 @@ class BuilderFactory
|
|
|
124
147
|
*
|
|
125
148
|
* @return Builder\Function_ The created function builder
|
|
126
149
|
*/
|
|
127
|
-
public function function(string $name)
|
|
150
|
+
public function function(string $name): Builder\Function_ {
|
|
128
151
|
return new Builder\Function_($name);
|
|
129
152
|
}
|
|
130
153
|
|
|
@@ -135,7 +158,7 @@ class BuilderFactory
|
|
|
135
158
|
*
|
|
136
159
|
* @return Builder\Use_ The created use builder
|
|
137
160
|
*/
|
|
138
|
-
public function use($name)
|
|
161
|
+
public function use($name): Builder\Use_ {
|
|
139
162
|
return new Builder\Use_($name, Use_::TYPE_NORMAL);
|
|
140
163
|
}
|
|
141
164
|
|
|
@@ -146,7 +169,7 @@ class BuilderFactory
|
|
|
146
169
|
*
|
|
147
170
|
* @return Builder\Use_ The created use function builder
|
|
148
171
|
*/
|
|
149
|
-
public function useFunction($name)
|
|
172
|
+
public function useFunction($name): Builder\Use_ {
|
|
150
173
|
return new Builder\Use_($name, Use_::TYPE_FUNCTION);
|
|
151
174
|
}
|
|
152
175
|
|
|
@@ -157,30 +180,39 @@ class BuilderFactory
|
|
|
157
180
|
*
|
|
158
181
|
* @return Builder\Use_ The created use const builder
|
|
159
182
|
*/
|
|
160
|
-
public function useConst($name)
|
|
183
|
+
public function useConst($name): Builder\Use_ {
|
|
161
184
|
return new Builder\Use_($name, Use_::TYPE_CONSTANT);
|
|
162
185
|
}
|
|
163
186
|
|
|
164
187
|
/**
|
|
165
188
|
* Creates a class constant builder.
|
|
166
189
|
*
|
|
167
|
-
* @param string|Identifier
|
|
190
|
+
* @param string|Identifier $name Name
|
|
168
191
|
* @param Node\Expr|bool|null|int|float|string|array $value Value
|
|
169
192
|
*
|
|
170
193
|
* @return Builder\ClassConst The created use const builder
|
|
171
194
|
*/
|
|
172
|
-
public function classConst($name, $value)
|
|
195
|
+
public function classConst($name, $value): Builder\ClassConst {
|
|
173
196
|
return new Builder\ClassConst($name, $value);
|
|
174
197
|
}
|
|
175
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Creates an enum case builder.
|
|
201
|
+
*
|
|
202
|
+
* @param string|Identifier $name Name
|
|
203
|
+
*
|
|
204
|
+
* @return Builder\EnumCase The created use const builder
|
|
205
|
+
*/
|
|
206
|
+
public function enumCase($name): Builder\EnumCase {
|
|
207
|
+
return new Builder\EnumCase($name);
|
|
208
|
+
}
|
|
209
|
+
|
|
176
210
|
/**
|
|
177
211
|
* Creates node a for a literal value.
|
|
178
212
|
*
|
|
179
213
|
* @param Expr|bool|null|int|float|string|array $value $value
|
|
180
|
-
*
|
|
181
|
-
* @return Expr
|
|
182
214
|
*/
|
|
183
|
-
public function val($value)
|
|
215
|
+
public function val($value): Expr {
|
|
184
216
|
return BuilderHelpers::normalizeValue($value);
|
|
185
217
|
}
|
|
186
218
|
|
|
@@ -188,10 +220,8 @@ class BuilderFactory
|
|
|
188
220
|
* Creates variable node.
|
|
189
221
|
*
|
|
190
222
|
* @param string|Expr $name Name
|
|
191
|
-
*
|
|
192
|
-
* @return Expr\Variable
|
|
193
223
|
*/
|
|
194
|
-
public function var($name)
|
|
224
|
+
public function var($name): Expr\Variable {
|
|
195
225
|
if (!\is_string($name) && !$name instanceof Expr) {
|
|
196
226
|
throw new \LogicException('Variable name must be string or Expr');
|
|
197
227
|
}
|
|
@@ -206,16 +236,18 @@ class BuilderFactory
|
|
|
206
236
|
*
|
|
207
237
|
* @param array $args List of arguments to normalize
|
|
208
238
|
*
|
|
209
|
-
* @return Arg
|
|
239
|
+
* @return list<Arg>
|
|
210
240
|
*/
|
|
211
|
-
public function args(array $args)
|
|
241
|
+
public function args(array $args): array {
|
|
212
242
|
$normalizedArgs = [];
|
|
213
|
-
foreach ($args as $arg) {
|
|
214
|
-
if ($arg instanceof Arg) {
|
|
215
|
-
$
|
|
216
|
-
}
|
|
217
|
-
|
|
243
|
+
foreach ($args as $key => $arg) {
|
|
244
|
+
if (!($arg instanceof Arg)) {
|
|
245
|
+
$arg = new Arg(BuilderHelpers::normalizeValue($arg));
|
|
246
|
+
}
|
|
247
|
+
if (\is_string($key)) {
|
|
248
|
+
$arg->name = BuilderHelpers::normalizeIdentifier($key);
|
|
218
249
|
}
|
|
250
|
+
$normalizedArgs[] = $arg;
|
|
219
251
|
}
|
|
220
252
|
return $normalizedArgs;
|
|
221
253
|
}
|
|
@@ -224,11 +256,9 @@ class BuilderFactory
|
|
|
224
256
|
* Creates a function call node.
|
|
225
257
|
*
|
|
226
258
|
* @param string|Name|Expr $name Function name
|
|
227
|
-
* @param array
|
|
228
|
-
*
|
|
229
|
-
* @return Expr\FuncCall
|
|
259
|
+
* @param array $args Function arguments
|
|
230
260
|
*/
|
|
231
|
-
public function funcCall($name, array $args = [])
|
|
261
|
+
public function funcCall($name, array $args = []): Expr\FuncCall {
|
|
232
262
|
return new Expr\FuncCall(
|
|
233
263
|
BuilderHelpers::normalizeNameOrExpr($name),
|
|
234
264
|
$this->args($args)
|
|
@@ -238,13 +268,11 @@ class BuilderFactory
|
|
|
238
268
|
/**
|
|
239
269
|
* Creates a method call node.
|
|
240
270
|
*
|
|
241
|
-
* @param Expr
|
|
271
|
+
* @param Expr $var Variable the method is called on
|
|
242
272
|
* @param string|Identifier|Expr $name Method name
|
|
243
|
-
* @param array
|
|
244
|
-
*
|
|
245
|
-
* @return Expr\MethodCall
|
|
273
|
+
* @param array $args Method arguments
|
|
246
274
|
*/
|
|
247
|
-
public function methodCall(Expr $var, $name, array $args = [])
|
|
275
|
+
public function methodCall(Expr $var, $name, array $args = []): Expr\MethodCall {
|
|
248
276
|
return new Expr\MethodCall(
|
|
249
277
|
$var,
|
|
250
278
|
BuilderHelpers::normalizeIdentifierOrExpr($name),
|
|
@@ -255,13 +283,11 @@ class BuilderFactory
|
|
|
255
283
|
/**
|
|
256
284
|
* Creates a static method call node.
|
|
257
285
|
*
|
|
258
|
-
* @param string|Name|Expr
|
|
259
|
-
* @param string|Identifier|Expr $name
|
|
260
|
-
* @param array
|
|
261
|
-
*
|
|
262
|
-
* @return Expr\StaticCall
|
|
286
|
+
* @param string|Name|Expr $class Class name
|
|
287
|
+
* @param string|Identifier|Expr $name Method name
|
|
288
|
+
* @param array $args Method arguments
|
|
263
289
|
*/
|
|
264
|
-
public function staticCall($class, $name, array $args = [])
|
|
290
|
+
public function staticCall($class, $name, array $args = []): Expr\StaticCall {
|
|
265
291
|
return new Expr\StaticCall(
|
|
266
292
|
BuilderHelpers::normalizeNameOrExpr($class),
|
|
267
293
|
BuilderHelpers::normalizeIdentifierOrExpr($name),
|
|
@@ -273,11 +299,9 @@ class BuilderFactory
|
|
|
273
299
|
* Creates an object creation node.
|
|
274
300
|
*
|
|
275
301
|
* @param string|Name|Expr $class Class name
|
|
276
|
-
* @param array
|
|
277
|
-
*
|
|
278
|
-
* @return Expr\New_
|
|
302
|
+
* @param array $args Constructor arguments
|
|
279
303
|
*/
|
|
280
|
-
public function new($class, array $args = [])
|
|
304
|
+
public function new($class, array $args = []): Expr\New_ {
|
|
281
305
|
return new Expr\New_(
|
|
282
306
|
BuilderHelpers::normalizeNameOrExpr($class),
|
|
283
307
|
$this->args($args)
|
|
@@ -288,37 +312,31 @@ class BuilderFactory
|
|
|
288
312
|
* Creates a constant fetch node.
|
|
289
313
|
*
|
|
290
314
|
* @param string|Name $name Constant name
|
|
291
|
-
*
|
|
292
|
-
* @return Expr\ConstFetch
|
|
293
315
|
*/
|
|
294
|
-
public function constFetch($name)
|
|
316
|
+
public function constFetch($name): Expr\ConstFetch {
|
|
295
317
|
return new Expr\ConstFetch(BuilderHelpers::normalizeName($name));
|
|
296
318
|
}
|
|
297
|
-
|
|
319
|
+
|
|
298
320
|
/**
|
|
299
321
|
* Creates a property fetch node.
|
|
300
322
|
*
|
|
301
|
-
* @param Expr
|
|
323
|
+
* @param Expr $var Variable holding object
|
|
302
324
|
* @param string|Identifier|Expr $name Property name
|
|
303
|
-
*
|
|
304
|
-
* @return Expr\PropertyFetch
|
|
305
325
|
*/
|
|
306
|
-
public function propertyFetch(Expr $var, $name)
|
|
326
|
+
public function propertyFetch(Expr $var, $name): Expr\PropertyFetch {
|
|
307
327
|
return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name));
|
|
308
328
|
}
|
|
309
329
|
|
|
310
330
|
/**
|
|
311
331
|
* Creates a class constant fetch node.
|
|
312
332
|
*
|
|
313
|
-
* @param string|Name|Expr
|
|
314
|
-
* @param string|Identifier $name
|
|
315
|
-
*
|
|
316
|
-
* @return Expr\ClassConstFetch
|
|
333
|
+
* @param string|Name|Expr $class Class name
|
|
334
|
+
* @param string|Identifier|Expr $name Constant name
|
|
317
335
|
*/
|
|
318
336
|
public function classConstFetch($class, $name): Expr\ClassConstFetch {
|
|
319
337
|
return new Expr\ClassConstFetch(
|
|
320
338
|
BuilderHelpers::normalizeNameOrExpr($class),
|
|
321
|
-
BuilderHelpers::
|
|
339
|
+
BuilderHelpers::normalizeIdentifierOrExpr($name)
|
|
322
340
|
);
|
|
323
341
|
}
|
|
324
342
|
|
|
@@ -326,10 +344,8 @@ class BuilderFactory
|
|
|
326
344
|
* Creates nested Concat nodes from a list of expressions.
|
|
327
345
|
*
|
|
328
346
|
* @param Expr|string ...$exprs Expressions or literal strings
|
|
329
|
-
*
|
|
330
|
-
* @return Concat
|
|
331
347
|
*/
|
|
332
|
-
public function concat(...$exprs)
|
|
348
|
+
public function concat(...$exprs): Concat {
|
|
333
349
|
$numExprs = count($exprs);
|
|
334
350
|
if ($numExprs < 2) {
|
|
335
351
|
throw new \LogicException('Expected at least two expressions');
|
|
@@ -344,9 +360,8 @@ class BuilderFactory
|
|
|
344
360
|
|
|
345
361
|
/**
|
|
346
362
|
* @param string|Expr $expr
|
|
347
|
-
* @return Expr
|
|
348
363
|
*/
|
|
349
|
-
private function normalizeStringExpr($expr)
|
|
364
|
+
private function normalizeStringExpr($expr): Expr {
|
|
350
365
|
if ($expr instanceof Expr) {
|
|
351
366
|
return $expr;
|
|
352
367
|
}
|
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
namespace PhpParser;
|
|
4
4
|
|
|
5
|
+
use PhpParser\Node\ComplexType;
|
|
5
6
|
use PhpParser\Node\Expr;
|
|
6
7
|
use PhpParser\Node\Identifier;
|
|
7
8
|
use PhpParser\Node\Name;
|
|
8
9
|
use PhpParser\Node\NullableType;
|
|
9
10
|
use PhpParser\Node\Scalar;
|
|
10
11
|
use PhpParser\Node\Stmt;
|
|
11
|
-
use PhpParser\Node\UnionType;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* This class defines helpers used in the implementation of builders. Don't use it directly.
|
|
15
15
|
*
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
|
-
final class BuilderHelpers
|
|
19
|
-
{
|
|
18
|
+
final class BuilderHelpers {
|
|
20
19
|
/**
|
|
21
20
|
* Normalizes a node: Converts builder objects to nodes.
|
|
22
21
|
*
|
|
@@ -24,10 +23,12 @@ final class BuilderHelpers
|
|
|
24
23
|
*
|
|
25
24
|
* @return Node The normalized node
|
|
26
25
|
*/
|
|
27
|
-
public static function normalizeNode($node)
|
|
26
|
+
public static function normalizeNode($node): Node {
|
|
28
27
|
if ($node instanceof Builder) {
|
|
29
28
|
return $node->getNode();
|
|
30
|
-
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if ($node instanceof Node) {
|
|
31
32
|
return $node;
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -43,7 +44,7 @@ final class BuilderHelpers
|
|
|
43
44
|
*
|
|
44
45
|
* @return Stmt The normalized statement node
|
|
45
46
|
*/
|
|
46
|
-
public static function normalizeStmt($node)
|
|
47
|
+
public static function normalizeStmt($node): Stmt {
|
|
47
48
|
$node = self::normalizeNode($node);
|
|
48
49
|
if ($node instanceof Stmt) {
|
|
49
50
|
return $node;
|
|
@@ -63,7 +64,7 @@ final class BuilderHelpers
|
|
|
63
64
|
*
|
|
64
65
|
* @return Identifier The normalized identifier
|
|
65
66
|
*/
|
|
66
|
-
public static function normalizeIdentifier($name)
|
|
67
|
+
public static function normalizeIdentifier($name): Identifier {
|
|
67
68
|
if ($name instanceof Identifier) {
|
|
68
69
|
return $name;
|
|
69
70
|
}
|
|
@@ -101,8 +102,28 @@ final class BuilderHelpers
|
|
|
101
102
|
*
|
|
102
103
|
* @return Name The normalized name
|
|
103
104
|
*/
|
|
104
|
-
public static function normalizeName($name)
|
|
105
|
-
|
|
105
|
+
public static function normalizeName($name): Name {
|
|
106
|
+
if ($name instanceof Name) {
|
|
107
|
+
return $name;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (is_string($name)) {
|
|
111
|
+
if (!$name) {
|
|
112
|
+
throw new \LogicException('Name cannot be empty');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if ($name[0] === '\\') {
|
|
116
|
+
return new Name\FullyQualified(substr($name, 1));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (0 === strpos($name, 'namespace\\')) {
|
|
120
|
+
return new Name\Relative(substr($name, strlen('namespace\\')));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return new Name($name);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
throw new \LogicException('Name must be a string or an instance of Node\Name');
|
|
106
127
|
}
|
|
107
128
|
|
|
108
129
|
/**
|
|
@@ -113,44 +134,17 @@ final class BuilderHelpers
|
|
|
113
134
|
* @return Name|Expr The normalized name or expression
|
|
114
135
|
*/
|
|
115
136
|
public static function normalizeNameOrExpr($name) {
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Normalizes a name: Converts string names to Name nodes, optionally allowing expressions.
|
|
121
|
-
*
|
|
122
|
-
* @param Expr|Name|string $name The name to normalize
|
|
123
|
-
* @param bool $allowExpr Whether to also allow expressions
|
|
124
|
-
*
|
|
125
|
-
* @return Name|Expr The normalized name, or expression (if allowed)
|
|
126
|
-
*/
|
|
127
|
-
private static function normalizeNameCommon($name, bool $allowExpr) {
|
|
128
|
-
if ($name instanceof Name) {
|
|
137
|
+
if ($name instanceof Expr) {
|
|
129
138
|
return $name;
|
|
130
|
-
} elseif (is_string($name)) {
|
|
131
|
-
if (!$name) {
|
|
132
|
-
throw new \LogicException('Name cannot be empty');
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if ($name[0] === '\\') {
|
|
136
|
-
return new Name\FullyQualified(substr($name, 1));
|
|
137
|
-
} elseif (0 === strpos($name, 'namespace\\')) {
|
|
138
|
-
return new Name\Relative(substr($name, strlen('namespace\\')));
|
|
139
|
-
} else {
|
|
140
|
-
return new Name($name);
|
|
141
|
-
}
|
|
142
139
|
}
|
|
143
140
|
|
|
144
|
-
if ($
|
|
145
|
-
if ($name instanceof Expr) {
|
|
146
|
-
return $name;
|
|
147
|
-
}
|
|
141
|
+
if (!is_string($name) && !($name instanceof Name)) {
|
|
148
142
|
throw new \LogicException(
|
|
149
143
|
'Name must be a string or an instance of Node\Name or Node\Expr'
|
|
150
144
|
);
|
|
151
|
-
} else {
|
|
152
|
-
throw new \LogicException('Name must be a string or an instance of Node\Name');
|
|
153
145
|
}
|
|
146
|
+
|
|
147
|
+
return self::normalizeName($name);
|
|
154
148
|
}
|
|
155
149
|
|
|
156
150
|
/**
|
|
@@ -159,18 +153,18 @@ final class BuilderHelpers
|
|
|
159
153
|
* In particular, builtin types become Identifiers, custom types become Names and nullables
|
|
160
154
|
* are wrapped in NullableType nodes.
|
|
161
155
|
*
|
|
162
|
-
* @param string|Name|Identifier|
|
|
156
|
+
* @param string|Name|Identifier|ComplexType $type The type to normalize
|
|
163
157
|
*
|
|
164
|
-
* @return Name|Identifier|
|
|
158
|
+
* @return Name|Identifier|ComplexType The normalized type
|
|
165
159
|
*/
|
|
166
160
|
public static function normalizeType($type) {
|
|
167
161
|
if (!is_string($type)) {
|
|
168
162
|
if (
|
|
169
163
|
!$type instanceof Name && !$type instanceof Identifier &&
|
|
170
|
-
!$type instanceof
|
|
164
|
+
!$type instanceof ComplexType
|
|
171
165
|
) {
|
|
172
166
|
throw new \LogicException(
|
|
173
|
-
'Type must be a string, or an instance of Name, Identifier
|
|
167
|
+
'Type must be a string, or an instance of Name, Identifier or ComplexType'
|
|
174
168
|
);
|
|
175
169
|
}
|
|
176
170
|
return $type;
|
|
@@ -183,7 +177,20 @@ final class BuilderHelpers
|
|
|
183
177
|
}
|
|
184
178
|
|
|
185
179
|
$builtinTypes = [
|
|
186
|
-
'array',
|
|
180
|
+
'array',
|
|
181
|
+
'callable',
|
|
182
|
+
'bool',
|
|
183
|
+
'int',
|
|
184
|
+
'float',
|
|
185
|
+
'string',
|
|
186
|
+
'iterable',
|
|
187
|
+
'void',
|
|
188
|
+
'object',
|
|
189
|
+
'null',
|
|
190
|
+
'false',
|
|
191
|
+
'mixed',
|
|
192
|
+
'never',
|
|
193
|
+
'true',
|
|
187
194
|
];
|
|
188
195
|
|
|
189
196
|
$lowerType = strtolower($type);
|
|
@@ -193,12 +200,11 @@ final class BuilderHelpers
|
|
|
193
200
|
$type = self::normalizeName($type);
|
|
194
201
|
}
|
|
195
202
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
throw new \LogicException('mixed type cannot be nullable');
|
|
203
|
+
$notNullableTypes = [
|
|
204
|
+
'void', 'mixed', 'never',
|
|
205
|
+
];
|
|
206
|
+
if ($nullable && in_array((string) $type, $notNullableTypes)) {
|
|
207
|
+
throw new \LogicException(sprintf('%s type cannot be nullable', $type));
|
|
202
208
|
}
|
|
203
209
|
|
|
204
210
|
return $nullable ? new NullableType($type) : $type;
|
|
@@ -212,35 +218,47 @@ final class BuilderHelpers
|
|
|
212
218
|
*
|
|
213
219
|
* @return Expr The normalized value
|
|
214
220
|
*/
|
|
215
|
-
public static function normalizeValue($value)
|
|
221
|
+
public static function normalizeValue($value): Expr {
|
|
216
222
|
if ($value instanceof Node\Expr) {
|
|
217
223
|
return $value;
|
|
218
|
-
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (is_null($value)) {
|
|
219
227
|
return new Expr\ConstFetch(
|
|
220
228
|
new Name('null')
|
|
221
229
|
);
|
|
222
|
-
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (is_bool($value)) {
|
|
223
233
|
return new Expr\ConstFetch(
|
|
224
234
|
new Name($value ? 'true' : 'false')
|
|
225
235
|
);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return new Scalar\
|
|
230
|
-
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (is_int($value)) {
|
|
239
|
+
return new Scalar\Int_($value);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (is_float($value)) {
|
|
243
|
+
return new Scalar\Float_($value);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (is_string($value)) {
|
|
231
247
|
return new Scalar\String_($value);
|
|
232
|
-
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (is_array($value)) {
|
|
233
251
|
$items = [];
|
|
234
252
|
$lastKey = -1;
|
|
235
253
|
foreach ($value as $itemKey => $itemValue) {
|
|
236
254
|
// for consecutive, numeric keys don't generate keys
|
|
237
255
|
if (null !== $lastKey && ++$lastKey === $itemKey) {
|
|
238
|
-
$items[] = new
|
|
256
|
+
$items[] = new Node\ArrayItem(
|
|
239
257
|
self::normalizeValue($itemValue)
|
|
240
258
|
);
|
|
241
259
|
} else {
|
|
242
260
|
$lastKey = null;
|
|
243
|
-
$items[] = new
|
|
261
|
+
$items[] = new Node\ArrayItem(
|
|
244
262
|
self::normalizeValue($itemValue),
|
|
245
263
|
self::normalizeValue($itemKey)
|
|
246
264
|
);
|
|
@@ -248,9 +266,9 @@ final class BuilderHelpers
|
|
|
248
266
|
}
|
|
249
267
|
|
|
250
268
|
return new Expr\Array_($items);
|
|
251
|
-
} else {
|
|
252
|
-
throw new \LogicException('Invalid value');
|
|
253
269
|
}
|
|
270
|
+
|
|
271
|
+
throw new \LogicException('Invalid value');
|
|
254
272
|
}
|
|
255
273
|
|
|
256
274
|
/**
|
|
@@ -260,26 +278,56 @@ final class BuilderHelpers
|
|
|
260
278
|
*
|
|
261
279
|
* @return Comment\Doc The normalized doc comment
|
|
262
280
|
*/
|
|
263
|
-
public static function normalizeDocComment($docComment)
|
|
281
|
+
public static function normalizeDocComment($docComment): Comment\Doc {
|
|
264
282
|
if ($docComment instanceof Comment\Doc) {
|
|
265
283
|
return $docComment;
|
|
266
|
-
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (is_string($docComment)) {
|
|
267
287
|
return new Comment\Doc($docComment);
|
|
268
|
-
} else {
|
|
269
|
-
throw new \LogicException('Doc comment must be a string or an instance of PhpParser\Comment\Doc');
|
|
270
288
|
}
|
|
289
|
+
|
|
290
|
+
throw new \LogicException('Doc comment must be a string or an instance of PhpParser\Comment\Doc');
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Normalizes a attribute: Converts attribute to the Attribute Group if needed.
|
|
295
|
+
*
|
|
296
|
+
* @param Node\Attribute|Node\AttributeGroup $attribute
|
|
297
|
+
*
|
|
298
|
+
* @return Node\AttributeGroup The Attribute Group
|
|
299
|
+
*/
|
|
300
|
+
public static function normalizeAttribute($attribute): Node\AttributeGroup {
|
|
301
|
+
if ($attribute instanceof Node\AttributeGroup) {
|
|
302
|
+
return $attribute;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (!($attribute instanceof Node\Attribute)) {
|
|
306
|
+
throw new \LogicException('Attribute must be an instance of PhpParser\Node\Attribute or PhpParser\Node\AttributeGroup');
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return new Node\AttributeGroup([$attribute]);
|
|
271
310
|
}
|
|
272
311
|
|
|
273
312
|
/**
|
|
274
313
|
* Adds a modifier and returns new modifier bitmask.
|
|
275
314
|
*
|
|
276
315
|
* @param int $modifiers Existing modifiers
|
|
277
|
-
* @param int $modifier
|
|
316
|
+
* @param int $modifier Modifier to set
|
|
278
317
|
*
|
|
279
318
|
* @return int New modifiers
|
|
280
319
|
*/
|
|
281
|
-
public static function addModifier(int $modifiers, int $modifier)
|
|
282
|
-
|
|
320
|
+
public static function addModifier(int $modifiers, int $modifier): int {
|
|
321
|
+
Modifiers::verifyModifier($modifiers, $modifier);
|
|
283
322
|
return $modifiers | $modifier;
|
|
284
323
|
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Adds a modifier and returns new modifier bitmask.
|
|
327
|
+
* @return int New modifiers
|
|
328
|
+
*/
|
|
329
|
+
public static function addClassModifier(int $existingModifiers, int $modifierToSet): int {
|
|
330
|
+
Modifiers::verifyClassModifier($existingModifiers, $modifierToSet);
|
|
331
|
+
return $existingModifiers | $modifierToSet;
|
|
332
|
+
}
|
|
285
333
|
}
|