@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,536 +2,115 @@
|
|
|
2
2
|
|
|
3
3
|
namespace PhpParser;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Lexer
|
|
8
|
-
{
|
|
9
|
-
protected $code;
|
|
10
|
-
protected $tokens;
|
|
11
|
-
protected $pos;
|
|
12
|
-
protected $line;
|
|
13
|
-
protected $filePos;
|
|
14
|
-
protected $prevCloseTagHasNewline;
|
|
15
|
-
|
|
16
|
-
protected $tokenMap;
|
|
17
|
-
protected $dropTokens;
|
|
18
|
-
protected $identifierTokens;
|
|
19
|
-
|
|
20
|
-
private $attributeStartLineUsed;
|
|
21
|
-
private $attributeEndLineUsed;
|
|
22
|
-
private $attributeStartTokenPosUsed;
|
|
23
|
-
private $attributeEndTokenPosUsed;
|
|
24
|
-
private $attributeStartFilePosUsed;
|
|
25
|
-
private $attributeEndFilePosUsed;
|
|
26
|
-
private $attributeCommentsUsed;
|
|
5
|
+
require __DIR__ . '/compatibility_tokens.php';
|
|
27
6
|
|
|
7
|
+
class Lexer {
|
|
28
8
|
/**
|
|
29
|
-
*
|
|
9
|
+
* Tokenize the provided source code.
|
|
30
10
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* 'endTokenPos', 'startFilePos', 'endFilePos'. The option defaults to the
|
|
35
|
-
* first three. For more info see getNextToken() docs.
|
|
36
|
-
*/
|
|
37
|
-
public function __construct(array $options = []) {
|
|
38
|
-
// Create Map from internal tokens to PhpParser tokens.
|
|
39
|
-
$this->defineCompatibilityTokens();
|
|
40
|
-
$this->tokenMap = $this->createTokenMap();
|
|
41
|
-
$this->identifierTokens = $this->createIdentifierTokenMap();
|
|
42
|
-
|
|
43
|
-
// map of tokens to drop while lexing (the map is only used for isset lookup,
|
|
44
|
-
// that's why the value is simply set to 1; the value is never actually used.)
|
|
45
|
-
$this->dropTokens = array_fill_keys(
|
|
46
|
-
[\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], 1
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
$defaultAttributes = ['comments', 'startLine', 'endLine'];
|
|
50
|
-
$usedAttributes = array_fill_keys($options['usedAttributes'] ?? $defaultAttributes, true);
|
|
51
|
-
|
|
52
|
-
// Create individual boolean properties to make these checks faster.
|
|
53
|
-
$this->attributeStartLineUsed = isset($usedAttributes['startLine']);
|
|
54
|
-
$this->attributeEndLineUsed = isset($usedAttributes['endLine']);
|
|
55
|
-
$this->attributeStartTokenPosUsed = isset($usedAttributes['startTokenPos']);
|
|
56
|
-
$this->attributeEndTokenPosUsed = isset($usedAttributes['endTokenPos']);
|
|
57
|
-
$this->attributeStartFilePosUsed = isset($usedAttributes['startFilePos']);
|
|
58
|
-
$this->attributeEndFilePosUsed = isset($usedAttributes['endFilePos']);
|
|
59
|
-
$this->attributeCommentsUsed = isset($usedAttributes['comments']);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Initializes the lexer for lexing the provided source code.
|
|
11
|
+
* The token array is in the same format as provided by the PhpToken::tokenize() method in
|
|
12
|
+
* PHP 8.0. The tokens are instances of PhpParser\Token, to abstract over a polyfill
|
|
13
|
+
* implementation in earlier PHP version.
|
|
64
14
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
15
|
+
* The token array is terminated by a sentinel token with token ID 0.
|
|
16
|
+
* The token array does not discard any tokens (i.e. whitespace and comments are included).
|
|
17
|
+
* The token position attributes are against this token array.
|
|
67
18
|
*
|
|
68
|
-
* @param string $code The source code to
|
|
19
|
+
* @param string $code The source code to tokenize.
|
|
69
20
|
* @param ErrorHandler|null $errorHandler Error handler to use for lexing errors. Defaults to
|
|
70
|
-
* ErrorHandler\Throwing
|
|
21
|
+
* ErrorHandler\Throwing.
|
|
22
|
+
* @return Token[] Tokens
|
|
71
23
|
*/
|
|
72
|
-
public function
|
|
24
|
+
public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array {
|
|
73
25
|
if (null === $errorHandler) {
|
|
74
26
|
$errorHandler = new ErrorHandler\Throwing();
|
|
75
27
|
}
|
|
76
28
|
|
|
77
|
-
$this->code = $code; // keep the code around for __halt_compiler() handling
|
|
78
|
-
$this->pos = -1;
|
|
79
|
-
$this->line = 1;
|
|
80
|
-
$this->filePos = 0;
|
|
81
|
-
|
|
82
|
-
// If inline HTML occurs without preceding code, treat it as if it had a leading newline.
|
|
83
|
-
// This ensures proper composability, because having a newline is the "safe" assumption.
|
|
84
|
-
$this->prevCloseTagHasNewline = true;
|
|
85
|
-
|
|
86
29
|
$scream = ini_set('xdebug.scream', '0');
|
|
87
30
|
|
|
88
|
-
$
|
|
89
|
-
$this->postprocessTokens($errorHandler);
|
|
31
|
+
$tokens = @Token::tokenize($code);
|
|
32
|
+
$this->postprocessTokens($tokens, $errorHandler);
|
|
90
33
|
|
|
91
34
|
if (false !== $scream) {
|
|
92
35
|
ini_set('xdebug.scream', $scream);
|
|
93
36
|
}
|
|
94
|
-
}
|
|
95
37
|
|
|
96
|
-
private function handleInvalidCharacterRange($start, $end, $line, ErrorHandler $errorHandler) {
|
|
97
|
-
$tokens = [];
|
|
98
|
-
for ($i = $start; $i < $end; $i++) {
|
|
99
|
-
$chr = $this->code[$i];
|
|
100
|
-
if ($chr === "\0") {
|
|
101
|
-
// PHP cuts error message after null byte, so need special case
|
|
102
|
-
$errorMsg = 'Unexpected null byte';
|
|
103
|
-
} else {
|
|
104
|
-
$errorMsg = sprintf(
|
|
105
|
-
'Unexpected character "%s" (ASCII %d)', $chr, ord($chr)
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
$tokens[] = [\T_BAD_CHARACTER, $chr, $line];
|
|
110
|
-
$errorHandler->handleError(new Error($errorMsg, [
|
|
111
|
-
'startLine' => $line,
|
|
112
|
-
'endLine' => $line,
|
|
113
|
-
'startFilePos' => $i,
|
|
114
|
-
'endFilePos' => $i,
|
|
115
|
-
]));
|
|
116
|
-
}
|
|
117
38
|
return $tokens;
|
|
118
39
|
}
|
|
119
40
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
protected function postprocessTokens(ErrorHandler $errorHandler) {
|
|
132
|
-
// PHP's error handling for token_get_all() is rather bad, so if we want detailed
|
|
133
|
-
// error information we need to compute it ourselves. Invalid character errors are
|
|
134
|
-
// detected by finding "gaps" in the token array. Unterminated comments are detected
|
|
135
|
-
// by checking if a trailing comment has a "*/" at the end.
|
|
136
|
-
//
|
|
137
|
-
// Additionally, we canonicalize to the PHP 8 comment format here, which does not include
|
|
138
|
-
// the trailing whitespace anymore.
|
|
139
|
-
//
|
|
140
|
-
// We also canonicalize to the PHP 8 T_NAME_* tokens.
|
|
141
|
-
|
|
142
|
-
$filePos = 0;
|
|
143
|
-
$line = 1;
|
|
144
|
-
$numTokens = \count($this->tokens);
|
|
145
|
-
for ($i = 0; $i < $numTokens; $i++) {
|
|
146
|
-
$token = $this->tokens[$i];
|
|
147
|
-
|
|
148
|
-
// Since PHP 7.4 invalid characters are represented by a T_BAD_CHARACTER token.
|
|
149
|
-
// In this case we only need to emit an error.
|
|
150
|
-
if ($token[0] === \T_BAD_CHARACTER) {
|
|
151
|
-
$this->handleInvalidCharacterRange($filePos, $filePos + 1, $line, $errorHandler);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if ($token[0] === \T_COMMENT && substr($token[1], 0, 2) !== '/*'
|
|
155
|
-
&& preg_match('/(\r\n|\n|\r)$/D', $token[1], $matches)) {
|
|
156
|
-
$trailingNewline = $matches[0];
|
|
157
|
-
$token[1] = substr($token[1], 0, -strlen($trailingNewline));
|
|
158
|
-
$this->tokens[$i] = $token;
|
|
159
|
-
if (isset($this->tokens[$i + 1]) && $this->tokens[$i + 1][0] === \T_WHITESPACE) {
|
|
160
|
-
// Move trailing newline into following T_WHITESPACE token, if it already exists.
|
|
161
|
-
$this->tokens[$i + 1][1] = $trailingNewline . $this->tokens[$i + 1][1];
|
|
162
|
-
$this->tokens[$i + 1][2]--;
|
|
163
|
-
} else {
|
|
164
|
-
// Otherwise, we need to create a new T_WHITESPACE token.
|
|
165
|
-
array_splice($this->tokens, $i + 1, 0, [
|
|
166
|
-
[\T_WHITESPACE, $trailingNewline, $line],
|
|
167
|
-
]);
|
|
168
|
-
$numTokens++;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Emulate PHP 8 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and T_STRING
|
|
173
|
-
// into a single token.
|
|
174
|
-
if (\is_array($token)
|
|
175
|
-
&& ($token[0] === \T_NS_SEPARATOR || isset($this->identifierTokens[$token[0]]))) {
|
|
176
|
-
$lastWasSeparator = $token[0] === \T_NS_SEPARATOR;
|
|
177
|
-
$text = $token[1];
|
|
178
|
-
for ($j = $i + 1; isset($this->tokens[$j]); $j++) {
|
|
179
|
-
if ($lastWasSeparator) {
|
|
180
|
-
if (!isset($this->identifierTokens[$this->tokens[$j][0]])) {
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
$lastWasSeparator = false;
|
|
184
|
-
} else {
|
|
185
|
-
if ($this->tokens[$j][0] !== \T_NS_SEPARATOR) {
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
$lastWasSeparator = true;
|
|
189
|
-
}
|
|
190
|
-
$text .= $this->tokens[$j][1];
|
|
191
|
-
}
|
|
192
|
-
if ($lastWasSeparator) {
|
|
193
|
-
// Trailing separator is not part of the name.
|
|
194
|
-
$j--;
|
|
195
|
-
$text = substr($text, 0, -1);
|
|
196
|
-
}
|
|
197
|
-
if ($j > $i + 1) {
|
|
198
|
-
if ($token[0] === \T_NS_SEPARATOR) {
|
|
199
|
-
$type = \T_NAME_FULLY_QUALIFIED;
|
|
200
|
-
} else if ($token[0] === \T_NAMESPACE) {
|
|
201
|
-
$type = \T_NAME_RELATIVE;
|
|
202
|
-
} else {
|
|
203
|
-
$type = \T_NAME_QUALIFIED;
|
|
204
|
-
}
|
|
205
|
-
$token = [$type, $text, $line];
|
|
206
|
-
array_splice($this->tokens, $i, $j - $i, [$token]);
|
|
207
|
-
$numTokens -= $j - $i - 1;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
$tokenValue = \is_string($token) ? $token : $token[1];
|
|
212
|
-
$tokenLen = \strlen($tokenValue);
|
|
213
|
-
|
|
214
|
-
if (substr($this->code, $filePos, $tokenLen) !== $tokenValue) {
|
|
215
|
-
// Something is missing, must be an invalid character
|
|
216
|
-
$nextFilePos = strpos($this->code, $tokenValue, $filePos);
|
|
217
|
-
$badCharTokens = $this->handleInvalidCharacterRange(
|
|
218
|
-
$filePos, $nextFilePos, $line, $errorHandler);
|
|
219
|
-
$filePos = (int) $nextFilePos;
|
|
220
|
-
|
|
221
|
-
array_splice($this->tokens, $i, 0, $badCharTokens);
|
|
222
|
-
$numTokens += \count($badCharTokens);
|
|
223
|
-
$i += \count($badCharTokens);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
$filePos += $tokenLen;
|
|
227
|
-
$line += substr_count($tokenValue, "\n");
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if ($filePos !== \strlen($this->code)) {
|
|
231
|
-
if (substr($this->code, $filePos, 2) === '/*') {
|
|
232
|
-
// Unlike PHP, HHVM will drop unterminated comments entirely
|
|
233
|
-
$comment = substr($this->code, $filePos);
|
|
234
|
-
$errorHandler->handleError(new Error('Unterminated comment', [
|
|
235
|
-
'startLine' => $line,
|
|
236
|
-
'endLine' => $line + substr_count($comment, "\n"),
|
|
237
|
-
'startFilePos' => $filePos,
|
|
238
|
-
'endFilePos' => $filePos + \strlen($comment),
|
|
239
|
-
]));
|
|
240
|
-
|
|
241
|
-
// Emulate the PHP behavior
|
|
242
|
-
$isDocComment = isset($comment[3]) && $comment[3] === '*';
|
|
243
|
-
$this->tokens[] = [$isDocComment ? \T_DOC_COMMENT : \T_COMMENT, $comment, $line];
|
|
244
|
-
} else {
|
|
245
|
-
// Invalid characters at the end of the input
|
|
246
|
-
$badCharTokens = $this->handleInvalidCharacterRange(
|
|
247
|
-
$filePos, \strlen($this->code), $line, $errorHandler);
|
|
248
|
-
$this->tokens = array_merge($this->tokens, $badCharTokens);
|
|
249
|
-
}
|
|
250
|
-
return;
|
|
41
|
+
private function handleInvalidCharacter(Token $token, ErrorHandler $errorHandler): void {
|
|
42
|
+
$chr = $token->text;
|
|
43
|
+
if ($chr === "\0") {
|
|
44
|
+
// PHP cuts error message after null byte, so need special case
|
|
45
|
+
$errorMsg = 'Unexpected null byte';
|
|
46
|
+
} else {
|
|
47
|
+
$errorMsg = sprintf(
|
|
48
|
+
'Unexpected character "%s" (ASCII %d)', $chr, ord($chr)
|
|
49
|
+
);
|
|
251
50
|
}
|
|
252
51
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
'endLine' => $line,
|
|
260
|
-
'startFilePos' => $filePos - \strlen($lastToken[1]),
|
|
261
|
-
'endFilePos' => $filePos,
|
|
262
|
-
]));
|
|
263
|
-
}
|
|
264
|
-
}
|
|
52
|
+
$errorHandler->handleError(new Error($errorMsg, [
|
|
53
|
+
'startLine' => $token->line,
|
|
54
|
+
'endLine' => $token->line,
|
|
55
|
+
'startFilePos' => $token->pos,
|
|
56
|
+
'endFilePos' => $token->pos,
|
|
57
|
+
]));
|
|
265
58
|
}
|
|
266
59
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
* be specified in the constructor. The following attributes are supported:
|
|
272
|
-
*
|
|
273
|
-
* * 'comments' => Array of PhpParser\Comment or PhpParser\Comment\Doc instances,
|
|
274
|
-
* representing all comments that occurred between the previous
|
|
275
|
-
* non-discarded token and the current one.
|
|
276
|
-
* * 'startLine' => Line in which the node starts.
|
|
277
|
-
* * 'endLine' => Line in which the node ends.
|
|
278
|
-
* * 'startTokenPos' => Offset into the token array of the first token in the node.
|
|
279
|
-
* * 'endTokenPos' => Offset into the token array of the last token in the node.
|
|
280
|
-
* * 'startFilePos' => Offset into the code string of the first character that is part of the node.
|
|
281
|
-
* * 'endFilePos' => Offset into the code string of the last character that is part of the node.
|
|
282
|
-
*
|
|
283
|
-
* @param mixed $value Variable to store token content in
|
|
284
|
-
* @param mixed $startAttributes Variable to store start attributes in
|
|
285
|
-
* @param mixed $endAttributes Variable to store end attributes in
|
|
286
|
-
*
|
|
287
|
-
* @return int Token id
|
|
288
|
-
*/
|
|
289
|
-
public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int {
|
|
290
|
-
$startAttributes = [];
|
|
291
|
-
$endAttributes = [];
|
|
292
|
-
|
|
293
|
-
while (1) {
|
|
294
|
-
if (isset($this->tokens[++$this->pos])) {
|
|
295
|
-
$token = $this->tokens[$this->pos];
|
|
296
|
-
} else {
|
|
297
|
-
// EOF token with ID 0
|
|
298
|
-
$token = "\0";
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if ($this->attributeStartLineUsed) {
|
|
302
|
-
$startAttributes['startLine'] = $this->line;
|
|
303
|
-
}
|
|
304
|
-
if ($this->attributeStartTokenPosUsed) {
|
|
305
|
-
$startAttributes['startTokenPos'] = $this->pos;
|
|
306
|
-
}
|
|
307
|
-
if ($this->attributeStartFilePosUsed) {
|
|
308
|
-
$startAttributes['startFilePos'] = $this->filePos;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
if (\is_string($token)) {
|
|
312
|
-
$value = $token;
|
|
313
|
-
if (isset($token[1])) {
|
|
314
|
-
// bug in token_get_all
|
|
315
|
-
$this->filePos += 2;
|
|
316
|
-
$id = ord('"');
|
|
317
|
-
} else {
|
|
318
|
-
$this->filePos += 1;
|
|
319
|
-
$id = ord($token);
|
|
320
|
-
}
|
|
321
|
-
} elseif (!isset($this->dropTokens[$token[0]])) {
|
|
322
|
-
$value = $token[1];
|
|
323
|
-
$id = $this->tokenMap[$token[0]];
|
|
324
|
-
if (\T_CLOSE_TAG === $token[0]) {
|
|
325
|
-
$this->prevCloseTagHasNewline = false !== strpos($token[1], "\n")
|
|
326
|
-
|| false !== strpos($token[1], "\r");
|
|
327
|
-
} elseif (\T_INLINE_HTML === $token[0]) {
|
|
328
|
-
$startAttributes['hasLeadingNewline'] = $this->prevCloseTagHasNewline;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
$this->line += substr_count($value, "\n");
|
|
332
|
-
$this->filePos += \strlen($value);
|
|
333
|
-
} else {
|
|
334
|
-
$origLine = $this->line;
|
|
335
|
-
$origFilePos = $this->filePos;
|
|
336
|
-
$this->line += substr_count($token[1], "\n");
|
|
337
|
-
$this->filePos += \strlen($token[1]);
|
|
338
|
-
|
|
339
|
-
if (\T_COMMENT === $token[0] || \T_DOC_COMMENT === $token[0]) {
|
|
340
|
-
if ($this->attributeCommentsUsed) {
|
|
341
|
-
$comment = \T_DOC_COMMENT === $token[0]
|
|
342
|
-
? new Comment\Doc($token[1],
|
|
343
|
-
$origLine, $origFilePos, $this->pos,
|
|
344
|
-
$this->line, $this->filePos - 1, $this->pos)
|
|
345
|
-
: new Comment($token[1],
|
|
346
|
-
$origLine, $origFilePos, $this->pos,
|
|
347
|
-
$this->line, $this->filePos - 1, $this->pos);
|
|
348
|
-
$startAttributes['comments'][] = $comment;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
continue;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
if ($this->attributeEndLineUsed) {
|
|
355
|
-
$endAttributes['endLine'] = $this->line;
|
|
356
|
-
}
|
|
357
|
-
if ($this->attributeEndTokenPosUsed) {
|
|
358
|
-
$endAttributes['endTokenPos'] = $this->pos;
|
|
359
|
-
}
|
|
360
|
-
if ($this->attributeEndFilePosUsed) {
|
|
361
|
-
$endAttributes['endFilePos'] = $this->filePos - 1;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
return $id;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
throw new \RuntimeException('Reached end of lexer loop');
|
|
60
|
+
private function isUnterminatedComment(Token $token): bool {
|
|
61
|
+
return $token->is([\T_COMMENT, \T_DOC_COMMENT])
|
|
62
|
+
&& substr($token->text, 0, 2) === '/*'
|
|
63
|
+
&& substr($token->text, -2) !== '*/';
|
|
368
64
|
}
|
|
369
65
|
|
|
370
66
|
/**
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* The token array is in the same format as provided by the
|
|
374
|
-
* token_get_all() function and does not discard tokens (i.e.
|
|
375
|
-
* whitespace and comments are included). The token position
|
|
376
|
-
* attributes are against this token array.
|
|
377
|
-
*
|
|
378
|
-
* @return array Array of tokens in token_get_all() format
|
|
379
|
-
*/
|
|
380
|
-
public function getTokens() : array {
|
|
381
|
-
return $this->tokens;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Handles __halt_compiler() by returning the text after it.
|
|
386
|
-
*
|
|
387
|
-
* @return string Remaining text
|
|
67
|
+
* @param list<Token> $tokens
|
|
388
68
|
*/
|
|
389
|
-
|
|
390
|
-
//
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
//
|
|
394
|
-
//
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
// prevent the lexer from returning any further tokens
|
|
401
|
-
$this->pos = count($this->tokens);
|
|
402
|
-
|
|
403
|
-
// return with (); removed
|
|
404
|
-
return substr($textAfter, strlen($matches[0]));
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
private function defineCompatibilityTokens() {
|
|
408
|
-
static $compatTokensDefined = false;
|
|
409
|
-
if ($compatTokensDefined) {
|
|
69
|
+
protected function postprocessTokens(array &$tokens, ErrorHandler $errorHandler): void {
|
|
70
|
+
// This function reports errors (bad characters and unterminated comments) in the token
|
|
71
|
+
// array, and performs certain canonicalizations:
|
|
72
|
+
// * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and
|
|
73
|
+
// T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types.
|
|
74
|
+
// * Add a sentinel token with ID 0.
|
|
75
|
+
|
|
76
|
+
$numTokens = \count($tokens);
|
|
77
|
+
if ($numTokens === 0) {
|
|
78
|
+
// Empty input edge case: Just add the sentinel token.
|
|
79
|
+
$tokens[] = new Token(0, "\0", 1, 0);
|
|
410
80
|
return;
|
|
411
81
|
}
|
|
412
82
|
|
|
413
|
-
$
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
'T_COALESCE_EQUAL',
|
|
418
|
-
// PHP 8.0
|
|
419
|
-
'T_NAME_QUALIFIED',
|
|
420
|
-
'T_NAME_FULLY_QUALIFIED',
|
|
421
|
-
'T_NAME_RELATIVE',
|
|
422
|
-
'T_MATCH',
|
|
423
|
-
'T_NULLSAFE_OBJECT_OPERATOR',
|
|
424
|
-
'T_ATTRIBUTE',
|
|
425
|
-
// PHP 8.1
|
|
426
|
-
'T_ENUM',
|
|
427
|
-
];
|
|
428
|
-
|
|
429
|
-
// PHP-Parser might be used together with another library that also emulates some or all
|
|
430
|
-
// of these tokens. Perform a sanity-check that all already defined tokens have been
|
|
431
|
-
// assigned a unique ID.
|
|
432
|
-
$usedTokenIds = [];
|
|
433
|
-
foreach ($compatTokens as $token) {
|
|
434
|
-
if (\defined($token)) {
|
|
435
|
-
$tokenId = \constant($token);
|
|
436
|
-
$clashingToken = $usedTokenIds[$tokenId] ?? null;
|
|
437
|
-
if ($clashingToken !== null) {
|
|
438
|
-
throw new \Error(sprintf(
|
|
439
|
-
'Token %s has same ID as token %s, ' .
|
|
440
|
-
'you may be using a library with broken token emulation',
|
|
441
|
-
$token, $clashingToken
|
|
442
|
-
));
|
|
443
|
-
}
|
|
444
|
-
$usedTokenIds[$tokenId] = $token;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
// Now define any tokens that have not yet been emulated. Try to assign IDs from -1
|
|
449
|
-
// downwards, but skip any IDs that may already be in use.
|
|
450
|
-
$newTokenId = -1;
|
|
451
|
-
foreach ($compatTokens as $token) {
|
|
452
|
-
if (!\defined($token)) {
|
|
453
|
-
while (isset($usedTokenIds[$newTokenId])) {
|
|
454
|
-
$newTokenId--;
|
|
455
|
-
}
|
|
456
|
-
\define($token, $newTokenId);
|
|
457
|
-
$newTokenId--;
|
|
83
|
+
for ($i = 0; $i < $numTokens; $i++) {
|
|
84
|
+
$token = $tokens[$i];
|
|
85
|
+
if ($token->id === \T_BAD_CHARACTER) {
|
|
86
|
+
$this->handleInvalidCharacter($token, $errorHandler);
|
|
458
87
|
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
$compatTokensDefined = true;
|
|
462
|
-
}
|
|
463
88
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
* to the identifiers used by the Parser. Additionally it
|
|
469
|
-
* maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'.
|
|
470
|
-
*
|
|
471
|
-
* @return array The token map
|
|
472
|
-
*/
|
|
473
|
-
protected function createTokenMap() : array {
|
|
474
|
-
$tokenMap = [];
|
|
475
|
-
|
|
476
|
-
// 256 is the minimum possible token number, as everything below
|
|
477
|
-
// it is an ASCII value
|
|
478
|
-
for ($i = 256; $i < 1000; ++$i) {
|
|
479
|
-
if (\T_DOUBLE_COLON === $i) {
|
|
480
|
-
// T_DOUBLE_COLON is equivalent to T_PAAMAYIM_NEKUDOTAYIM
|
|
481
|
-
$tokenMap[$i] = Tokens::T_PAAMAYIM_NEKUDOTAYIM;
|
|
482
|
-
} elseif(\T_OPEN_TAG_WITH_ECHO === $i) {
|
|
483
|
-
// T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO
|
|
484
|
-
$tokenMap[$i] = Tokens::T_ECHO;
|
|
485
|
-
} elseif(\T_CLOSE_TAG === $i) {
|
|
486
|
-
// T_CLOSE_TAG is equivalent to ';'
|
|
487
|
-
$tokenMap[$i] = ord(';');
|
|
488
|
-
} elseif ('UNKNOWN' !== $name = token_name($i)) {
|
|
489
|
-
if ('T_HASHBANG' === $name) {
|
|
490
|
-
// HHVM uses a special token for #! hashbang lines
|
|
491
|
-
$tokenMap[$i] = Tokens::T_INLINE_HTML;
|
|
492
|
-
} elseif (defined($name = Tokens::class . '::' . $name)) {
|
|
493
|
-
// Other tokens can be mapped directly
|
|
494
|
-
$tokenMap[$i] = constant($name);
|
|
89
|
+
if ($token->id === \ord('&')) {
|
|
90
|
+
$next = $i + 1;
|
|
91
|
+
while (isset($tokens[$next]) && $tokens[$next]->id === \T_WHITESPACE) {
|
|
92
|
+
$next++;
|
|
495
93
|
}
|
|
94
|
+
$followedByVarOrVarArg = isset($tokens[$next]) &&
|
|
95
|
+
$tokens[$next]->is([\T_VARIABLE, \T_ELLIPSIS]);
|
|
96
|
+
$token->id = $followedByVarOrVarArg
|
|
97
|
+
? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
|
|
98
|
+
: \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG;
|
|
496
99
|
}
|
|
497
100
|
}
|
|
498
101
|
|
|
499
|
-
//
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
102
|
+
// Check for unterminated comment
|
|
103
|
+
$lastToken = $tokens[$numTokens - 1];
|
|
104
|
+
if ($this->isUnterminatedComment($lastToken)) {
|
|
105
|
+
$errorHandler->handleError(new Error('Unterminated comment', [
|
|
106
|
+
'startLine' => $lastToken->line,
|
|
107
|
+
'endLine' => $lastToken->getEndLine(),
|
|
108
|
+
'startFilePos' => $lastToken->pos,
|
|
109
|
+
'endFilePos' => $lastToken->getEndPos(),
|
|
110
|
+
]));
|
|
506
111
|
}
|
|
507
112
|
|
|
508
|
-
//
|
|
509
|
-
$
|
|
510
|
-
$tokenMap[\T_COALESCE_EQUAL] = Tokens::T_COALESCE_EQUAL;
|
|
511
|
-
$tokenMap[\T_NAME_QUALIFIED] = Tokens::T_NAME_QUALIFIED;
|
|
512
|
-
$tokenMap[\T_NAME_FULLY_QUALIFIED] = Tokens::T_NAME_FULLY_QUALIFIED;
|
|
513
|
-
$tokenMap[\T_NAME_RELATIVE] = Tokens::T_NAME_RELATIVE;
|
|
514
|
-
$tokenMap[\T_MATCH] = Tokens::T_MATCH;
|
|
515
|
-
$tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = Tokens::T_NULLSAFE_OBJECT_OPERATOR;
|
|
516
|
-
$tokenMap[\T_ATTRIBUTE] = Tokens::T_ATTRIBUTE;
|
|
517
|
-
$tokenMap[\T_ENUM] = Tokens::T_ENUM;
|
|
518
|
-
|
|
519
|
-
return $tokenMap;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
private function createIdentifierTokenMap(): array {
|
|
523
|
-
// Based on semi_reserved production.
|
|
524
|
-
return array_fill_keys([
|
|
525
|
-
\T_STRING,
|
|
526
|
-
\T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC,
|
|
527
|
-
\T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND,
|
|
528
|
-
\T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE,
|
|
529
|
-
\T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH,
|
|
530
|
-
\T_FINALLY, \T_THROW, \T_USE, \T_INSTEADOF, \T_GLOBAL, \T_VAR, \T_UNSET, \T_ISSET, \T_EMPTY, \T_CONTINUE, \T_GOTO,
|
|
531
|
-
\T_FUNCTION, \T_CONST, \T_RETURN, \T_PRINT, \T_YIELD, \T_LIST, \T_SWITCH, \T_ENDSWITCH, \T_CASE, \T_DEFAULT,
|
|
532
|
-
\T_BREAK, \T_ARRAY, \T_CALLABLE, \T_EXTENDS, \T_IMPLEMENTS, \T_NAMESPACE, \T_TRAIT, \T_INTERFACE, \T_CLASS,
|
|
533
|
-
\T_CLASS_C, \T_TRAIT_C, \T_FUNC_C, \T_METHOD_C, \T_LINE, \T_FILE, \T_DIR, \T_NS_C, \T_HALT_COMPILER, \T_FN,
|
|
534
|
-
\T_MATCH,
|
|
535
|
-
], true);
|
|
113
|
+
// Add sentinel token.
|
|
114
|
+
$tokens[] = new Token(0, "\0", $lastToken->getEndLine(), $lastToken->getEndPos());
|
|
536
115
|
}
|
|
537
116
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Modifiers used (as a bit mask) by various flags subnodes, for example on classes, functions,
|
|
7
|
+
* properties and constants.
|
|
8
|
+
*/
|
|
9
|
+
final class Modifiers {
|
|
10
|
+
public const PUBLIC = 1;
|
|
11
|
+
public const PROTECTED = 2;
|
|
12
|
+
public const PRIVATE = 4;
|
|
13
|
+
public const STATIC = 8;
|
|
14
|
+
public const ABSTRACT = 16;
|
|
15
|
+
public const FINAL = 32;
|
|
16
|
+
public const READONLY = 64;
|
|
17
|
+
|
|
18
|
+
public const VISIBILITY_MASK = 1 | 2 | 4;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
public static function verifyClassModifier(int $a, int $b): void {
|
|
24
|
+
if ($a & Modifiers::ABSTRACT && $b & Modifiers::ABSTRACT) {
|
|
25
|
+
throw new Error('Multiple abstract modifiers are not allowed');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if ($a & Modifiers::FINAL && $b & Modifiers::FINAL) {
|
|
29
|
+
throw new Error('Multiple final modifiers are not allowed');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if ($a & Modifiers::READONLY && $b & Modifiers::READONLY) {
|
|
33
|
+
throw new Error('Multiple readonly modifiers are not allowed');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if ($a & 48 && $b & 48) {
|
|
37
|
+
throw new Error('Cannot use the final modifier on an abstract class');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
public static function verifyModifier(int $a, int $b): void {
|
|
45
|
+
if ($a & Modifiers::VISIBILITY_MASK && $b & Modifiers::VISIBILITY_MASK) {
|
|
46
|
+
throw new Error('Multiple access type modifiers are not allowed');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if ($a & Modifiers::ABSTRACT && $b & Modifiers::ABSTRACT) {
|
|
50
|
+
throw new Error('Multiple abstract modifiers are not allowed');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if ($a & Modifiers::STATIC && $b & Modifiers::STATIC) {
|
|
54
|
+
throw new Error('Multiple static modifiers are not allowed');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if ($a & Modifiers::FINAL && $b & Modifiers::FINAL) {
|
|
58
|
+
throw new Error('Multiple final modifiers are not allowed');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if ($a & Modifiers::READONLY && $b & Modifiers::READONLY) {
|
|
62
|
+
throw new Error('Multiple readonly modifiers are not allowed');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if ($a & 48 && $b & 48) {
|
|
66
|
+
throw new Error('Cannot use the final modifier on an abstract class member');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|