Update to Kirby 5

This commit is contained in:
Paul Nicoué 2025-07-11 14:41:34 +02:00
parent 5d9979fca8
commit 0fefc5e2e1
472 changed files with 30853 additions and 10301 deletions

View file

@ -23,23 +23,16 @@ return array(
'Composer\\Semver\\VersionParser' => $vendorDir . '/composer/semver/src/VersionParser.php',
'Kirby\\Api\\Api' => $baseDir . '/src/Api/Api.php',
'Kirby\\Api\\Collection' => $baseDir . '/src/Api/Collection.php',
'Kirby\\Api\\Controller\\Changes' => $baseDir . '/src/Api/Controller/Changes.php',
'Kirby\\Api\\Model' => $baseDir . '/src/Api/Model.php',
'Kirby\\Blueprint\\Collection' => $baseDir . '/src/Blueprint/Collection.php',
'Kirby\\Blueprint\\Config' => $baseDir . '/src/Blueprint/Config.php',
'Kirby\\Blueprint\\Extension' => $baseDir . '/src/Blueprint/Extension.php',
'Kirby\\Blueprint\\Factory' => $baseDir . '/src/Blueprint/Factory.php',
'Kirby\\Blueprint\\Node' => $baseDir . '/src/Blueprint/Node.php',
'Kirby\\Blueprint\\NodeI18n' => $baseDir . '/src/Blueprint/NodeI18n.php',
'Kirby\\Blueprint\\NodeIcon' => $baseDir . '/src/Blueprint/NodeIcon.php',
'Kirby\\Blueprint\\NodeProperty' => $baseDir . '/src/Blueprint/NodeProperty.php',
'Kirby\\Blueprint\\NodeString' => $baseDir . '/src/Blueprint/NodeString.php',
'Kirby\\Blueprint\\NodeText' => $baseDir . '/src/Blueprint/NodeText.php',
'Kirby\\Api\\Upload' => $baseDir . '/src/Api/Upload.php',
'Kirby\\Cache\\ApcuCache' => $baseDir . '/src/Cache/ApcuCache.php',
'Kirby\\Cache\\Cache' => $baseDir . '/src/Cache/Cache.php',
'Kirby\\Cache\\FileCache' => $baseDir . '/src/Cache/FileCache.php',
'Kirby\\Cache\\MemCached' => $baseDir . '/src/Cache/MemCached.php',
'Kirby\\Cache\\MemoryCache' => $baseDir . '/src/Cache/MemoryCache.php',
'Kirby\\Cache\\NullCache' => $baseDir . '/src/Cache/NullCache.php',
'Kirby\\Cache\\RedisCache' => $baseDir . '/src/Cache/RedisCache.php',
'Kirby\\Cache\\Value' => $baseDir . '/src/Cache/Value.php',
'Kirby\\Cms\\Api' => $baseDir . '/src/Cms/Api.php',
'Kirby\\Cms\\App' => $baseDir . '/src/Cms/App.php',
@ -59,11 +52,10 @@ return array(
'Kirby\\Cms\\Blueprint' => $baseDir . '/src/Cms/Blueprint.php',
'Kirby\\Cms\\Collection' => $baseDir . '/src/Cms/Collection.php',
'Kirby\\Cms\\Collections' => $baseDir . '/src/Cms/Collections.php',
'Kirby\\Cms\\ContentLock' => $baseDir . '/src/Cms/ContentLock.php',
'Kirby\\Cms\\ContentLocks' => $baseDir . '/src/Cms/ContentLocks.php',
'Kirby\\Cms\\Core' => $baseDir . '/src/Cms/Core.php',
'Kirby\\Cms\\Email' => $baseDir . '/src/Cms/Email.php',
'Kirby\\Cms\\Event' => $baseDir . '/src/Cms/Event.php',
'Kirby\\Cms\\Events' => $baseDir . '/src/Cms/Events.php',
'Kirby\\Cms\\Fieldset' => $baseDir . '/src/Cms/Fieldset.php',
'Kirby\\Cms\\Fieldsets' => $baseDir . '/src/Cms/Fieldsets.php',
'Kirby\\Cms\\File' => $baseDir . '/src/Cms/File.php',
@ -79,6 +71,7 @@ return array(
'Kirby\\Cms\\HasChildren' => $baseDir . '/src/Cms/HasChildren.php',
'Kirby\\Cms\\HasFiles' => $baseDir . '/src/Cms/HasFiles.php',
'Kirby\\Cms\\HasMethods' => $baseDir . '/src/Cms/HasMethods.php',
'Kirby\\Cms\\HasModels' => $baseDir . '/src/Cms/HasModels.php',
'Kirby\\Cms\\HasSiblings' => $baseDir . '/src/Cms/HasSiblings.php',
'Kirby\\Cms\\Helpers' => $baseDir . '/src/Cms/Helpers.php',
'Kirby\\Cms\\Html' => $baseDir . '/src/Cms/Html.php',
@ -86,6 +79,7 @@ return array(
'Kirby\\Cms\\Item' => $baseDir . '/src/Cms/Item.php',
'Kirby\\Cms\\Items' => $baseDir . '/src/Cms/Items.php',
'Kirby\\Cms\\Language' => $baseDir . '/src/Cms/Language.php',
'Kirby\\Cms\\LanguagePermissions' => $baseDir . '/src/Cms/LanguagePermissions.php',
'Kirby\\Cms\\LanguageRouter' => $baseDir . '/src/Cms/LanguageRouter.php',
'Kirby\\Cms\\LanguageRoutes' => $baseDir . '/src/Cms/LanguageRoutes.php',
'Kirby\\Cms\\LanguageRules' => $baseDir . '/src/Cms/LanguageRules.php',
@ -100,8 +94,9 @@ return array(
'Kirby\\Cms\\LicenseType' => $baseDir . '/src/Cms/LicenseType.php',
'Kirby\\Cms\\Loader' => $baseDir . '/src/Cms/Loader.php',
'Kirby\\Cms\\Media' => $baseDir . '/src/Cms/Media.php',
'Kirby\\Cms\\Model' => $baseDir . '/src/Cms/Model.php',
'Kirby\\Cms\\ModelCommit' => $baseDir . '/src/Cms/ModelCommit.php',
'Kirby\\Cms\\ModelPermissions' => $baseDir . '/src/Cms/ModelPermissions.php',
'Kirby\\Cms\\ModelState' => $baseDir . '/src/Cms/ModelState.php',
'Kirby\\Cms\\ModelWithContent' => $baseDir . '/src/Cms/ModelWithContent.php',
'Kirby\\Cms\\Nest' => $baseDir . '/src/Cms/Nest.php',
'Kirby\\Cms\\NestCollection' => $baseDir . '/src/Cms/NestCollection.php',
@ -109,6 +104,7 @@ return array(
'Kirby\\Cms\\Page' => $baseDir . '/src/Cms/Page.php',
'Kirby\\Cms\\PageActions' => $baseDir . '/src/Cms/PageActions.php',
'Kirby\\Cms\\PageBlueprint' => $baseDir . '/src/Cms/PageBlueprint.php',
'Kirby\\Cms\\PageCopy' => $baseDir . '/src/Cms/PageCopy.php',
'Kirby\\Cms\\PagePermissions' => $baseDir . '/src/Cms/PagePermissions.php',
'Kirby\\Cms\\PagePicker' => $baseDir . '/src/Cms/PagePicker.php',
'Kirby\\Cms\\PageRules' => $baseDir . '/src/Cms/PageRules.php',
@ -117,9 +113,6 @@ return array(
'Kirby\\Cms\\Pagination' => $baseDir . '/src/Cms/Pagination.php',
'Kirby\\Cms\\Permissions' => $baseDir . '/src/Cms/Permissions.php',
'Kirby\\Cms\\Picker' => $baseDir . '/src/Cms/Picker.php',
'Kirby\\Cms\\Plugin' => $baseDir . '/src/Cms/Plugin.php',
'Kirby\\Cms\\PluginAsset' => $baseDir . '/src/Cms/PluginAsset.php',
'Kirby\\Cms\\PluginAssets' => $baseDir . '/src/Cms/PluginAssets.php',
'Kirby\\Cms\\R' => $baseDir . '/src/Cms/R.php',
'Kirby\\Cms\\Responder' => $baseDir . '/src/Cms/Responder.php',
'Kirby\\Cms\\Response' => $baseDir . '/src/Cms/Response.php',
@ -152,12 +145,22 @@ return array(
'Kirby\\ComposerInstaller\\Installer' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/Installer.php',
'Kirby\\ComposerInstaller\\Plugin' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/Plugin.php',
'Kirby\\ComposerInstaller\\PluginInstaller' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php',
'Kirby\\Content\\Changes' => $baseDir . '/src/Content/Changes.php',
'Kirby\\Content\\Content' => $baseDir . '/src/Content/Content.php',
'Kirby\\Content\\ContentStorage' => $baseDir . '/src/Content/ContentStorage.php',
'Kirby\\Content\\ContentStorageHandler' => $baseDir . '/src/Content/ContentStorageHandler.php',
'Kirby\\Content\\ContentTranslation' => $baseDir . '/src/Content/ContentTranslation.php',
'Kirby\\Content\\Field' => $baseDir . '/src/Content/Field.php',
'Kirby\\Content\\PlainTextContentStorageHandler' => $baseDir . '/src/Content/PlainTextContentStorageHandler.php',
'Kirby\\Content\\ImmutableMemoryStorage' => $baseDir . '/src/Content/ImmutableMemoryStorage.php',
'Kirby\\Content\\Lock' => $baseDir . '/src/Content/Lock.php',
'Kirby\\Content\\LockedContentException' => $baseDir . '/src/Content/LockedContentException.php',
'Kirby\\Content\\MemoryStorage' => $baseDir . '/src/Content/MemoryStorage.php',
'Kirby\\Content\\PlainTextStorage' => $baseDir . '/src/Content/PlainTextStorage.php',
'Kirby\\Content\\Storage' => $baseDir . '/src/Content/Storage.php',
'Kirby\\Content\\Translation' => $baseDir . '/src/Content/Translation.php',
'Kirby\\Content\\Translations' => $baseDir . '/src/Content/Translations.php',
'Kirby\\Content\\Version' => $baseDir . '/src/Content/Version.php',
'Kirby\\Content\\VersionCache' => $baseDir . '/src/Content/VersionCache.php',
'Kirby\\Content\\VersionId' => $baseDir . '/src/Content/VersionId.php',
'Kirby\\Content\\VersionRules' => $baseDir . '/src/Content/VersionRules.php',
'Kirby\\Content\\Versions' => $baseDir . '/src/Content/Versions.php',
'Kirby\\Data\\Data' => $baseDir . '/src/Data/Data.php',
'Kirby\\Data\\Handler' => $baseDir . '/src/Data/Handler.php',
'Kirby\\Data\\Json' => $baseDir . '/src/Data/Json.php',
@ -196,12 +199,19 @@ return array(
'Kirby\\Form\\Field' => $baseDir . '/src/Form/Field.php',
'Kirby\\Form\\FieldClass' => $baseDir . '/src/Form/FieldClass.php',
'Kirby\\Form\\Field\\BlocksField' => $baseDir . '/src/Form/Field/BlocksField.php',
'Kirby\\Form\\Field\\EntriesField' => $baseDir . '/src/Form/Field/EntriesField.php',
'Kirby\\Form\\Field\\LayoutField' => $baseDir . '/src/Form/Field/LayoutField.php',
'Kirby\\Form\\Fields' => $baseDir . '/src/Form/Fields.php',
'Kirby\\Form\\Form' => $baseDir . '/src/Form/Form.php',
'Kirby\\Form\\Mixin\\Api' => $baseDir . '/src/Form/Mixin/Api.php',
'Kirby\\Form\\Mixin\\EmptyState' => $baseDir . '/src/Form/Mixin/EmptyState.php',
'Kirby\\Form\\Mixin\\Max' => $baseDir . '/src/Form/Mixin/Max.php',
'Kirby\\Form\\Mixin\\Min' => $baseDir . '/src/Form/Mixin/Min.php',
'Kirby\\Form\\Mixin\\Model' => $baseDir . '/src/Form/Mixin/Model.php',
'Kirby\\Form\\Mixin\\Translatable' => $baseDir . '/src/Form/Mixin/Translatable.php',
'Kirby\\Form\\Mixin\\Validation' => $baseDir . '/src/Form/Mixin/Validation.php',
'Kirby\\Form\\Mixin\\Value' => $baseDir . '/src/Form/Mixin/Value.php',
'Kirby\\Form\\Mixin\\When' => $baseDir . '/src/Form/Mixin/When.php',
'Kirby\\Form\\Validations' => $baseDir . '/src/Form/Validations.php',
'Kirby\\Http\\Cookie' => $baseDir . '/src/Http/Cookie.php',
'Kirby\\Http\\Environment' => $baseDir . '/src/Http/Environment.php',
@ -244,6 +254,8 @@ return array(
'Kirby\\Option\\OptionsQuery' => $baseDir . '/src/Option/OptionsQuery.php',
'Kirby\\Panel\\Assets' => $baseDir . '/src/Panel/Assets.php',
'Kirby\\Panel\\ChangesDialog' => $baseDir . '/src/Panel/ChangesDialog.php',
'Kirby\\Panel\\Controller\\PageTree' => $baseDir . '/src/Panel/Controller/PageTree.php',
'Kirby\\Panel\\Controller\\Search' => $baseDir . '/src/Panel/Controller/Search.php',
'Kirby\\Panel\\Dialog' => $baseDir . '/src/Panel/Dialog.php',
'Kirby\\Panel\\Document' => $baseDir . '/src/Panel/Document.php',
'Kirby\\Panel\\Drawer' => $baseDir . '/src/Panel/Drawer.php',
@ -253,6 +265,12 @@ return array(
'Kirby\\Panel\\Home' => $baseDir . '/src/Panel/Home.php',
'Kirby\\Panel\\Json' => $baseDir . '/src/Panel/Json.php',
'Kirby\\Panel\\Lab\\Category' => $baseDir . '/src/Panel/Lab/Category.php',
'Kirby\\Panel\\Lab\\Doc' => $baseDir . '/src/Panel/Lab/Doc.php',
'Kirby\\Panel\\Lab\\Doc\\Argument' => $baseDir . '/src/Panel/Lab/Doc/Argument.php',
'Kirby\\Panel\\Lab\\Doc\\Event' => $baseDir . '/src/Panel/Lab/Doc/Event.php',
'Kirby\\Panel\\Lab\\Doc\\Method' => $baseDir . '/src/Panel/Lab/Doc/Method.php',
'Kirby\\Panel\\Lab\\Doc\\Prop' => $baseDir . '/src/Panel/Lab/Doc/Prop.php',
'Kirby\\Panel\\Lab\\Doc\\Slot' => $baseDir . '/src/Panel/Lab/Doc/Slot.php',
'Kirby\\Panel\\Lab\\Docs' => $baseDir . '/src/Panel/Lab/Docs.php',
'Kirby\\Panel\\Lab\\Example' => $baseDir . '/src/Panel/Lab/Example.php',
'Kirby\\Panel\\Lab\\Snippet' => $baseDir . '/src/Panel/Lab/Snippet.php',
@ -267,6 +285,25 @@ return array(
'Kirby\\Panel\\Request' => $baseDir . '/src/Panel/Request.php',
'Kirby\\Panel\\Search' => $baseDir . '/src/Panel/Search.php',
'Kirby\\Panel\\Site' => $baseDir . '/src/Panel/Site.php',
'Kirby\\Panel\\Ui\\Button' => $baseDir . '/src/Panel/Ui/Button.php',
'Kirby\\Panel\\Ui\\Buttons\\LanguageCreateButton' => $baseDir . '/src/Panel/Ui/Buttons/LanguageCreateButton.php',
'Kirby\\Panel\\Ui\\Buttons\\LanguageDeleteButton' => $baseDir . '/src/Panel/Ui/Buttons/LanguageDeleteButton.php',
'Kirby\\Panel\\Ui\\Buttons\\LanguageSettingsButton' => $baseDir . '/src/Panel/Ui/Buttons/LanguageSettingsButton.php',
'Kirby\\Panel\\Ui\\Buttons\\LanguagesDropdown' => $baseDir . '/src/Panel/Ui/Buttons/LanguagesDropdown.php',
'Kirby\\Panel\\Ui\\Buttons\\OpenButton' => $baseDir . '/src/Panel/Ui/Buttons/OpenButton.php',
'Kirby\\Panel\\Ui\\Buttons\\PageStatusButton' => $baseDir . '/src/Panel/Ui/Buttons/PageStatusButton.php',
'Kirby\\Panel\\Ui\\Buttons\\PreviewButton' => $baseDir . '/src/Panel/Ui/Buttons/PreviewButton.php',
'Kirby\\Panel\\Ui\\Buttons\\SettingsButton' => $baseDir . '/src/Panel/Ui/Buttons/SettingsButton.php',
'Kirby\\Panel\\Ui\\Buttons\\VersionsButton' => $baseDir . '/src/Panel/Ui/Buttons/VersionsButton.php',
'Kirby\\Panel\\Ui\\Buttons\\ViewButton' => $baseDir . '/src/Panel/Ui/Buttons/ViewButton.php',
'Kirby\\Panel\\Ui\\Buttons\\ViewButtons' => $baseDir . '/src/Panel/Ui/Buttons/ViewButtons.php',
'Kirby\\Panel\\Ui\\Component' => $baseDir . '/src/Panel/Ui/Component.php',
'Kirby\\Panel\\Ui\\FilePreview' => $baseDir . '/src/Panel/Ui/FilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\AudioFilePreview' => $baseDir . '/src/Panel/Ui/FilePreviews/AudioFilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\DefaultFilePreview' => $baseDir . '/src/Panel/Ui/FilePreviews/DefaultFilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\ImageFilePreview' => $baseDir . '/src/Panel/Ui/FilePreviews/ImageFilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\PdfFilePreview' => $baseDir . '/src/Panel/Ui/FilePreviews/PdfFilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\VideoFilePreview' => $baseDir . '/src/Panel/Ui/FilePreviews/VideoFilePreview.php',
'Kirby\\Panel\\User' => $baseDir . '/src/Panel/User.php',
'Kirby\\Panel\\UserTotpDisableDialog' => $baseDir . '/src/Panel/UserTotpDisableDialog.php',
'Kirby\\Panel\\UserTotpEnableDialog' => $baseDir . '/src/Panel/UserTotpEnableDialog.php',
@ -277,6 +314,11 @@ return array(
'Kirby\\Parsley\\Schema' => $baseDir . '/src/Parsley/Schema.php',
'Kirby\\Parsley\\Schema\\Blocks' => $baseDir . '/src/Parsley/Schema/Blocks.php',
'Kirby\\Parsley\\Schema\\Plain' => $baseDir . '/src/Parsley/Schema/Plain.php',
'Kirby\\Plugin\\Asset' => $baseDir . '/src/Plugin/Asset.php',
'Kirby\\Plugin\\Assets' => $baseDir . '/src/Plugin/Assets.php',
'Kirby\\Plugin\\License' => $baseDir . '/src/Plugin/License.php',
'Kirby\\Plugin\\LicenseStatus' => $baseDir . '/src/Plugin/LicenseStatus.php',
'Kirby\\Plugin\\Plugin' => $baseDir . '/src/Plugin/Plugin.php',
'Kirby\\Query\\Argument' => $baseDir . '/src/Query/Argument.php',
'Kirby\\Query\\Arguments' => $baseDir . '/src/Query/Arguments.php',
'Kirby\\Query\\Expression' => $baseDir . '/src/Query/Expression.php',
@ -320,7 +362,6 @@ return array(
'Kirby\\Toolkit\\Locale' => $baseDir . '/src/Toolkit/Locale.php',
'Kirby\\Toolkit\\Obj' => $baseDir . '/src/Toolkit/Obj.php',
'Kirby\\Toolkit\\Pagination' => $baseDir . '/src/Toolkit/Pagination.php',
'Kirby\\Toolkit\\Properties' => $baseDir . '/src/Toolkit/Properties.php',
'Kirby\\Toolkit\\Silo' => $baseDir . '/src/Toolkit/Silo.php',
'Kirby\\Toolkit\\Str' => $baseDir . '/src/Toolkit/Str.php',
'Kirby\\Toolkit\\SymmetricCrypto' => $baseDir . '/src/Toolkit/SymmetricCrypto.php',

View file

@ -144,23 +144,16 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Composer\\Semver\\VersionParser' => __DIR__ . '/..' . '/composer/semver/src/VersionParser.php',
'Kirby\\Api\\Api' => __DIR__ . '/../..' . '/src/Api/Api.php',
'Kirby\\Api\\Collection' => __DIR__ . '/../..' . '/src/Api/Collection.php',
'Kirby\\Api\\Controller\\Changes' => __DIR__ . '/../..' . '/src/Api/Controller/Changes.php',
'Kirby\\Api\\Model' => __DIR__ . '/../..' . '/src/Api/Model.php',
'Kirby\\Blueprint\\Collection' => __DIR__ . '/../..' . '/src/Blueprint/Collection.php',
'Kirby\\Blueprint\\Config' => __DIR__ . '/../..' . '/src/Blueprint/Config.php',
'Kirby\\Blueprint\\Extension' => __DIR__ . '/../..' . '/src/Blueprint/Extension.php',
'Kirby\\Blueprint\\Factory' => __DIR__ . '/../..' . '/src/Blueprint/Factory.php',
'Kirby\\Blueprint\\Node' => __DIR__ . '/../..' . '/src/Blueprint/Node.php',
'Kirby\\Blueprint\\NodeI18n' => __DIR__ . '/../..' . '/src/Blueprint/NodeI18n.php',
'Kirby\\Blueprint\\NodeIcon' => __DIR__ . '/../..' . '/src/Blueprint/NodeIcon.php',
'Kirby\\Blueprint\\NodeProperty' => __DIR__ . '/../..' . '/src/Blueprint/NodeProperty.php',
'Kirby\\Blueprint\\NodeString' => __DIR__ . '/../..' . '/src/Blueprint/NodeString.php',
'Kirby\\Blueprint\\NodeText' => __DIR__ . '/../..' . '/src/Blueprint/NodeText.php',
'Kirby\\Api\\Upload' => __DIR__ . '/../..' . '/src/Api/Upload.php',
'Kirby\\Cache\\ApcuCache' => __DIR__ . '/../..' . '/src/Cache/ApcuCache.php',
'Kirby\\Cache\\Cache' => __DIR__ . '/../..' . '/src/Cache/Cache.php',
'Kirby\\Cache\\FileCache' => __DIR__ . '/../..' . '/src/Cache/FileCache.php',
'Kirby\\Cache\\MemCached' => __DIR__ . '/../..' . '/src/Cache/MemCached.php',
'Kirby\\Cache\\MemoryCache' => __DIR__ . '/../..' . '/src/Cache/MemoryCache.php',
'Kirby\\Cache\\NullCache' => __DIR__ . '/../..' . '/src/Cache/NullCache.php',
'Kirby\\Cache\\RedisCache' => __DIR__ . '/../..' . '/src/Cache/RedisCache.php',
'Kirby\\Cache\\Value' => __DIR__ . '/../..' . '/src/Cache/Value.php',
'Kirby\\Cms\\Api' => __DIR__ . '/../..' . '/src/Cms/Api.php',
'Kirby\\Cms\\App' => __DIR__ . '/../..' . '/src/Cms/App.php',
@ -180,11 +173,10 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Cms\\Blueprint' => __DIR__ . '/../..' . '/src/Cms/Blueprint.php',
'Kirby\\Cms\\Collection' => __DIR__ . '/../..' . '/src/Cms/Collection.php',
'Kirby\\Cms\\Collections' => __DIR__ . '/../..' . '/src/Cms/Collections.php',
'Kirby\\Cms\\ContentLock' => __DIR__ . '/../..' . '/src/Cms/ContentLock.php',
'Kirby\\Cms\\ContentLocks' => __DIR__ . '/../..' . '/src/Cms/ContentLocks.php',
'Kirby\\Cms\\Core' => __DIR__ . '/../..' . '/src/Cms/Core.php',
'Kirby\\Cms\\Email' => __DIR__ . '/../..' . '/src/Cms/Email.php',
'Kirby\\Cms\\Event' => __DIR__ . '/../..' . '/src/Cms/Event.php',
'Kirby\\Cms\\Events' => __DIR__ . '/../..' . '/src/Cms/Events.php',
'Kirby\\Cms\\Fieldset' => __DIR__ . '/../..' . '/src/Cms/Fieldset.php',
'Kirby\\Cms\\Fieldsets' => __DIR__ . '/../..' . '/src/Cms/Fieldsets.php',
'Kirby\\Cms\\File' => __DIR__ . '/../..' . '/src/Cms/File.php',
@ -200,6 +192,7 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Cms\\HasChildren' => __DIR__ . '/../..' . '/src/Cms/HasChildren.php',
'Kirby\\Cms\\HasFiles' => __DIR__ . '/../..' . '/src/Cms/HasFiles.php',
'Kirby\\Cms\\HasMethods' => __DIR__ . '/../..' . '/src/Cms/HasMethods.php',
'Kirby\\Cms\\HasModels' => __DIR__ . '/../..' . '/src/Cms/HasModels.php',
'Kirby\\Cms\\HasSiblings' => __DIR__ . '/../..' . '/src/Cms/HasSiblings.php',
'Kirby\\Cms\\Helpers' => __DIR__ . '/../..' . '/src/Cms/Helpers.php',
'Kirby\\Cms\\Html' => __DIR__ . '/../..' . '/src/Cms/Html.php',
@ -207,6 +200,7 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Cms\\Item' => __DIR__ . '/../..' . '/src/Cms/Item.php',
'Kirby\\Cms\\Items' => __DIR__ . '/../..' . '/src/Cms/Items.php',
'Kirby\\Cms\\Language' => __DIR__ . '/../..' . '/src/Cms/Language.php',
'Kirby\\Cms\\LanguagePermissions' => __DIR__ . '/../..' . '/src/Cms/LanguagePermissions.php',
'Kirby\\Cms\\LanguageRouter' => __DIR__ . '/../..' . '/src/Cms/LanguageRouter.php',
'Kirby\\Cms\\LanguageRoutes' => __DIR__ . '/../..' . '/src/Cms/LanguageRoutes.php',
'Kirby\\Cms\\LanguageRules' => __DIR__ . '/../..' . '/src/Cms/LanguageRules.php',
@ -221,8 +215,9 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Cms\\LicenseType' => __DIR__ . '/../..' . '/src/Cms/LicenseType.php',
'Kirby\\Cms\\Loader' => __DIR__ . '/../..' . '/src/Cms/Loader.php',
'Kirby\\Cms\\Media' => __DIR__ . '/../..' . '/src/Cms/Media.php',
'Kirby\\Cms\\Model' => __DIR__ . '/../..' . '/src/Cms/Model.php',
'Kirby\\Cms\\ModelCommit' => __DIR__ . '/../..' . '/src/Cms/ModelCommit.php',
'Kirby\\Cms\\ModelPermissions' => __DIR__ . '/../..' . '/src/Cms/ModelPermissions.php',
'Kirby\\Cms\\ModelState' => __DIR__ . '/../..' . '/src/Cms/ModelState.php',
'Kirby\\Cms\\ModelWithContent' => __DIR__ . '/../..' . '/src/Cms/ModelWithContent.php',
'Kirby\\Cms\\Nest' => __DIR__ . '/../..' . '/src/Cms/Nest.php',
'Kirby\\Cms\\NestCollection' => __DIR__ . '/../..' . '/src/Cms/NestCollection.php',
@ -230,6 +225,7 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Cms\\Page' => __DIR__ . '/../..' . '/src/Cms/Page.php',
'Kirby\\Cms\\PageActions' => __DIR__ . '/../..' . '/src/Cms/PageActions.php',
'Kirby\\Cms\\PageBlueprint' => __DIR__ . '/../..' . '/src/Cms/PageBlueprint.php',
'Kirby\\Cms\\PageCopy' => __DIR__ . '/../..' . '/src/Cms/PageCopy.php',
'Kirby\\Cms\\PagePermissions' => __DIR__ . '/../..' . '/src/Cms/PagePermissions.php',
'Kirby\\Cms\\PagePicker' => __DIR__ . '/../..' . '/src/Cms/PagePicker.php',
'Kirby\\Cms\\PageRules' => __DIR__ . '/../..' . '/src/Cms/PageRules.php',
@ -238,9 +234,6 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Cms\\Pagination' => __DIR__ . '/../..' . '/src/Cms/Pagination.php',
'Kirby\\Cms\\Permissions' => __DIR__ . '/../..' . '/src/Cms/Permissions.php',
'Kirby\\Cms\\Picker' => __DIR__ . '/../..' . '/src/Cms/Picker.php',
'Kirby\\Cms\\Plugin' => __DIR__ . '/../..' . '/src/Cms/Plugin.php',
'Kirby\\Cms\\PluginAsset' => __DIR__ . '/../..' . '/src/Cms/PluginAsset.php',
'Kirby\\Cms\\PluginAssets' => __DIR__ . '/../..' . '/src/Cms/PluginAssets.php',
'Kirby\\Cms\\R' => __DIR__ . '/../..' . '/src/Cms/R.php',
'Kirby\\Cms\\Responder' => __DIR__ . '/../..' . '/src/Cms/Responder.php',
'Kirby\\Cms\\Response' => __DIR__ . '/../..' . '/src/Cms/Response.php',
@ -273,12 +266,22 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\ComposerInstaller\\Installer' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/Installer.php',
'Kirby\\ComposerInstaller\\Plugin' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/Plugin.php',
'Kirby\\ComposerInstaller\\PluginInstaller' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php',
'Kirby\\Content\\Changes' => __DIR__ . '/../..' . '/src/Content/Changes.php',
'Kirby\\Content\\Content' => __DIR__ . '/../..' . '/src/Content/Content.php',
'Kirby\\Content\\ContentStorage' => __DIR__ . '/../..' . '/src/Content/ContentStorage.php',
'Kirby\\Content\\ContentStorageHandler' => __DIR__ . '/../..' . '/src/Content/ContentStorageHandler.php',
'Kirby\\Content\\ContentTranslation' => __DIR__ . '/../..' . '/src/Content/ContentTranslation.php',
'Kirby\\Content\\Field' => __DIR__ . '/../..' . '/src/Content/Field.php',
'Kirby\\Content\\PlainTextContentStorageHandler' => __DIR__ . '/../..' . '/src/Content/PlainTextContentStorageHandler.php',
'Kirby\\Content\\ImmutableMemoryStorage' => __DIR__ . '/../..' . '/src/Content/ImmutableMemoryStorage.php',
'Kirby\\Content\\Lock' => __DIR__ . '/../..' . '/src/Content/Lock.php',
'Kirby\\Content\\LockedContentException' => __DIR__ . '/../..' . '/src/Content/LockedContentException.php',
'Kirby\\Content\\MemoryStorage' => __DIR__ . '/../..' . '/src/Content/MemoryStorage.php',
'Kirby\\Content\\PlainTextStorage' => __DIR__ . '/../..' . '/src/Content/PlainTextStorage.php',
'Kirby\\Content\\Storage' => __DIR__ . '/../..' . '/src/Content/Storage.php',
'Kirby\\Content\\Translation' => __DIR__ . '/../..' . '/src/Content/Translation.php',
'Kirby\\Content\\Translations' => __DIR__ . '/../..' . '/src/Content/Translations.php',
'Kirby\\Content\\Version' => __DIR__ . '/../..' . '/src/Content/Version.php',
'Kirby\\Content\\VersionCache' => __DIR__ . '/../..' . '/src/Content/VersionCache.php',
'Kirby\\Content\\VersionId' => __DIR__ . '/../..' . '/src/Content/VersionId.php',
'Kirby\\Content\\VersionRules' => __DIR__ . '/../..' . '/src/Content/VersionRules.php',
'Kirby\\Content\\Versions' => __DIR__ . '/../..' . '/src/Content/Versions.php',
'Kirby\\Data\\Data' => __DIR__ . '/../..' . '/src/Data/Data.php',
'Kirby\\Data\\Handler' => __DIR__ . '/../..' . '/src/Data/Handler.php',
'Kirby\\Data\\Json' => __DIR__ . '/../..' . '/src/Data/Json.php',
@ -317,12 +320,19 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Form\\Field' => __DIR__ . '/../..' . '/src/Form/Field.php',
'Kirby\\Form\\FieldClass' => __DIR__ . '/../..' . '/src/Form/FieldClass.php',
'Kirby\\Form\\Field\\BlocksField' => __DIR__ . '/../..' . '/src/Form/Field/BlocksField.php',
'Kirby\\Form\\Field\\EntriesField' => __DIR__ . '/../..' . '/src/Form/Field/EntriesField.php',
'Kirby\\Form\\Field\\LayoutField' => __DIR__ . '/../..' . '/src/Form/Field/LayoutField.php',
'Kirby\\Form\\Fields' => __DIR__ . '/../..' . '/src/Form/Fields.php',
'Kirby\\Form\\Form' => __DIR__ . '/../..' . '/src/Form/Form.php',
'Kirby\\Form\\Mixin\\Api' => __DIR__ . '/../..' . '/src/Form/Mixin/Api.php',
'Kirby\\Form\\Mixin\\EmptyState' => __DIR__ . '/../..' . '/src/Form/Mixin/EmptyState.php',
'Kirby\\Form\\Mixin\\Max' => __DIR__ . '/../..' . '/src/Form/Mixin/Max.php',
'Kirby\\Form\\Mixin\\Min' => __DIR__ . '/../..' . '/src/Form/Mixin/Min.php',
'Kirby\\Form\\Mixin\\Model' => __DIR__ . '/../..' . '/src/Form/Mixin/Model.php',
'Kirby\\Form\\Mixin\\Translatable' => __DIR__ . '/../..' . '/src/Form/Mixin/Translatable.php',
'Kirby\\Form\\Mixin\\Validation' => __DIR__ . '/../..' . '/src/Form/Mixin/Validation.php',
'Kirby\\Form\\Mixin\\Value' => __DIR__ . '/../..' . '/src/Form/Mixin/Value.php',
'Kirby\\Form\\Mixin\\When' => __DIR__ . '/../..' . '/src/Form/Mixin/When.php',
'Kirby\\Form\\Validations' => __DIR__ . '/../..' . '/src/Form/Validations.php',
'Kirby\\Http\\Cookie' => __DIR__ . '/../..' . '/src/Http/Cookie.php',
'Kirby\\Http\\Environment' => __DIR__ . '/../..' . '/src/Http/Environment.php',
@ -365,6 +375,8 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Option\\OptionsQuery' => __DIR__ . '/../..' . '/src/Option/OptionsQuery.php',
'Kirby\\Panel\\Assets' => __DIR__ . '/../..' . '/src/Panel/Assets.php',
'Kirby\\Panel\\ChangesDialog' => __DIR__ . '/../..' . '/src/Panel/ChangesDialog.php',
'Kirby\\Panel\\Controller\\PageTree' => __DIR__ . '/../..' . '/src/Panel/Controller/PageTree.php',
'Kirby\\Panel\\Controller\\Search' => __DIR__ . '/../..' . '/src/Panel/Controller/Search.php',
'Kirby\\Panel\\Dialog' => __DIR__ . '/../..' . '/src/Panel/Dialog.php',
'Kirby\\Panel\\Document' => __DIR__ . '/../..' . '/src/Panel/Document.php',
'Kirby\\Panel\\Drawer' => __DIR__ . '/../..' . '/src/Panel/Drawer.php',
@ -374,6 +386,12 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Panel\\Home' => __DIR__ . '/../..' . '/src/Panel/Home.php',
'Kirby\\Panel\\Json' => __DIR__ . '/../..' . '/src/Panel/Json.php',
'Kirby\\Panel\\Lab\\Category' => __DIR__ . '/../..' . '/src/Panel/Lab/Category.php',
'Kirby\\Panel\\Lab\\Doc' => __DIR__ . '/../..' . '/src/Panel/Lab/Doc.php',
'Kirby\\Panel\\Lab\\Doc\\Argument' => __DIR__ . '/../..' . '/src/Panel/Lab/Doc/Argument.php',
'Kirby\\Panel\\Lab\\Doc\\Event' => __DIR__ . '/../..' . '/src/Panel/Lab/Doc/Event.php',
'Kirby\\Panel\\Lab\\Doc\\Method' => __DIR__ . '/../..' . '/src/Panel/Lab/Doc/Method.php',
'Kirby\\Panel\\Lab\\Doc\\Prop' => __DIR__ . '/../..' . '/src/Panel/Lab/Doc/Prop.php',
'Kirby\\Panel\\Lab\\Doc\\Slot' => __DIR__ . '/../..' . '/src/Panel/Lab/Doc/Slot.php',
'Kirby\\Panel\\Lab\\Docs' => __DIR__ . '/../..' . '/src/Panel/Lab/Docs.php',
'Kirby\\Panel\\Lab\\Example' => __DIR__ . '/../..' . '/src/Panel/Lab/Example.php',
'Kirby\\Panel\\Lab\\Snippet' => __DIR__ . '/../..' . '/src/Panel/Lab/Snippet.php',
@ -388,6 +406,25 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Panel\\Request' => __DIR__ . '/../..' . '/src/Panel/Request.php',
'Kirby\\Panel\\Search' => __DIR__ . '/../..' . '/src/Panel/Search.php',
'Kirby\\Panel\\Site' => __DIR__ . '/../..' . '/src/Panel/Site.php',
'Kirby\\Panel\\Ui\\Button' => __DIR__ . '/../..' . '/src/Panel/Ui/Button.php',
'Kirby\\Panel\\Ui\\Buttons\\LanguageCreateButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/LanguageCreateButton.php',
'Kirby\\Panel\\Ui\\Buttons\\LanguageDeleteButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/LanguageDeleteButton.php',
'Kirby\\Panel\\Ui\\Buttons\\LanguageSettingsButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/LanguageSettingsButton.php',
'Kirby\\Panel\\Ui\\Buttons\\LanguagesDropdown' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/LanguagesDropdown.php',
'Kirby\\Panel\\Ui\\Buttons\\OpenButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/OpenButton.php',
'Kirby\\Panel\\Ui\\Buttons\\PageStatusButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/PageStatusButton.php',
'Kirby\\Panel\\Ui\\Buttons\\PreviewButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/PreviewButton.php',
'Kirby\\Panel\\Ui\\Buttons\\SettingsButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/SettingsButton.php',
'Kirby\\Panel\\Ui\\Buttons\\VersionsButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/VersionsButton.php',
'Kirby\\Panel\\Ui\\Buttons\\ViewButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/ViewButton.php',
'Kirby\\Panel\\Ui\\Buttons\\ViewButtons' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/ViewButtons.php',
'Kirby\\Panel\\Ui\\Component' => __DIR__ . '/../..' . '/src/Panel/Ui/Component.php',
'Kirby\\Panel\\Ui\\FilePreview' => __DIR__ . '/../..' . '/src/Panel/Ui/FilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\AudioFilePreview' => __DIR__ . '/../..' . '/src/Panel/Ui/FilePreviews/AudioFilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\DefaultFilePreview' => __DIR__ . '/../..' . '/src/Panel/Ui/FilePreviews/DefaultFilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\ImageFilePreview' => __DIR__ . '/../..' . '/src/Panel/Ui/FilePreviews/ImageFilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\PdfFilePreview' => __DIR__ . '/../..' . '/src/Panel/Ui/FilePreviews/PdfFilePreview.php',
'Kirby\\Panel\\Ui\\FilePreviews\\VideoFilePreview' => __DIR__ . '/../..' . '/src/Panel/Ui/FilePreviews/VideoFilePreview.php',
'Kirby\\Panel\\User' => __DIR__ . '/../..' . '/src/Panel/User.php',
'Kirby\\Panel\\UserTotpDisableDialog' => __DIR__ . '/../..' . '/src/Panel/UserTotpDisableDialog.php',
'Kirby\\Panel\\UserTotpEnableDialog' => __DIR__ . '/../..' . '/src/Panel/UserTotpEnableDialog.php',
@ -398,6 +435,11 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Parsley\\Schema' => __DIR__ . '/../..' . '/src/Parsley/Schema.php',
'Kirby\\Parsley\\Schema\\Blocks' => __DIR__ . '/../..' . '/src/Parsley/Schema/Blocks.php',
'Kirby\\Parsley\\Schema\\Plain' => __DIR__ . '/../..' . '/src/Parsley/Schema/Plain.php',
'Kirby\\Plugin\\Asset' => __DIR__ . '/../..' . '/src/Plugin/Asset.php',
'Kirby\\Plugin\\Assets' => __DIR__ . '/../..' . '/src/Plugin/Assets.php',
'Kirby\\Plugin\\License' => __DIR__ . '/../..' . '/src/Plugin/License.php',
'Kirby\\Plugin\\LicenseStatus' => __DIR__ . '/../..' . '/src/Plugin/LicenseStatus.php',
'Kirby\\Plugin\\Plugin' => __DIR__ . '/../..' . '/src/Plugin/Plugin.php',
'Kirby\\Query\\Argument' => __DIR__ . '/../..' . '/src/Query/Argument.php',
'Kirby\\Query\\Arguments' => __DIR__ . '/../..' . '/src/Query/Arguments.php',
'Kirby\\Query\\Expression' => __DIR__ . '/../..' . '/src/Query/Expression.php',
@ -441,7 +483,6 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
'Kirby\\Toolkit\\Locale' => __DIR__ . '/../..' . '/src/Toolkit/Locale.php',
'Kirby\\Toolkit\\Obj' => __DIR__ . '/../..' . '/src/Toolkit/Obj.php',
'Kirby\\Toolkit\\Pagination' => __DIR__ . '/../..' . '/src/Toolkit/Pagination.php',
'Kirby\\Toolkit\\Properties' => __DIR__ . '/../..' . '/src/Toolkit/Properties.php',
'Kirby\\Toolkit\\Silo' => __DIR__ . '/../..' . '/src/Toolkit/Silo.php',
'Kirby\\Toolkit\\Str' => __DIR__ . '/../..' . '/src/Toolkit/Str.php',
'Kirby\\Toolkit\\SymmetricCrypto' => __DIR__ . '/../..' . '/src/Toolkit/SymmetricCrypto.php',

View file

@ -204,17 +204,17 @@
},
{
"name": "filp/whoops",
"version": "2.18.0",
"version_normalized": "2.18.0.0",
"version": "2.18.3",
"version_normalized": "2.18.3.0",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
"reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e"
"reference": "59a123a3d459c5a23055802237cb317f609867e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e",
"reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e",
"url": "https://api.github.com/repos/filp/whoops/zipball/59a123a3d459c5a23055802237cb317f609867e5",
"reference": "59a123a3d459c5a23055802237cb317f609867e5",
"shasum": ""
},
"require": {
@ -230,7 +230,7 @@
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
"whoops/soap": "Formats errors as SOAP responses"
},
"time": "2025-03-15T12:00:00+00:00",
"time": "2025-06-16T00:02:10+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -266,7 +266,7 @@
],
"support": {
"issues": "https://github.com/filp/whoops/issues",
"source": "https://github.com/filp/whoops/tree/2.18.0"
"source": "https://github.com/filp/whoops/tree/2.18.3"
},
"funding": [
{
@ -1056,31 +1056,31 @@
},
{
"name": "symfony/yaml",
"version": "v6.4.21",
"version_normalized": "6.4.21.0",
"version": "v7.3.1",
"version_normalized": "7.3.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "f01987f45676778b474468aa266fe2eda1f2bc7e"
"reference": "0c3555045a46ab3cd4cc5a69d161225195230edb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/f01987f45676778b474468aa266fe2eda1f2bc7e",
"reference": "f01987f45676778b474468aa266fe2eda1f2bc7e",
"url": "https://api.github.com/repos/symfony/yaml/zipball/0c3555045a46ab3cd4cc5a69d161225195230edb",
"reference": "0c3555045a46ab3cd4cc5a69d161225195230edb",
"shasum": ""
},
"require": {
"php": ">=8.1",
"symfony/deprecation-contracts": "^2.5|^3",
"php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/console": "<5.4"
"symfony/console": "<6.4"
},
"require-dev": {
"symfony/console": "^5.4|^6.0|^7.0"
"symfony/console": "^6.4|^7.0"
},
"time": "2025-04-04T09:48:44+00:00",
"time": "2025-06-03T06:57:57+00:00",
"bin": [
"Resources/bin/yaml-lint"
],
@ -1111,7 +1111,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v6.4.21"
"source": "https://github.com/symfony/yaml/tree/v7.3.1"
},
"funding": [
{

View file

@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'getkirby/cms',
'pretty_version' => '4.8.0',
'version' => '4.8.0.0',
'pretty_version' => '5.0.1',
'version' => '5.0.1.0',
'reference' => null,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
@ -38,17 +38,17 @@
'dev_requirement' => false,
),
'filp/whoops' => array(
'pretty_version' => '2.18.0',
'version' => '2.18.0.0',
'reference' => 'a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e',
'pretty_version' => '2.18.3',
'version' => '2.18.3.0',
'reference' => '59a123a3d459c5a23055802237cb317f609867e5',
'type' => 'library',
'install_path' => __DIR__ . '/../filp/whoops',
'aliases' => array(),
'dev_requirement' => false,
),
'getkirby/cms' => array(
'pretty_version' => '4.8.0',
'version' => '4.8.0.0',
'pretty_version' => '5.0.1',
'version' => '5.0.1.0',
'reference' => null,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
@ -167,9 +167,9 @@
),
),
'symfony/yaml' => array(
'pretty_version' => 'v6.4.21',
'version' => '6.4.21.0',
'reference' => 'f01987f45676778b474468aa266fe2eda1f2bc7e',
'pretty_version' => 'v7.3.1',
'version' => '7.3.1.0',
'reference' => '0c3555045a46ab3cd4cc5a69d161225195230edb',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/yaml',
'aliases' => array(),

View file

@ -12,6 +12,7 @@
}
],
"scripts": {
"demo": "php -S localhost:8000 ./examples/example.php",
"test": "phpunit --testdox tests"
},
"require": {

View file

@ -1,4 +1,4 @@
/* PrismJS 1.29.0
/* PrismJS 1.30.0
https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+markup-templating+php&plugins=line-highlight+line-numbers */
code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}
pre[data-line]{position:relative;padding:1em 0 1em 3em}.line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}@media print{.line-highlight{-webkit-print-color-adjust:exact;color-adjust:exact}}.line-highlight:before,.line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}.line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}.line-numbers .line-highlight:after,.line-numbers .line-highlight:before{content:none}pre[id].linkable-line-numbers span.line-numbers-rows{pointer-events:all}pre[id].linkable-line-numbers span.line-numbers-rows>span:before{cursor:pointer}pre[id].linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:rgba(128,128,128,.2)}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -43,8 +43,11 @@ Zepto(function($) {
});
var line = $activeFrame.find('.code-block .line-highlight').first()[0];
line.scrollIntoView();
line.parentElement.scrollTop -= 180;
// [internal] frames might not contain a code-block
if (line) {
line.scrollIntoView();
line.parentElement.scrollTop -= 180;
}
$container.scrollTop(0);
}
@ -76,7 +79,7 @@ Zepto(function($) {
});
var clipboard = new Clipboard('.clipboard');
var clipboard = new ClipboardJS('.clipboard');
var showTooltip = function(elem, msg) {
elem.classList.add('tooltipped', 'tooltipped-s');
elem.setAttribute('aria-label', msg);

File diff suppressed because one or more lines are too long

View file

@ -87,6 +87,11 @@ final class Run implements RunInterface
$this->inspectorFactory = new InspectorFactory();
}
public function __destruct()
{
$this->unregister();
}
/**
* Explicitly request your handler runs as the last of all currently registered handlers.
*
@ -502,6 +507,11 @@ final class Run implements RunInterface
// to the exception handler. Pass that information along.
$this->canThrowExceptions = false;
// If we are not currently registered, we should not do anything
if (!$this->isRegistered) {
return;
}
$error = $this->system->getLastError();
if ($error && Misc::isLevelFatal($error['type'])) {
// If there was a fatal error,
@ -531,7 +541,7 @@ final class Run implements RunInterface
{
if (!is_callable($filterCallback)) {
throw new \InvalidArgumentException(sprintf(
"A frame filter must be of type callable, %s type given.",
"A frame filter must be of type callable, %s type given.",
gettype($filterCallback)
));
}

View file

@ -50,14 +50,11 @@ class LintCommand extends Command
$this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...);
}
/**
* @return void
*/
protected function configure()
protected function configure(): void
{
$this
->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))
->addOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))
->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude')
->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null)
->setHelp(<<<EOF
@ -75,6 +72,9 @@ You can also validate the syntax of a file:
Or of a whole directory:
<info>php %command.full_name% dirname</info>
The <info>--format</info> option specifies the format of the command output:
<info>php %command.full_name% dirname --format=json</info>
You can also exclude one or more specific files:
@ -114,7 +114,7 @@ EOF
$filesInfo = [];
foreach ($filenames as $filename) {
if (!$this->isReadable($filename)) {
throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename));
throw new RuntimeException(\sprintf('File or directory "%s" is not readable.', $filename));
}
foreach ($this->getFiles($filename) as $file) {
@ -154,7 +154,7 @@ EOF
'txt' => $this->displayTxt($io, $files),
'json' => $this->displayJson($io, $files),
'github' => $this->displayTxt($io, $files, true),
default => throw new InvalidArgumentException(sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))),
default => throw new InvalidArgumentException(\sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))),
};
}
@ -170,11 +170,11 @@ EOF
foreach ($filesInfo as $info) {
if ($info['valid'] && $this->displayCorrectFiles) {
$io->comment('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
$io->comment('<info>OK</info>'.($info['file'] ? \sprintf(' in %s', $info['file']) : ''));
} elseif (!$info['valid']) {
++$erroredFiles;
$io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
$io->text(sprintf('<error> >> %s</error>', $info['message']));
$io->text('<error> ERROR </error>'.($info['file'] ? \sprintf(' in %s', $info['file']) : ''));
$io->text(\sprintf('<error> >> %s</error>', $info['message']));
if (str_contains($info['message'], 'PARSE_CUSTOM_TAGS')) {
$suggestTagOption = true;
@ -187,9 +187,9 @@ EOF
}
if (0 === $erroredFiles) {
$io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles));
$io->success(\sprintf('All %d YAML files contain valid syntax.', $countFiles));
} else {
$io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : ''));
$io->warning(\sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : ''));
}
return min($erroredFiles, 1);
@ -269,6 +269,7 @@ EOF
}
}
/** @return string[] */
private function getAvailableFormatOptions(): array
{
return ['txt', 'json', 'github'];

View file

@ -23,43 +23,49 @@ use Symfony\Component\Yaml\Tag\TaggedValue;
class Dumper
{
/**
* The amount of spaces to use for indentation of nested nodes.
* @param int $indentation The amount of spaces to use for indentation of nested nodes
*/
private int $indentation;
public function __construct(int $indentation = 4)
public function __construct(private int $indentation = 4)
{
if ($indentation < 1) {
throw new \InvalidArgumentException('The indentation must be greater than zero.');
}
$this->indentation = $indentation;
}
/**
* Dumps a PHP value to YAML.
*
* @param mixed $input The PHP value
* @param int $inline The level where you switch to inline YAML
* @param int $indent The level of indentation (used internally)
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
* @param mixed $input The PHP value
* @param int $inline The level where you switch to inline YAML
* @param int $indent The level of indentation (used internally)
* @param int-mask-of<Yaml::DUMP_*> $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
*/
public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string
{
if ($flags & Yaml::DUMP_NULL_AS_EMPTY && $flags & Yaml::DUMP_NULL_AS_TILDE) {
throw new \InvalidArgumentException('The Yaml::DUMP_NULL_AS_EMPTY and Yaml::DUMP_NULL_AS_TILDE flags cannot be used together.');
}
return $this->doDump($input, $inline, $indent, $flags);
}
private function doDump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0, int $nestingLevel = 0): string
{
$output = '';
$prefix = $indent ? str_repeat(' ', $indent) : '';
$dumpObjectAsInlineMap = true;
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($input instanceof \ArrayObject || $input instanceof \stdClass)) {
$dumpObjectAsInlineMap = empty((array) $input);
$dumpObjectAsInlineMap = !(array) $input;
}
if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) {
$output .= $prefix.Inline::dump($input, $flags);
if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || !$input) {
$output .= $prefix.Inline::dump($input, $flags, 0 === $nestingLevel);
} elseif ($input instanceof TaggedValue) {
$output .= $this->dumpTaggedValue($input, $inline, $indent, $flags, $prefix);
$output .= $this->dumpTaggedValue($input, $inline, $indent, $flags, $prefix, $nestingLevel);
} else {
$dumpAsMap = Inline::isHash($input);
$compactNestedMapping = Yaml::DUMP_COMPACT_NESTED_MAPPING & $flags && !$dumpAsMap;
foreach ($input as $key => $value) {
if ('' !== $output && "\n" !== $output[-1]) {
@ -81,13 +87,13 @@ class Dumper
$blockChompingIndicator = '-';
}
$output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator);
$output .= \sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator);
foreach (explode("\n", $value) as $row) {
if ('' === $row) {
$output .= "\n";
} else {
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
$output .= \sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
}
}
@ -95,24 +101,24 @@ class Dumper
}
if ($value instanceof TaggedValue) {
$output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag());
$output .= \sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag());
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) {
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue());
$output .= sprintf(' |%s', $blockIndentationIndicator);
$output .= \sprintf(' |%s', $blockIndentationIndicator);
foreach (explode("\n", $value->getValue()) as $row) {
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
$output .= \sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
}
continue;
}
if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
$output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
$output .= ' '.$this->doDump($value->getValue(), $inline - 1, 0, $flags, $nestingLevel + 1)."\n";
} else {
$output .= "\n";
$output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags);
$output .= $this->doDump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags, $nestingLevel + 1);
}
continue;
@ -121,16 +127,16 @@ class Dumper
$dumpObjectAsInlineMap = true;
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) {
$dumpObjectAsInlineMap = empty((array) $value);
$dumpObjectAsInlineMap = !(array) $value;
}
$willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || empty($value);
$willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || !$value;
$output .= sprintf('%s%s%s%s',
$output .= \sprintf('%s%s%s%s',
$prefix,
$dumpAsMap ? Inline::dump($key, $flags).':' : '-',
$willBeInlined ? ' ' : "\n",
$this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags)
$willBeInlined || ($compactNestedMapping && \is_array($value) && Inline::isHash($value)) ? ' ' : "\n",
$compactNestedMapping && \is_array($value) && Inline::isHash($value) ? substr($this->doDump($value, $inline - 1, $indent + 2, $flags, $nestingLevel + 1), $indent + 2) : $this->doDump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags, $nestingLevel + 1)
).($willBeInlined ? "\n" : '');
}
}
@ -138,26 +144,26 @@ class Dumper
return $output;
}
private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix): string
private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix, int $nestingLevel): string
{
$output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag());
$output = \sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag());
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) {
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue());
$output .= sprintf(' |%s', $blockIndentationIndicator);
$output .= \sprintf(' |%s', $blockIndentationIndicator);
foreach (explode("\n", $value->getValue()) as $row) {
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
$output .= \sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
}
return $output;
}
if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
return $output.' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
return $output.' '.$this->doDump($value->getValue(), $inline - 1, 0, $flags, $nestingLevel + 1)."\n";
}
return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags);
return $output."\n".$this->doDump($value->getValue(), $inline - 1, $indent, $flags, $nestingLevel + 1);
}
private function getBlockIndentationIndicator(string $value): string
@ -169,7 +175,7 @@ class Dumper
// http://www.yaml.org/spec/1.2/spec.html#id2793979
foreach ($lines as $line) {
if ('' !== trim($line, ' ')) {
return (' ' === substr($line, 0, 1)) ? (string) $this->indentation : '';
return str_starts_with($line, ' ') ? (string) $this->indentation : '';
}
}

View file

@ -28,22 +28,24 @@ class Escaper
// first to ensure proper escaping because str_replace operates iteratively
// on the input arrays. This ordering of the characters avoids the use of strtr,
// which performs more slowly.
private const ESCAPEES = ['\\', '\\\\', '\\"', '"',
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
"\x7f",
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",
];
private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"',
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
'\\x7f',
'\\N', '\\_', '\\L', '\\P',
];
private const ESCAPEES = [
'\\', '\\\\', '\\"', '"',
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
"\x7f",
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",
];
private const ESCAPED = [
'\\\\', '\\"', '\\\\', '\\"',
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
'\\x7f',
'\\N', '\\_', '\\L', '\\P',
];
/**
* Determines if a PHP value would require double quoting in YAML.
@ -62,7 +64,7 @@ class Escaper
*/
public static function escapeWithDoubleQuotes(string $value): string
{
return sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value));
return \sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value));
}
/**
@ -80,7 +82,7 @@ class Escaper
// Determines if the PHP value contains any single characters that would
// cause it to require single quoting in YAML.
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value);
return 0 < preg_match('/[\s\'"\:\{\}\[\],&\*\#\?] | \A[\-?|<>=!%@`\p{Zs}]/xu', $value);
}
/**
@ -90,6 +92,6 @@ class Escaper
*/
public static function escapeWithSingleQuotes(string $value): string
{
return sprintf("'%s'", str_replace('\'', '\'\'', $value));
return \sprintf("'%s'", str_replace('\'', '\'\'', $value));
}
}

View file

@ -18,24 +18,19 @@ namespace Symfony\Component\Yaml\Exception;
*/
class ParseException extends RuntimeException
{
private ?string $parsedFile;
private int $parsedLine;
private ?string $snippet;
private string $rawMessage;
/**
* @param string $message The error message
* @param string $rawMessage The error message
* @param int $parsedLine The line where the error occurred
* @param string|null $snippet The snippet of code near the problem
* @param string|null $parsedFile The file name where the error occurred
*/
public function __construct(string $message, int $parsedLine = -1, ?string $snippet = null, ?string $parsedFile = null, ?\Throwable $previous = null)
{
$this->parsedFile = $parsedFile;
$this->parsedLine = $parsedLine;
$this->snippet = $snippet;
$this->rawMessage = $message;
public function __construct(
private string $rawMessage,
private int $parsedLine = -1,
private ?string $snippet = null,
private ?string $parsedFile = null,
?\Throwable $previous = null,
) {
$this->updateRepr();
parent::__construct($this->message, 0, $previous);
@ -51,10 +46,8 @@ class ParseException extends RuntimeException
/**
* Sets the snippet of code near the error.
*
* @return void
*/
public function setSnippet(string $snippet)
public function setSnippet(string $snippet): void
{
$this->snippet = $snippet;
@ -73,10 +66,8 @@ class ParseException extends RuntimeException
/**
* Sets the filename where the error occurred.
*
* @return void
*/
public function setParsedFile(string $parsedFile)
public function setParsedFile(string $parsedFile): void
{
$this->parsedFile = $parsedFile;
@ -93,10 +84,8 @@ class ParseException extends RuntimeException
/**
* Sets the line where the error occurred.
*
* @return void
*/
public function setParsedLine(int $parsedLine)
public function setParsedLine(int $parsedLine): void
{
$this->parsedLine = $parsedLine;
@ -114,15 +103,15 @@ class ParseException extends RuntimeException
}
if (null !== $this->parsedFile) {
$this->message .= sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
$this->message .= \sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
}
if ($this->parsedLine >= 0) {
$this->message .= sprintf(' at line %d', $this->parsedLine);
$this->message .= \sprintf(' at line %d', $this->parsedLine);
}
if ($this->snippet) {
$this->message .= sprintf(' (near "%s")', $this->snippet);
$this->message .= \sprintf(' (near "%s")', $this->snippet);
}
if ($dot) {

View file

@ -82,7 +82,7 @@ class Inline
// some comments are allowed at the end
if (preg_replace('/\s*#.*$/A', '', substr($value, $i))) {
throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
throw new ParseException(\sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
}
if (null !== $tag && '' !== $tag) {
@ -100,12 +100,12 @@ class Inline
*
* @throws DumpException When trying to dump PHP resource
*/
public static function dump(mixed $value, int $flags = 0): string
public static function dump(mixed $value, int $flags = 0, bool $rootLevel = false): string
{
switch (true) {
case \is_resource($value):
if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value)));
throw new DumpException(\sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value)));
}
return self::dumpNull($flags);
@ -116,7 +116,7 @@ class Inline
default => 'Y-m-d\TH:i:s.uP',
});
case $value instanceof \UnitEnum:
return sprintf('!php/const %s::%s', $value::class, $value->name);
return \sprintf('!php/enum %s::%s', $value::class, $value->name);
case \is_object($value):
if ($value instanceof TaggedValue) {
return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags);
@ -138,7 +138,7 @@ class Inline
case \is_array($value):
return self::dumpArray($value, $flags);
case null === $value:
return self::dumpNull($flags);
return self::dumpNull($flags, $rootLevel);
case true === $value:
return 'true';
case false === $value:
@ -173,6 +173,7 @@ class Inline
case self::isBinaryString($value):
return '!!binary '.base64_encode($value);
case Escaper::requiresDoubleQuoting($value):
case Yaml::DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES & $flags:
return Escaper::escapeWithDoubleQuotes($value);
case Escaper::requiresSingleQuoting($value):
$singleQuoted = Escaper::escapeWithSingleQuotes($value);
@ -227,7 +228,7 @@ class Inline
$output[] = self::dump($val, $flags);
}
return sprintf('[%s]', implode(', ', $output));
return \sprintf('[%s]', implode(', ', $output));
}
return self::dumpHashArray($value, $flags);
@ -242,23 +243,28 @@ class Inline
private static function dumpHashArray(array|\ArrayObject|\stdClass $value, int $flags): string
{
$output = [];
$keyFlags = $flags &~ Yaml::DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES;
foreach ($value as $key => $val) {
if (\is_int($key) && Yaml::DUMP_NUMERIC_KEY_AS_STRING & $flags) {
$key = (string) $key;
}
$output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags));
$output[] = \sprintf('%s: %s', self::dump($key, $keyFlags), self::dump($val, $flags));
}
return sprintf('{ %s }', implode(', ', $output));
return \sprintf('{ %s }', implode(', ', $output));
}
private static function dumpNull(int $flags): string
private static function dumpNull(int $flags, bool $rootLevel = false): string
{
if (Yaml::DUMP_NULL_AS_TILDE & $flags) {
return '~';
}
if (Yaml::DUMP_NULL_AS_EMPTY & $flags && !$rootLevel) {
return '';
}
return 'null';
}
@ -277,10 +283,10 @@ class Inline
if (null !== $delimiters) {
$tmp = ltrim(substr($scalar, $i), " \n");
if ('' === $tmp) {
throw new ParseException(sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
if (!\in_array($tmp[0], $delimiters)) {
throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
}
} else {
@ -300,12 +306,12 @@ class Inline
$i += \strlen($output);
$output = trim($output);
} else {
throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $scalar), self::$parsedLineNumber + 1, null, self::$parsedFilename);
throw new ParseException(\sprintf('Malformed inline YAML string: "%s".', $scalar), self::$parsedLineNumber + 1, null, self::$parsedFilename);
}
// a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >)
if ($output && ('@' === $output[0] || '`' === $output[0] || '|' === $output[0] || '>' === $output[0] || '%' === $output[0])) {
throw new ParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]), self::$parsedLineNumber + 1, $output, self::$parsedFilename);
throw new ParseException(\sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]), self::$parsedLineNumber + 1, $output, self::$parsedFilename);
}
if ($evaluate) {
@ -324,7 +330,7 @@ class Inline
private static function parseQuotedScalar(string $scalar, int &$i = 0): string
{
if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
throw new ParseException(sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
$output = substr($match[0], 1, -1);
@ -412,7 +418,7 @@ class Inline
++$i;
}
throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $sequence), self::$parsedLineNumber + 1, null, self::$parsedFilename);
throw new ParseException(\sprintf('Malformed inline YAML string: "%s".', $sequence), self::$parsedLineNumber + 1, null, self::$parsedFilename);
}
/**
@ -504,7 +510,7 @@ class Inline
$output[$key] = $value;
}
} elseif (isset($output[$key])) {
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
throw new ParseException(\sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
}
break;
case '{':
@ -523,7 +529,7 @@ class Inline
$output[$key] = $value;
}
} elseif (isset($output[$key])) {
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
throw new ParseException(\sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
}
break;
default:
@ -546,7 +552,7 @@ class Inline
$output[$key] = $value;
}
} elseif (isset($output[$key])) {
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
throw new ParseException(\sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
}
--$i;
}
@ -556,7 +562,7 @@ class Inline
}
}
throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $mapping), self::$parsedLineNumber + 1, null, self::$parsedFilename);
throw new ParseException(\sprintf('Malformed inline YAML string: "%s".', $mapping), self::$parsedLineNumber + 1, null, self::$parsedFilename);
}
/**
@ -577,12 +583,12 @@ class Inline
}
// an unquoted *
if (false === $value || '' === $value) {
if ('' === $value) {
throw new ParseException('A reference must contain at least one character.', self::$parsedLineNumber + 1, $value, self::$parsedFilename);
}
if (!\array_key_exists($value, $references)) {
throw new ParseException(sprintf('Reference "%s" does not exist.', $value), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
throw new ParseException(\sprintf('Reference "%s" does not exist.', $value), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
}
return $references[$value];
@ -602,7 +608,7 @@ class Inline
case '!' === $scalar[0]:
switch (true) {
case str_starts_with($scalar, '!!str '):
$s = (string) substr($scalar, 6);
$s = substr($scalar, 6);
if (\in_array($s[0] ?? '', ['"', "'"], true)) {
$isQuotedString = true;
@ -637,10 +643,10 @@ class Inline
return \constant($const);
}
throw new ParseException(sprintf('The constant "%s" is not defined.', $const), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('The constant "%s" is not defined.', $const), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
if (self::$exceptionOnInvalidType) {
throw new ParseException(sprintf('The string "%s" could not be parsed as a constant. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('The string "%s" could not be parsed as a constant. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
return null;
@ -651,30 +657,37 @@ class Inline
}
$i = 0;
$enum = self::parseScalar(substr($scalar, 10), 0, null, $i, false);
if ($useValue = str_ends_with($enum, '->value')) {
$enum = substr($enum, 0, -7);
$enumName = self::parseScalar(substr($scalar, 10), 0, null, $i, false);
$useName = str_contains($enumName, '::');
$enum = $useName ? strstr($enumName, '::', true) : $enumName;
if (!enum_exists($enum)) {
throw new ParseException(\sprintf('The enum "%s" is not defined.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
if (!\defined($enum)) {
throw new ParseException(sprintf('The enum "%s" is not defined.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
if (!$useName) {
return $enum::cases();
}
if ($useValue = str_ends_with($enumName, '->value')) {
$enumName = substr($enumName, 0, -7);
}
$value = \constant($enum);
if (!$value instanceof \UnitEnum) {
throw new ParseException(sprintf('The string "%s" is not the name of a valid enum.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
if (!\defined($enumName)) {
throw new ParseException(\sprintf('The string "%s" is not the name of a valid enum.', $enumName), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
$value = \constant($enumName);
if (!$useValue) {
return $value;
}
if (!$value instanceof \BackedEnum) {
throw new ParseException(sprintf('The enum "%s" defines no value next to its name.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('The enum "%s" defines no value next to its name.', $enumName), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
return $value->value;
}
if (self::$exceptionOnInvalidType) {
throw new ParseException(sprintf('The string "%s" could not be parsed as an enum. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('The string "%s" could not be parsed as an enum. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
return null;
@ -684,7 +697,7 @@ class Inline
return self::evaluateBinaryScalar(substr($scalar, 9));
}
throw new ParseException(sprintf('The string "%s" could not be parsed as it uses an unsupported built-in tag.', $scalar), self::$parsedLineNumber, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('The string "%s" could not be parsed as it uses an unsupported built-in tag.', $scalar), self::$parsedLineNumber, $scalar, self::$parsedFilename);
case preg_match('/^(?:\+|-)?0o(?P<value>[0-7_]++)$/', $scalar, $matches):
$value = str_replace('_', '', $matches['value']);
@ -737,7 +750,7 @@ class Inline
if (false !== $scalar = $time->getTimestamp()) {
return $scalar;
}
} catch (\ValueError) {
} catch (\DateRangeError|\ValueError) {
// no-op
}
@ -774,18 +787,18 @@ class Inline
// Built-in tags
if ('' !== $tag && '!' === $tag[0]) {
throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
throw new ParseException(\sprintf('The built-in tag "!%s" is not implemented.', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
}
if ('' !== $tag && !isset($value[$i])) {
throw new ParseException(sprintf('Missing value for tag "%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
throw new ParseException(\sprintf('Missing value for tag "%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
}
if ('' === $tag || Yaml::PARSE_CUSTOM_TAGS & $flags) {
return $tag;
}
throw new ParseException(sprintf('Tags support is not enabled. Enable the "Yaml::PARSE_CUSTOM_TAGS" flag to use "!%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
throw new ParseException(\sprintf('Tags support is not enabled. Enable the "Yaml::PARSE_CUSTOM_TAGS" flag to use "!%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
}
public static function evaluateBinaryScalar(string $scalar): string
@ -793,11 +806,11 @@ class Inline
$parsedBinaryData = self::parseScalar(preg_replace('/\s/', '', $scalar));
if (0 !== (\strlen($parsedBinaryData) % 4)) {
throw new ParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', \strlen($parsedBinaryData)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', \strlen($parsedBinaryData)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
if (!Parser::preg_match('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) {
throw new ParseException(sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(\sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
return base64_decode($parsedBinaryData, true);

View file

@ -42,19 +42,19 @@ class Parser
/**
* Parses a YAML file into a PHP value.
*
* @param string $filename The path to the YAML file to be parsed
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
* @param string $filename The path to the YAML file to be parsed
* @param int-mask-of<Yaml::PARSE_*> $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
*
* @throws ParseException If the file could not be read or the YAML is not valid
*/
public function parseFile(string $filename, int $flags = 0): mixed
{
if (!is_file($filename)) {
throw new ParseException(sprintf('File "%s" does not exist.', $filename));
throw new ParseException(\sprintf('File "%s" does not exist.', $filename));
}
if (!is_readable($filename)) {
throw new ParseException(sprintf('File "%s" cannot be read.', $filename));
throw new ParseException(\sprintf('File "%s" cannot be read.', $filename));
}
$this->filename = $filename;
@ -69,8 +69,8 @@ class Parser
/**
* Parses a YAML string to a PHP value.
*
* @param string $value A YAML string
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
* @param string $value A YAML string
* @param int-mask-of<Yaml::PARSE_*> $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
*
* @throws ParseException If the YAML is not valid
*/
@ -197,14 +197,9 @@ class Parser
array_pop($this->refsBeingParsed);
}
} elseif (
// @todo in 7.0 remove legacy "(?:!?!php/const:)?"
self::preg_match('#^(?P<key>(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P<value>.+))?$#u', rtrim($this->currentLine), $values)
self::preg_match('#^(?P<key>(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{!].*?)) *\:(( |\t)++(?P<value>.+))?$#u', rtrim($this->currentLine), $values)
&& (!str_contains($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"]))
) {
if (str_starts_with($values['key'], '!php/const:')) {
trigger_deprecation('symfony/yaml', '6.2', 'YAML syntax for key "%s" is deprecated and replaced by "!php/const %s".', $values['key'], substr($values['key'], 11));
}
if ($context && 'sequence' == $context) {
throw new ParseException('You cannot define a mapping item when in a sequence.', $this->currentLineNb + 1, $this->currentLine, $this->filename);
}
@ -235,10 +230,10 @@ class Parser
$refName = substr(rtrim($values['value']), 1);
if (!\array_key_exists($refName, $this->refs)) {
if (false !== $pos = array_search($refName, $this->refsBeingParsed, true)) {
throw new ParseException(sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$refName])), $refName), $this->currentLineNb + 1, $this->currentLine, $this->filename);
throw new ParseException(\sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$refName])), $refName), $this->currentLineNb + 1, $this->currentLine, $this->filename);
}
throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
throw new ParseException(\sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
}
$refValue = $this->refs[$refName];
@ -305,13 +300,17 @@ class Parser
// Spec: Keys MUST be unique; first one wins.
// But overwriting is allowed when a merge node is used in current block.
if ($allowOverwrite || !isset($data[$key])) {
if (!$allowOverwrite && \array_key_exists($key, $data)) {
trigger_deprecation('symfony/yaml', '7.2', 'Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated and will throw a ParseException in 8.0.', $key, $this->getRealCurrentLineNb() + 1);
}
if (null !== $subTag) {
$data[$key] = new TaggedValue($subTag, '');
} else {
$data[$key] = null;
}
} else {
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine);
throw new ParseException(\sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine);
}
} else {
// remember the parsed line number here in case we need it to provide some contexts in error messages below
@ -326,6 +325,10 @@ class Parser
$data += $value;
} elseif ($allowOverwrite || !isset($data[$key])) {
if (!$allowOverwrite && \array_key_exists($key, $data)) {
trigger_deprecation('symfony/yaml', '7.2', 'Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated and will throw a ParseException in 8.0.', $key, $this->getRealCurrentLineNb() + 1);
}
// Spec: Keys MUST be unique; first one wins.
// But overwriting is allowed when a merge node is used in current block.
if (null !== $subTag) {
@ -334,7 +337,7 @@ class Parser
$data[$key] = $value;
}
} else {
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $realCurrentLineNbKey + 1, $this->currentLine);
throw new ParseException(\sprintf('Duplicate key "%s" detected.', $key), $realCurrentLineNbKey + 1, $this->currentLine);
}
}
} else {
@ -342,9 +345,13 @@ class Parser
// Spec: Keys MUST be unique; first one wins.
// But overwriting is allowed when a merge node is used in current block.
if ($allowOverwrite || !isset($data[$key])) {
if (!$allowOverwrite && \array_key_exists($key, $data)) {
trigger_deprecation('symfony/yaml', '7.2', 'Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated and will throw a ParseException in 8.0.', $key, $this->getRealCurrentLineNb() + 1);
}
$data[$key] = $value;
} else {
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine);
throw new ParseException(\sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine);
}
}
if ($isRef) {
@ -412,7 +419,7 @@ class Parser
throw new ParseException('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine, $this->filename);
}
if ($deprecatedUsage = (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $this->currentLine[1])) {
if (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $this->currentLine[1]) {
throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
}
@ -442,7 +449,7 @@ class Parser
continue;
}
// If the indentation is not consistent at offset 0, it is to be considered as a ParseError
if (0 === $this->offset && !$deprecatedUsage && isset($line[0]) && ' ' === $line[0]) {
if (0 === $this->offset && isset($line[0]) && ' ' === $line[0]) {
throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
}
@ -499,7 +506,7 @@ class Parser
$data = $object;
}
return empty($data) ? null : $data;
return $data ?: null;
}
private function parseBlock(int $offset, string $yaml, int $flags): mixed
@ -711,10 +718,10 @@ class Parser
if (!\array_key_exists($value, $this->refs)) {
if (false !== $pos = array_search($value, $this->refsBeingParsed, true)) {
throw new ParseException(sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$value])), $value), $this->currentLineNb + 1, $this->currentLine, $this->filename);
throw new ParseException(\sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$value])), $value), $this->currentLineNb + 1, $this->currentLine, $this->filename);
}
throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine, $this->filename);
throw new ParseException(\sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine, $this->filename);
}
return $this->refs[$value];
@ -754,7 +761,7 @@ class Parser
$parsedValue = Inline::parse($this->lexInlineQuotedString($cursor), $flags, $this->refs);
if (isset($this->currentLine[$cursor]) && preg_replace('/\s*(#.*)?$/A', '', substr($this->currentLine, $cursor))) {
throw new ParseException(sprintf('Unexpected characters near "%s".', substr($this->currentLine, $cursor)));
throw new ParseException(\sprintf('Unexpected characters near "%s".', substr($this->currentLine, $cursor)));
}
return $parsedValue;
@ -839,7 +846,7 @@ class Parser
}
if ($indentation > 0) {
$pattern = sprintf('/^ {%d}(.*)$/', $indentation);
$pattern = \sprintf('/^ {%d}(.*)$/', $indentation);
while (
$notEOF && (
@ -867,7 +874,7 @@ class Parser
if ($notEOF) {
$blockLines[] = '';
$this->moveToPreviousLine();
} elseif (!$notEOF && !$this->isCurrentLineLastLineInDocument()) {
} elseif (!$this->isCurrentLineLastLineInDocument()) {
$blockLines[] = '';
}
@ -1081,14 +1088,14 @@ class Parser
// Built-in tags
if ($tag && '!' === $tag[0]) {
throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), $this->getRealCurrentLineNb() + 1, $value, $this->filename);
throw new ParseException(\sprintf('The built-in tag "!%s" is not implemented.', $tag), $this->getRealCurrentLineNb() + 1, $value, $this->filename);
}
if (Yaml::PARSE_CUSTOM_TAGS & $flags) {
return $tag;
}
throw new ParseException(sprintf('Tags support is not enabled. You must use the flag "Yaml::PARSE_CUSTOM_TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $this->filename);
throw new ParseException(\sprintf('Tags support is not enabled. You must use the flag "Yaml::PARSE_CUSTOM_TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $this->filename);
}
private function lexInlineQuotedString(int &$cursor = 0): string
@ -1159,8 +1166,8 @@ class Parser
{
$offset = $cursor;
while ($cursor < strlen($this->currentLine)) {
if (in_array($this->currentLine[$cursor], ['[', ']', '{', '}', ',', ':'], true)) {
while ($cursor < \strlen($this->currentLine)) {
if (\in_array($this->currentLine[$cursor], ['[', ']', '{', '}', ',', ':'], true)) {
break;
}
@ -1217,8 +1224,8 @@ class Parser
$value .= $this->currentLine[$cursor];
++$cursor;
if ($consumeUntilEol && isset($this->currentLine[$cursor]) && ($whitespaces = strspn($this->currentLine, ' ', $cursor) + $cursor) < strlen($this->currentLine) && '#' !== $this->currentLine[$whitespaces]) {
throw new ParseException(sprintf('Unexpected token "%s".', trim(substr($this->currentLine, $cursor))));
if ($consumeUntilEol && isset($this->currentLine[$cursor]) && ($whitespaces = strspn($this->currentLine, ' ', $cursor) + $cursor) < \strlen($this->currentLine) && '#' !== $this->currentLine[$whitespaces]) {
throw new ParseException(\sprintf('Unexpected token "%s".', trim(substr($this->currentLine, $cursor))));
}
return $value;

View file

@ -17,13 +17,10 @@ namespace Symfony\Component\Yaml\Tag;
*/
final class TaggedValue
{
private string $tag;
private mixed $value;
public function __construct(string $tag, mixed $value)
{
$this->tag = $tag;
$this->value = $value;
public function __construct(
private string $tag,
private mixed $value,
) {
}
public function getTag(): string

View file

@ -84,7 +84,7 @@ class Unescaper
'x' => self::utf8chr(hexdec(substr($value, 2, 2))),
'u' => self::utf8chr(hexdec(substr($value, 2, 4))),
'U' => self::utf8chr(hexdec(substr($value, 2, 8))),
default => throw new ParseException(sprintf('Found unknown escape character "%s".', $value)),
default => throw new ParseException(\sprintf('Found unknown escape character "%s".', $value)),
};
}

View file

@ -35,6 +35,9 @@ class Yaml
public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024;
public const DUMP_NULL_AS_TILDE = 2048;
public const DUMP_NUMERIC_KEY_AS_STRING = 4096;
public const DUMP_NULL_AS_EMPTY = 8192;
public const DUMP_COMPACT_NESTED_MAPPING = 16384;
public const DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES = 32768;
/**
* Parses a YAML file into a PHP value.
@ -44,8 +47,8 @@ class Yaml
* $array = Yaml::parseFile('config.yml');
* print_r($array);
*
* @param string $filename The path to the YAML file to be parsed
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
* @param string $filename The path to the YAML file to be parsed
* @param int-mask-of<self::PARSE_*> $flags A bit field of PARSE_* constants to customize the YAML parser behavior
*
* @throws ParseException If the file could not be read or the YAML is not valid
*/
@ -65,8 +68,8 @@ class Yaml
* print_r($array);
* </code>
*
* @param string $input A string containing YAML
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
* @param string $input A string containing YAML
* @param int-mask-of<self::PARSE_*> $flags A bit field of PARSE_* constants to customize the YAML parser behavior
*
* @throws ParseException If the YAML is not valid
*/
@ -83,10 +86,10 @@ class Yaml
* The dump method, when supplied with an array, will do its best
* to convert the array into friendly YAML.
*
* @param mixed $input The PHP value
* @param int $inline The level where you switch to inline YAML
* @param int $indent The amount of spaces to use for indentation of nested nodes
* @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string
* @param mixed $input The PHP value
* @param int $inline The level where you switch to inline YAML
* @param int $indent The amount of spaces to use for indentation of nested nodes
* @param int-mask-of<self::DUMP_*> $flags A bit field of DUMP_* constants to customize the dumped YAML string
*/
public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
{

View file

@ -16,15 +16,15 @@
}
],
"require": {
"php": ">=8.1",
"symfony/deprecation-contracts": "^2.5|^3",
"php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3.0",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"symfony/console": "^5.4|^6.0|^7.0"
"symfony/console": "^6.4|^7.0"
},
"conflict": {
"symfony/console": "<5.4"
"symfony/console": "<6.4"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Yaml\\": "" },