Upgrade to 4.0.0

This commit is contained in:
Bastian Allgeier
2023-11-28 09:33:56 +01:00
parent f96b96af76
commit 3b0b6546ca
480 changed files with 21371 additions and 13327 deletions

View File

@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInita8011b477bb239488e5d139cdeb7b31e::getLoader();
return ComposerAutoloaderInit0bf5c8a9cfa251a218fc581ac888fe35::getLoader();

View File

@@ -112,9 +112,8 @@ if (PHP_VERSION_ID < 80000) {
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint');
exit(0);
return include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint');
}
}
include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint';
return include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint';

View File

@@ -0,0 +1,19 @@
Copyright (c) 2013-2014 Christian Riesen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,168 @@
<?php
declare(strict_types=1);
namespace Base32;
/**
* Base32 encoder and decoder.
*
* RFC 4648 compliant
*
* @see http://www.ietf.org/rfc/rfc4648.txt
* Some groundwork based on this class
* https://github.com/NTICompass/PHP-Base32
*
* @author Christian Riesen <chris.riesen@gmail.com>
* @author Sam Williams <sam@badcow.co>
*
* @see http://christianriesen.com
*
* @license MIT License see LICENSE file
*/
class Base32
{
/**
* Alphabet for encoding and decoding base32.
*
* @var string
*/
protected const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=';
protected const BASE32HEX_PATTERN = '/[^A-Z2-7]/';
/**
* Maps the Base32 character to its corresponding bit value.
*/
protected const MAPPING = [
'=' => 0b00000,
'A' => 0b00000,
'B' => 0b00001,
'C' => 0b00010,
'D' => 0b00011,
'E' => 0b00100,
'F' => 0b00101,
'G' => 0b00110,
'H' => 0b00111,
'I' => 0b01000,
'J' => 0b01001,
'K' => 0b01010,
'L' => 0b01011,
'M' => 0b01100,
'N' => 0b01101,
'O' => 0b01110,
'P' => 0b01111,
'Q' => 0b10000,
'R' => 0b10001,
'S' => 0b10010,
'T' => 0b10011,
'U' => 0b10100,
'V' => 0b10101,
'W' => 0b10110,
'X' => 0b10111,
'Y' => 0b11000,
'Z' => 0b11001,
'2' => 0b11010,
'3' => 0b11011,
'4' => 0b11100,
'5' => 0b11101,
'6' => 0b11110,
'7' => 0b11111,
];
/**
* Encodes into base32.
*
* @param string $string Clear text string
*
* @return string Base32 encoded string
*/
public static function encode(string $string): string
{
// Empty string results in empty string
if ('' === $string) {
return '';
}
$encoded = '';
//Set the initial values
$n = $bitLen = $val = 0;
$len = \strlen($string);
//Pad the end of the string - this ensures that there are enough zeros
$string .= \str_repeat(\chr(0), 4);
//Explode string into integers
$chars = (array) \unpack('C*', $string, 0);
while ($n < $len || 0 !== $bitLen) {
//If the bit length has fallen below 5, shift left 8 and add the next character.
if ($bitLen < 5) {
$val = $val << 8;
$bitLen += 8;
$n++;
$val += $chars[$n];
}
$shift = $bitLen - 5;
$encoded .= ($n - (int)($bitLen > 8) > $len && 0 == $val) ? '=' : static::ALPHABET[$val >> $shift];
$val = $val & ((1 << $shift) - 1);
$bitLen -= 5;
}
return $encoded;
}
/**
* Decodes base32.
*
* @param string $base32String Base32 encoded string
*
* @return string Clear text string
*/
public static function decode(string $base32String): string
{
// Only work in upper cases
$base32String = \strtoupper($base32String);
// Remove anything that is not base32 alphabet
$base32String = \preg_replace(static::BASE32HEX_PATTERN, '', $base32String);
// Empty string results in empty string
if ('' === $base32String || null === $base32String) {
return '';
}
$decoded = '';
//Set the initial values
$len = \strlen($base32String);
$n = 0;
$bitLen = 5;
$val = static::MAPPING[$base32String[0]];
while ($n < $len) {
//If the bit length has fallen below 8, shift left 5 and add the next pentet.
if ($bitLen < 8) {
$val = $val << 5;
$bitLen += 5;
$n++;
$pentet = $base32String[$n] ?? '=';
//If the new pentet is padding, make this the last iteration.
if ('=' === $pentet) {
$n = $len;
}
$val += static::MAPPING[$pentet];
continue;
}
$shift = $bitLen - 8;
$decoded .= \chr($val >> $shift);
$val = $val & ((1 << $shift) - 1);
$bitLen -= 8;
}
return $decoded;
}
}

View File

@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
namespace Base32;
/**
* Base32Hex encoder and decoder.
*
* RFC 4648 compliant
* @see http://www.ietf.org/rfc/rfc4648.txt
*
* @author Sam Williams <sam@badcow.co>
*
* @see http://christianriesen.com
*
* @license MIT License see LICENSE file
*/
class Base32Hex extends Base32
{
/**
* Alphabet for encoding and decoding base32 extended hex.
*
* @var string
*/
protected const ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUV=';
protected const BASE32HEX_PATTERN = '/[^0-9A-V]/';
/**
* Maps the Base32 character to its corresponding bit value.
*/
protected const MAPPING = [
'=' => 0b00000,
'0' => 0b00000,
'1' => 0b00001,
'2' => 0b00010,
'3' => 0b00011,
'4' => 0b00100,
'5' => 0b00101,
'6' => 0b00110,
'7' => 0b00111,
'8' => 0b01000,
'9' => 0b01001,
'A' => 0b01010,
'B' => 0b01011,
'C' => 0b01100,
'D' => 0b01101,
'E' => 0b01110,
'F' => 0b01111,
'G' => 0b10000,
'H' => 0b10001,
'I' => 0b10010,
'J' => 0b10011,
'K' => 0b10100,
'L' => 0b10101,
'M' => 0b10110,
'N' => 0b10111,
'O' => 0b11000,
'P' => 0b11001,
'Q' => 0b11010,
'R' => 0b11011,
'S' => 0b11100,
'T' => 0b11101,
'U' => 0b11110,
'V' => 0b11111,
];
}

View File

@@ -6,6 +6,8 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Base32\\Base32' => $vendorDir . '/christian-riesen/base32/src/Base32.php',
'Base32\\Base32Hex' => $vendorDir . '/christian-riesen/base32/src/Base32Hex.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Composer\\Semver\\Comparator' => $vendorDir . '/composer/semver/src/Comparator.php',
'Composer\\Semver\\CompilingMatcher' => $vendorDir . '/composer/semver/src/CompilingMatcher.php',
@@ -50,20 +52,18 @@ return array(
'Kirby\\Cms\\Auth\\Challenge' => $baseDir . '/src/Cms/Auth/Challenge.php',
'Kirby\\Cms\\Auth\\EmailChallenge' => $baseDir . '/src/Cms/Auth/EmailChallenge.php',
'Kirby\\Cms\\Auth\\Status' => $baseDir . '/src/Cms/Auth/Status.php',
'Kirby\\Cms\\Auth\\TotpChallenge' => $baseDir . '/src/Cms/Auth/TotpChallenge.php',
'Kirby\\Cms\\Block' => $baseDir . '/src/Cms/Block.php',
'Kirby\\Cms\\BlockConverter' => $baseDir . '/src/Cms/BlockConverter.php',
'Kirby\\Cms\\Blocks' => $baseDir . '/src/Cms/Blocks.php',
'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\\Content' => $baseDir . '/src/Cms/Content.php',
'Kirby\\Cms\\ContentLock' => $baseDir . '/src/Cms/ContentLock.php',
'Kirby\\Cms\\ContentLocks' => $baseDir . '/src/Cms/ContentLocks.php',
'Kirby\\Cms\\ContentTranslation' => $baseDir . '/src/Cms/ContentTranslation.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\\Field' => $baseDir . '/src/Cms/Field.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',
@@ -89,11 +89,15 @@ return array(
'Kirby\\Cms\\LanguageRouter' => $baseDir . '/src/Cms/LanguageRouter.php',
'Kirby\\Cms\\LanguageRoutes' => $baseDir . '/src/Cms/LanguageRoutes.php',
'Kirby\\Cms\\LanguageRules' => $baseDir . '/src/Cms/LanguageRules.php',
'Kirby\\Cms\\LanguageVariable' => $baseDir . '/src/Cms/LanguageVariable.php',
'Kirby\\Cms\\Languages' => $baseDir . '/src/Cms/Languages.php',
'Kirby\\Cms\\Layout' => $baseDir . '/src/Cms/Layout.php',
'Kirby\\Cms\\LayoutColumn' => $baseDir . '/src/Cms/LayoutColumn.php',
'Kirby\\Cms\\LayoutColumns' => $baseDir . '/src/Cms/LayoutColumns.php',
'Kirby\\Cms\\Layouts' => $baseDir . '/src/Cms/Layouts.php',
'Kirby\\Cms\\License' => $baseDir . '/src/Cms/License.php',
'Kirby\\Cms\\LicenseStatus' => $baseDir . '/src/Cms/LicenseStatus.php',
'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',
@@ -114,6 +118,7 @@ return array(
'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',
@@ -147,6 +152,12 @@ 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\\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\\Data\\Data' => $baseDir . '/src/Data/Data.php',
'Kirby\\Data\\Handler' => $baseDir . '/src/Data/Handler.php',
'Kirby\\Data\\Json' => $baseDir . '/src/Data/Json.php',
@@ -165,6 +176,7 @@ return array(
'Kirby\\Email\\Body' => $baseDir . '/src/Email/Body.php',
'Kirby\\Email\\Email' => $baseDir . '/src/Email/Email.php',
'Kirby\\Email\\PHPMailer' => $baseDir . '/src/Email/PHPMailer.php',
'Kirby\\Exception\\AuthException' => $baseDir . '/src/Exception/AuthException.php',
'Kirby\\Exception\\BadMethodCallException' => $baseDir . '/src/Exception/BadMethodCallException.php',
'Kirby\\Exception\\DuplicateException' => $baseDir . '/src/Exception/DuplicateException.php',
'Kirby\\Exception\\ErrorPageException' => $baseDir . '/src/Exception/ErrorPageException.php',
@@ -190,9 +202,6 @@ return array(
'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\\Options' => $baseDir . '/src/Form/Options.php',
'Kirby\\Form\\OptionsApi' => $baseDir . '/src/Form/OptionsApi.php',
'Kirby\\Form\\OptionsQuery' => $baseDir . '/src/Form/OptionsQuery.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',
@@ -224,28 +233,43 @@ return array(
'Kirby\\Image\\Darkroom\\ImageMagick' => $baseDir . '/src/Image/Darkroom/ImageMagick.php',
'Kirby\\Image\\Dimensions' => $baseDir . '/src/Image/Dimensions.php',
'Kirby\\Image\\Exif' => $baseDir . '/src/Image/Exif.php',
'Kirby\\Image\\Focus' => $baseDir . '/src/Image/Focus.php',
'Kirby\\Image\\Image' => $baseDir . '/src/Image/Image.php',
'Kirby\\Image\\Location' => $baseDir . '/src/Image/Location.php',
'Kirby\\Image\\QrCode' => $baseDir . '/src/Image/QrCode.php',
'Kirby\\Option\\Option' => $baseDir . '/src/Option/Option.php',
'Kirby\\Option\\Options' => $baseDir . '/src/Option/Options.php',
'Kirby\\Option\\OptionsApi' => $baseDir . '/src/Option/OptionsApi.php',
'Kirby\\Option\\OptionsProvider' => $baseDir . '/src/Option/OptionsProvider.php',
'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\\Dialog' => $baseDir . '/src/Panel/Dialog.php',
'Kirby\\Panel\\Document' => $baseDir . '/src/Panel/Document.php',
'Kirby\\Panel\\Drawer' => $baseDir . '/src/Panel/Drawer.php',
'Kirby\\Panel\\Dropdown' => $baseDir . '/src/Panel/Dropdown.php',
'Kirby\\Panel\\Field' => $baseDir . '/src/Panel/Field.php',
'Kirby\\Panel\\File' => $baseDir . '/src/Panel/File.php',
'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\\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',
'Kirby\\Panel\\Lab\\Template' => $baseDir . '/src/Panel/Lab/Template.php',
'Kirby\\Panel\\Menu' => $baseDir . '/src/Panel/Menu.php',
'Kirby\\Panel\\Model' => $baseDir . '/src/Panel/Model.php',
'Kirby\\Panel\\Page' => $baseDir . '/src/Panel/Page.php',
'Kirby\\Panel\\PageCreateDialog' => $baseDir . '/src/Panel/PageCreateDialog.php',
'Kirby\\Panel\\Panel' => $baseDir . '/src/Panel/Panel.php',
'Kirby\\Panel\\Plugins' => $baseDir . '/src/Panel/Plugins.php',
'Kirby\\Panel\\Redirect' => $baseDir . '/src/Panel/Redirect.php',
'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\\User' => $baseDir . '/src/Panel/User.php',
'Kirby\\Panel\\UserTotpDisableDialog' => $baseDir . '/src/Panel/UserTotpDisableDialog.php',
'Kirby\\Panel\\UserTotpEnableDialog' => $baseDir . '/src/Panel/UserTotpEnableDialog.php',
'Kirby\\Panel\\View' => $baseDir . '/src/Panel/View.php',
'Kirby\\Parsley\\Element' => $baseDir . '/src/Parsley/Element.php',
'Kirby\\Parsley\\Inline' => $baseDir . '/src/Parsley/Inline.php',
@@ -292,14 +316,15 @@ return array(
'Kirby\\Toolkit\\Html' => $baseDir . '/src/Toolkit/Html.php',
'Kirby\\Toolkit\\I18n' => $baseDir . '/src/Toolkit/I18n.php',
'Kirby\\Toolkit\\Iterator' => $baseDir . '/src/Toolkit/Iterator.php',
'Kirby\\Toolkit\\LazyValue' => $baseDir . '/src/Toolkit/LazyValue.php',
'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\\Query' => $baseDir . '/src/Toolkit/Query.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',
'Kirby\\Toolkit\\Totp' => $baseDir . '/src/Toolkit/Totp.php',
'Kirby\\Toolkit\\Tpl' => $baseDir . '/src/Toolkit/Tpl.php',
'Kirby\\Toolkit\\V' => $baseDir . '/src/Toolkit/V.php',
'Kirby\\Toolkit\\View' => $baseDir . '/src/Toolkit/View.php',

View File

@@ -18,4 +18,5 @@ return array(
'Laminas\\Escaper\\' => array($vendorDir . '/laminas/laminas-escaper/src'),
'Kirby\\' => array($baseDir . '/src', $vendorDir . '/getkirby/composer-installer/src'),
'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'),
'Base32\\' => array($vendorDir . '/christian-riesen/base32/src'),
);

View File

@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInita8011b477bb239488e5d139cdeb7b31e
class ComposerAutoloaderInit0bf5c8a9cfa251a218fc581ac888fe35
{
private static $loader;
@@ -22,16 +22,16 @@ class ComposerAutoloaderInita8011b477bb239488e5d139cdeb7b31e
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInita8011b477bb239488e5d139cdeb7b31e', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit0bf5c8a9cfa251a218fc581ac888fe35', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInita8011b477bb239488e5d139cdeb7b31e', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit0bf5c8a9cfa251a218fc581ac888fe35', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35::getInitializer($loader));
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35
{
public static $files = array (
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
@@ -47,6 +47,10 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
array (
'Composer\\Semver\\' => 16,
),
'B' =>
array (
'Base32\\' => 7,
),
);
public static $prefixDirsPsr4 = array (
@@ -99,6 +103,10 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
array (
0 => __DIR__ . '/..' . '/composer/semver/src',
),
'Base32\\' =>
array (
0 => __DIR__ . '/..' . '/christian-riesen/base32/src',
),
);
public static $prefixesPsr0 = array (
@@ -119,6 +127,8 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
);
public static $classMap = array (
'Base32\\Base32' => __DIR__ . '/..' . '/christian-riesen/base32/src/Base32.php',
'Base32\\Base32Hex' => __DIR__ . '/..' . '/christian-riesen/base32/src/Base32Hex.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Composer\\Semver\\Comparator' => __DIR__ . '/..' . '/composer/semver/src/Comparator.php',
'Composer\\Semver\\CompilingMatcher' => __DIR__ . '/..' . '/composer/semver/src/CompilingMatcher.php',
@@ -163,20 +173,18 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'Kirby\\Cms\\Auth\\Challenge' => __DIR__ . '/../..' . '/src/Cms/Auth/Challenge.php',
'Kirby\\Cms\\Auth\\EmailChallenge' => __DIR__ . '/../..' . '/src/Cms/Auth/EmailChallenge.php',
'Kirby\\Cms\\Auth\\Status' => __DIR__ . '/../..' . '/src/Cms/Auth/Status.php',
'Kirby\\Cms\\Auth\\TotpChallenge' => __DIR__ . '/../..' . '/src/Cms/Auth/TotpChallenge.php',
'Kirby\\Cms\\Block' => __DIR__ . '/../..' . '/src/Cms/Block.php',
'Kirby\\Cms\\BlockConverter' => __DIR__ . '/../..' . '/src/Cms/BlockConverter.php',
'Kirby\\Cms\\Blocks' => __DIR__ . '/../..' . '/src/Cms/Blocks.php',
'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\\Content' => __DIR__ . '/../..' . '/src/Cms/Content.php',
'Kirby\\Cms\\ContentLock' => __DIR__ . '/../..' . '/src/Cms/ContentLock.php',
'Kirby\\Cms\\ContentLocks' => __DIR__ . '/../..' . '/src/Cms/ContentLocks.php',
'Kirby\\Cms\\ContentTranslation' => __DIR__ . '/../..' . '/src/Cms/ContentTranslation.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\\Field' => __DIR__ . '/../..' . '/src/Cms/Field.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',
@@ -202,11 +210,15 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'Kirby\\Cms\\LanguageRouter' => __DIR__ . '/../..' . '/src/Cms/LanguageRouter.php',
'Kirby\\Cms\\LanguageRoutes' => __DIR__ . '/../..' . '/src/Cms/LanguageRoutes.php',
'Kirby\\Cms\\LanguageRules' => __DIR__ . '/../..' . '/src/Cms/LanguageRules.php',
'Kirby\\Cms\\LanguageVariable' => __DIR__ . '/../..' . '/src/Cms/LanguageVariable.php',
'Kirby\\Cms\\Languages' => __DIR__ . '/../..' . '/src/Cms/Languages.php',
'Kirby\\Cms\\Layout' => __DIR__ . '/../..' . '/src/Cms/Layout.php',
'Kirby\\Cms\\LayoutColumn' => __DIR__ . '/../..' . '/src/Cms/LayoutColumn.php',
'Kirby\\Cms\\LayoutColumns' => __DIR__ . '/../..' . '/src/Cms/LayoutColumns.php',
'Kirby\\Cms\\Layouts' => __DIR__ . '/../..' . '/src/Cms/Layouts.php',
'Kirby\\Cms\\License' => __DIR__ . '/../..' . '/src/Cms/License.php',
'Kirby\\Cms\\LicenseStatus' => __DIR__ . '/../..' . '/src/Cms/LicenseStatus.php',
'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',
@@ -227,6 +239,7 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'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',
@@ -260,6 +273,12 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'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\\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\\Data\\Data' => __DIR__ . '/../..' . '/src/Data/Data.php',
'Kirby\\Data\\Handler' => __DIR__ . '/../..' . '/src/Data/Handler.php',
'Kirby\\Data\\Json' => __DIR__ . '/../..' . '/src/Data/Json.php',
@@ -278,6 +297,7 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'Kirby\\Email\\Body' => __DIR__ . '/../..' . '/src/Email/Body.php',
'Kirby\\Email\\Email' => __DIR__ . '/../..' . '/src/Email/Email.php',
'Kirby\\Email\\PHPMailer' => __DIR__ . '/../..' . '/src/Email/PHPMailer.php',
'Kirby\\Exception\\AuthException' => __DIR__ . '/../..' . '/src/Exception/AuthException.php',
'Kirby\\Exception\\BadMethodCallException' => __DIR__ . '/../..' . '/src/Exception/BadMethodCallException.php',
'Kirby\\Exception\\DuplicateException' => __DIR__ . '/../..' . '/src/Exception/DuplicateException.php',
'Kirby\\Exception\\ErrorPageException' => __DIR__ . '/../..' . '/src/Exception/ErrorPageException.php',
@@ -303,9 +323,6 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'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\\Options' => __DIR__ . '/../..' . '/src/Form/Options.php',
'Kirby\\Form\\OptionsApi' => __DIR__ . '/../..' . '/src/Form/OptionsApi.php',
'Kirby\\Form\\OptionsQuery' => __DIR__ . '/../..' . '/src/Form/OptionsQuery.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',
@@ -337,28 +354,43 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'Kirby\\Image\\Darkroom\\ImageMagick' => __DIR__ . '/../..' . '/src/Image/Darkroom/ImageMagick.php',
'Kirby\\Image\\Dimensions' => __DIR__ . '/../..' . '/src/Image/Dimensions.php',
'Kirby\\Image\\Exif' => __DIR__ . '/../..' . '/src/Image/Exif.php',
'Kirby\\Image\\Focus' => __DIR__ . '/../..' . '/src/Image/Focus.php',
'Kirby\\Image\\Image' => __DIR__ . '/../..' . '/src/Image/Image.php',
'Kirby\\Image\\Location' => __DIR__ . '/../..' . '/src/Image/Location.php',
'Kirby\\Image\\QrCode' => __DIR__ . '/../..' . '/src/Image/QrCode.php',
'Kirby\\Option\\Option' => __DIR__ . '/../..' . '/src/Option/Option.php',
'Kirby\\Option\\Options' => __DIR__ . '/../..' . '/src/Option/Options.php',
'Kirby\\Option\\OptionsApi' => __DIR__ . '/../..' . '/src/Option/OptionsApi.php',
'Kirby\\Option\\OptionsProvider' => __DIR__ . '/../..' . '/src/Option/OptionsProvider.php',
'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\\Dialog' => __DIR__ . '/../..' . '/src/Panel/Dialog.php',
'Kirby\\Panel\\Document' => __DIR__ . '/../..' . '/src/Panel/Document.php',
'Kirby\\Panel\\Drawer' => __DIR__ . '/../..' . '/src/Panel/Drawer.php',
'Kirby\\Panel\\Dropdown' => __DIR__ . '/../..' . '/src/Panel/Dropdown.php',
'Kirby\\Panel\\Field' => __DIR__ . '/../..' . '/src/Panel/Field.php',
'Kirby\\Panel\\File' => __DIR__ . '/../..' . '/src/Panel/File.php',
'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\\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',
'Kirby\\Panel\\Lab\\Template' => __DIR__ . '/../..' . '/src/Panel/Lab/Template.php',
'Kirby\\Panel\\Menu' => __DIR__ . '/../..' . '/src/Panel/Menu.php',
'Kirby\\Panel\\Model' => __DIR__ . '/../..' . '/src/Panel/Model.php',
'Kirby\\Panel\\Page' => __DIR__ . '/../..' . '/src/Panel/Page.php',
'Kirby\\Panel\\PageCreateDialog' => __DIR__ . '/../..' . '/src/Panel/PageCreateDialog.php',
'Kirby\\Panel\\Panel' => __DIR__ . '/../..' . '/src/Panel/Panel.php',
'Kirby\\Panel\\Plugins' => __DIR__ . '/../..' . '/src/Panel/Plugins.php',
'Kirby\\Panel\\Redirect' => __DIR__ . '/../..' . '/src/Panel/Redirect.php',
'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\\User' => __DIR__ . '/../..' . '/src/Panel/User.php',
'Kirby\\Panel\\UserTotpDisableDialog' => __DIR__ . '/../..' . '/src/Panel/UserTotpDisableDialog.php',
'Kirby\\Panel\\UserTotpEnableDialog' => __DIR__ . '/../..' . '/src/Panel/UserTotpEnableDialog.php',
'Kirby\\Panel\\View' => __DIR__ . '/../..' . '/src/Panel/View.php',
'Kirby\\Parsley\\Element' => __DIR__ . '/../..' . '/src/Parsley/Element.php',
'Kirby\\Parsley\\Inline' => __DIR__ . '/../..' . '/src/Parsley/Inline.php',
@@ -405,14 +437,15 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'Kirby\\Toolkit\\Html' => __DIR__ . '/../..' . '/src/Toolkit/Html.php',
'Kirby\\Toolkit\\I18n' => __DIR__ . '/../..' . '/src/Toolkit/I18n.php',
'Kirby\\Toolkit\\Iterator' => __DIR__ . '/../..' . '/src/Toolkit/Iterator.php',
'Kirby\\Toolkit\\LazyValue' => __DIR__ . '/../..' . '/src/Toolkit/LazyValue.php',
'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\\Query' => __DIR__ . '/../..' . '/src/Toolkit/Query.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',
'Kirby\\Toolkit\\Totp' => __DIR__ . '/../..' . '/src/Toolkit/Totp.php',
'Kirby\\Toolkit\\Tpl' => __DIR__ . '/../..' . '/src/Toolkit/Tpl.php',
'Kirby\\Toolkit\\V' => __DIR__ . '/../..' . '/src/Toolkit/V.php',
'Kirby\\Toolkit\\View' => __DIR__ . '/../..' . '/src/Toolkit/View.php',
@@ -504,10 +537,10 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixesPsr0;
$loader->classMap = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35::$prefixesPsr0;
$loader->classMap = ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35::$classMap;
}, null, ClassLoader::class);
}

View File

@@ -1,5 +1,67 @@
{
"packages": [
{
"name": "christian-riesen/base32",
"version": "1.6.0",
"version_normalized": "1.6.0.0",
"source": {
"type": "git",
"url": "https://github.com/ChristianRiesen/base32.git",
"reference": "2e82dab3baa008e24a505649b0d583c31d31e894"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ChristianRiesen/base32/zipball/2e82dab3baa008e24a505649b0d583c31d31e894",
"reference": "2e82dab3baa008e24a505649b0d583c31d31e894",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.17",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^8.5.13 || ^9.5"
},
"time": "2021-02-26T10:19:33+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Base32\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Christian Riesen",
"email": "chris.riesen@gmail.com",
"homepage": "http://christianriesen.com",
"role": "Developer"
}
],
"description": "Base32 encoder/decoder according to RFC 4648",
"homepage": "https://github.com/ChristianRiesen/base32",
"keywords": [
"base32",
"decode",
"encode",
"rfc4648"
],
"support": {
"issues": "https://github.com/ChristianRiesen/base32/issues",
"source": "https://github.com/ChristianRiesen/base32/tree/1.6.0"
},
"install-path": "../christian-riesen/base32"
},
{
"name": "claviska/simpleimage",
"version": "4.0.6",
@@ -266,36 +328,36 @@
},
{
"name": "laminas/laminas-escaper",
"version": "2.12.0",
"version_normalized": "2.12.0.0",
"version": "2.13.0",
"version_normalized": "2.13.0.0",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-escaper.git",
"reference": "ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490"
"reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490",
"reference": "ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490",
"url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/af459883f4018d0f8a0c69c7a209daef3bf973ba",
"reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-mbstring": "*",
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0"
"php": "~8.1.0 || ~8.2.0 || ~8.3.0"
},
"conflict": {
"zendframework/zend-escaper": "*"
},
"require-dev": {
"infection/infection": "^0.26.6",
"laminas/laminas-coding-standard": "~2.4.0",
"infection/infection": "^0.27.0",
"laminas/laminas-coding-standard": "~2.5.0",
"maglnet/composer-require-checker": "^3.8.0",
"phpunit/phpunit": "^9.5.18",
"psalm/plugin-phpunit": "^0.17.0",
"vimeo/psalm": "^4.22.0"
"phpunit/phpunit": "^9.6.7",
"psalm/plugin-phpunit": "^0.18.4",
"vimeo/psalm": "^5.9"
},
"time": "2022-10-10T10:11:09+00:00",
"time": "2023-10-10T08:35:13+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -452,17 +514,17 @@
},
{
"name": "phpmailer/phpmailer",
"version": "v6.8.1",
"version_normalized": "6.8.1.0",
"version": "v6.9.1",
"version_normalized": "6.9.1.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "e88da8d679acc3824ff231fdc553565b802ac016"
"reference": "039de174cd9c17a8389754d3b877a2ed22743e18"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e88da8d679acc3824ff231fdc553565b802ac016",
"reference": "e88da8d679acc3824ff231fdc553565b802ac016",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18",
"reference": "039de174cd9c17a8389754d3b877a2ed22743e18",
"shasum": ""
},
"require": {
@@ -482,6 +544,7 @@
"yoast/phpunit-polyfills": "^1.0.4"
},
"suggest": {
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
@@ -491,7 +554,7 @@
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
},
"time": "2023-08-29T08:26:30+00:00",
"time": "2023-11-25T22:23:28+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -523,7 +586,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.1"
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1"
},
"funding": [
{
@@ -588,27 +651,27 @@
},
{
"name": "symfony/deprecation-contracts",
"version": "v2.5.2",
"version_normalized": "2.5.2.0",
"version": "v3.4.0",
"version_normalized": "3.4.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=8.1"
},
"time": "2022-01-02T09:53:40+00:00",
"time": "2023-05-23T14:45:45+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "2.5-dev"
"dev-main": "3.4-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -638,7 +701,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
},
"funding": [
{
@@ -1006,34 +1069,31 @@
},
{
"name": "symfony/yaml",
"version": "v5.4.30",
"version_normalized": "5.4.30.0",
"version": "v6.3.8",
"version_normalized": "6.3.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "c6980e82a6656f6ebfabfd82f7585794cb122554"
"reference": "3493af8a8dad7fa91c77fa473ba23ecd95334a92"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/c6980e82a6656f6ebfabfd82f7585794cb122554",
"reference": "c6980e82a6656f6ebfabfd82f7585794cb122554",
"url": "https://api.github.com/repos/symfony/yaml/zipball/3493af8a8dad7fa91c77fa473ba23ecd95334a92",
"reference": "3493af8a8dad7fa91c77fa473ba23ecd95334a92",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1|^3",
"php": ">=8.1",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/console": "<5.3"
"symfony/console": "<5.4"
},
"require-dev": {
"symfony/console": "^5.3|^6.0"
"symfony/console": "^5.4|^6.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"time": "2023-10-27T18:36:14+00:00",
"time": "2023-11-06T10:58:05+00:00",
"bin": [
"Resources/bin/yaml-lint"
],
@@ -1064,7 +1124,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v5.4.30"
"source": "https://github.com/symfony/yaml/tree/v6.3.8"
},
"funding": [
{

View File

@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'getkirby/cms',
'pretty_version' => '3.9.8',
'version' => '3.9.8.0',
'pretty_version' => '4.0.0',
'version' => '4.0.0.0',
'reference' => NULL,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
@@ -10,6 +10,15 @@
'dev' => true,
),
'versions' => array(
'christian-riesen/base32' => array(
'pretty_version' => '1.6.0',
'version' => '1.6.0.0',
'reference' => '2e82dab3baa008e24a505649b0d583c31d31e894',
'type' => 'library',
'install_path' => __DIR__ . '/../christian-riesen/base32',
'aliases' => array(),
'dev_requirement' => false,
),
'claviska/simpleimage' => array(
'pretty_version' => '4.0.6',
'version' => '4.0.6.0',
@@ -38,8 +47,8 @@
'dev_requirement' => false,
),
'getkirby/cms' => array(
'pretty_version' => '3.9.8',
'version' => '3.9.8.0',
'pretty_version' => '4.0.0',
'version' => '4.0.0.0',
'reference' => NULL,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
@@ -56,9 +65,9 @@
'dev_requirement' => false,
),
'laminas/laminas-escaper' => array(
'pretty_version' => '2.12.0',
'version' => '2.12.0.0',
'reference' => 'ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490',
'pretty_version' => '2.13.0',
'version' => '2.13.0.0',
'reference' => 'af459883f4018d0f8a0c69c7a209daef3bf973ba',
'type' => 'library',
'install_path' => __DIR__ . '/../laminas/laminas-escaper',
'aliases' => array(),
@@ -89,9 +98,9 @@
'dev_requirement' => false,
),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.8.1',
'version' => '6.8.1.0',
'reference' => 'e88da8d679acc3824ff231fdc553565b802ac016',
'pretty_version' => 'v6.9.1',
'version' => '6.9.1.0',
'reference' => '039de174cd9c17a8389754d3b877a2ed22743e18',
'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(),
@@ -107,9 +116,9 @@
'dev_requirement' => false,
),
'symfony/deprecation-contracts' => array(
'pretty_version' => 'v2.5.2',
'version' => '2.5.2.0',
'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
'pretty_version' => 'v3.4.0',
'version' => '3.4.0.0',
'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(),
@@ -158,9 +167,9 @@
),
),
'symfony/yaml' => array(
'pretty_version' => 'v5.4.30',
'version' => '5.4.30.0',
'reference' => 'c6980e82a6656f6ebfabfd82f7585794cb122554',
'pretty_version' => 'v6.3.8',
'version' => '6.3.8.0',
'reference' => '3493af8a8dad7fa91c77fa473ba23ecd95334a92',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/yaml',
'aliases' => array(),

View File

@@ -18,7 +18,7 @@
"config": {
"sort-packages": true,
"platform": {
"php": "7.4.99"
"php": "8.1.99"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
@@ -29,17 +29,17 @@
"extra": {
},
"require": {
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"ext-ctype": "*",
"ext-mbstring": "*"
},
"require-dev": {
"infection/infection": "^0.26.6",
"laminas/laminas-coding-standard": "~2.4.0",
"infection/infection": "^0.27.0",
"laminas/laminas-coding-standard": "~2.5.0",
"maglnet/composer-require-checker": "^3.8.0",
"phpunit/phpunit": "^9.5.18",
"psalm/plugin-phpunit": "^0.17.0",
"vimeo/psalm": "^4.22.0"
"phpunit/phpunit": "^9.6.7",
"psalm/plugin-phpunit": "^0.18.4",
"vimeo/psalm": "^5.9"
},
"autoload": {
"psr-4": {

View File

@@ -157,9 +157,21 @@ class Escaper
$this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE;
// set matcher callbacks
$this->htmlAttrMatcher = [$this, 'htmlAttrMatcher'];
$this->jsMatcher = [$this, 'jsMatcher'];
$this->cssMatcher = [$this, 'cssMatcher'];
$this->htmlAttrMatcher =
/** @param array<array-key, string> $matches */
function (array $matches): string {
return $this->htmlAttrMatcher($matches);
};
$this->jsMatcher =
/** @param array<array-key, string> $matches */
function (array $matches): string {
return $this->jsMatcher($matches);
};
$this->cssMatcher =
/** @param array<array-key, string> $matches */
function (array $matches): string {
return $this->cssMatcher($matches);
};
}
/**

View File

@@ -47,6 +47,7 @@
"yoast/phpunit-polyfills": "^1.0.4"
},
"suggest": {
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",

View File

@@ -0,0 +1,35 @@
<?php
/**
* Assamese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Manish Sarkar <manish.n.manish@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP ত্ৰুটি: প্ৰমাণীকৰণ কৰিব নোৱাৰি';
$PHPMAILER_LANG['buggy_php'] = 'আপোনাৰ PHP সংস্কৰণ এটা বাগৰ দ্বাৰা প্ৰভাৱিত হয় যাৰ ফলত নষ্ট বাৰ্তা হব পাৰে । ইয়াক সমাধান কৰিবলে, প্ৰেৰণ কৰিবলে SMTP ব্যৱহাৰ কৰক, আপোনাৰ php.ini ত mail.add_x_header বিকল্প নিষ্ক্ৰিয় কৰক, MacOS বা Linux লৈ সলনি কৰক, বা আপোনাৰ PHP সংস্কৰণ 7.0.17+ বা 7.1.3+ লৈ সলনি কৰক ।';
$PHPMAILER_LANG['connect_host'] = 'SMTP ত্ৰুটি: SMTP চাৰ্ভাৰৰ সৈতে সংযোগ কৰিবলে অক্ষম';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP ত্ৰুটি: তথ্য গ্ৰহণ কৰা হোৱা নাই';
$PHPMAILER_LANG['empty_message'] = 'বাৰ্তাৰ মূখ্য অংশ খালী।';
$PHPMAILER_LANG['encoding'] = 'অজ্ঞাত এনকোডিং: ';
$PHPMAILER_LANG['execute'] = 'এক্সিকিউট কৰিব নোৱাৰি: ';
$PHPMAILER_LANG['extension_missing'] = 'সম্প্ৰসাৰণ নোহোৱা হৈছে: ';
$PHPMAILER_LANG['file_access'] = 'ফাইল অভিগম কৰিবলে অক্ষম: ';
$PHPMAILER_LANG['file_open'] = 'ফাইল ত্ৰুটি: ফাইল খোলিবলৈ অক্ষম: ';
$PHPMAILER_LANG['from_failed'] = 'নিম্নলিখিত প্ৰেৰকৰ ঠিকনা(সমূহ) ব্যৰ্থ: ';
$PHPMAILER_LANG['instantiate'] = 'মেইল ফাংচনৰ এটা উদাহৰণ সৃষ্টি কৰিবলে অক্ষম';
$PHPMAILER_LANG['invalid_address'] = 'প্ৰেৰণ কৰিব নোৱাৰি: অবৈধ ইমেইল ঠিকনা: ';
$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডাৰৰ নাম বা মান';
$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোষ্টেন্ট্ৰি: ';
$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হস্ট:';
$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলাৰ সমৰ্থিত নহয়।';
$PHPMAILER_LANG['provide_address'] = 'আপুনি অন্ততঃ এটা গন্তব্য ইমেইল ঠিকনা দিব লাগিব';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP ত্ৰুটি: নিম্নলিখিত গন্তব্যস্থানসমূহ ব্যৰ্থ: ';
$PHPMAILER_LANG['signing'] = 'স্বাক্ষৰ কৰাত ব্যৰ্থ: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP কড: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'অতিৰিক্ত SMTP তথ্য: ';
$PHPMAILER_LANG['smtp_detail'] = 'বিৱৰণ:';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() ব্যৰ্থ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP চাৰ্ভাৰৰ ত্ৰুটি: ';
$PHPMAILER_LANG['variable_set'] = 'চলক নিৰ্ধাৰণ কৰিব পৰা নগল: ';
$PHPMAILER_LANG['extension_missing'] = 'অনুপস্থিত সম্প্ৰসাৰণ: ';

View File

@@ -0,0 +1,35 @@
<?php
/**
* Bengali PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Manish Sarkar <manish.n.manish@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP ত্রুটি: প্রমাণীকরণ করতে অক্ষম৷';
$PHPMAILER_LANG['buggy_php'] = 'আপনার PHP সংস্করণ একটি বাগ দ্বারা প্রভাবিত হয় যার ফলে দূষিত বার্তা হতে পারে। এটি ঠিক করতে, পাঠাতে SMTP ব্যবহার করুন, আপনার php.ini এ mail.add_x_header বিকল্পটি নিষ্ক্রিয় করুন, MacOS বা Linux-এ স্যুইচ করুন, অথবা আপনার PHP সংস্করণকে 7.0.17+ বা 7.1.3+ এ পরিবর্তন করুন।';
$PHPMAILER_LANG['connect_host'] = 'SMTP ত্রুটি: SMTP সার্ভারের সাথে সংযোগ করতে অক্ষম৷';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP ত্রুটি: ডেটা গ্রহণ করা হয়নি৷';
$PHPMAILER_LANG['empty_message'] = 'বার্তার অংশটি খালি।';
$PHPMAILER_LANG['encoding'] = 'অজানা এনকোডিং: ';
$PHPMAILER_LANG['execute'] = 'নির্বাহ করতে অক্ষম: ';
$PHPMAILER_LANG['extension_missing'] = 'এক্সটেনশন অনুপস্থিত:';
$PHPMAILER_LANG['file_access'] = 'ফাইল অ্যাক্সেস করতে অক্ষম: ';
$PHPMAILER_LANG['file_open'] = 'ফাইল ত্রুটি: ফাইল খুলতে অক্ষম: ';
$PHPMAILER_LANG['from_failed'] = 'নিম্নলিখিত প্রেরকের ঠিকানা(গুলি) ব্যর্থ হয়েছে: ';
$PHPMAILER_LANG['instantiate'] = 'মেল ফাংশনের একটি উদাহরণ তৈরি করতে অক্ষম৷';
$PHPMAILER_LANG['invalid_address'] = 'পাঠাতে অক্ষম: অবৈধ ইমেল ঠিকানা: ';
$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডার নাম বা মান';
$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোস্টেন্ট্রি: ';
$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হোস্ট:';
$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলার সমর্থিত নয়।';
$PHPMAILER_LANG['provide_address'] = 'আপনাকে অবশ্যই অন্তত একটি গন্তব্য ইমেল ঠিকানা প্রদান করতে হবে৷';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP ত্রুটি: নিম্নলিখিত গন্তব্যগুলি ব্যর্থ হয়েছে: ';
$PHPMAILER_LANG['signing'] = 'স্বাক্ষর করতে ব্যর্থ হয়েছে: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP কোড: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'অতিরিক্ত SMTP তথ্য:';
$PHPMAILER_LANG['smtp_detail'] = 'বর্ণনা: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() ব্যর্থ হয়েছে৷';
$PHPMAILER_LANG['smtp_error'] = 'SMTP সার্ভার ত্রুটি: ';
$PHPMAILER_LANG['variable_set'] = 'পরিবর্তনশীল সেট করা যায়নি: ';
$PHPMAILER_LANG['extension_missing'] = 'অনুপস্থিত এক্সটেনশন: ';

View File

@@ -9,6 +9,7 @@
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.';
$PHPMAILER_LANG['buggy_php'] = 'Din version af PHP er berørt af en fejl, som gør at dine beskeder muligvis vises forkert. For at rette dette kan du skifte til SMTP, slå mail.add_x_header headeren i din php.ini fil fra, skifte til MacOS eller Linux eller opgradere din version af PHP til 7.0.17+ eller 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.';
$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold';

View File

@@ -6,21 +6,28 @@
*/
$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.';
$PHPMAILER_LANG['buggy_php'] = 'Twoja wersja PHP zawiera błąd, który może powodować uszkodzenie wiadomości. Aby go naprawić, przełącz się na wysyłanie za pomocą SMTP, wyłącz opcję mail.add_x_header w php.ini, przełącz się na MacOS lub Linux lub zaktualizuj PHP do wersji 7.0.17+ lub 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';
$PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.';
$PHPMAILER_LANG['encoding'] = 'Błędny sposób kodowania znaków: ';
$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: ';
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';
$PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';
$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';
$PHPMAILER_LANG['from_failed'] = 'Następujący adres nadawcy jest nieprawidłowy lub nie istnieje: ';
$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, ' . 'następujący adres odbiorcy jest nieprawidłowy lub nie istnieje: ';
$PHPMAILER_LANG['invalid_header'] = 'Nieprawidłowa nazwa lub wartość nagłówka';
$PHPMAILER_LANG['invalid_hostentry'] = 'Nieprawidłowy wpis hosta: ';
$PHPMAILER_LANG['invalid_host'] = 'Nieprawidłowy host: ';
$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email odbiorcy.';
$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi lub nie istnieją: ';
$PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: ';
$PHPMAILER_LANG['smtp_code'] = 'Kod SMTP: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatkowe informacje SMTP: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Wywołanie funkcji SMTP Connect() zostało zakończone niepowodzeniem.';
$PHPMAILER_LANG['smtp_detail'] = 'Szczegóły: ';
$PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';

View File

@@ -357,6 +357,13 @@ class PHPMailer
*/
public $AuthType = '';
/**
* SMTP SMTPXClient command attibutes
*
* @var array
*/
protected $SMTPXClient = [];
/**
* An implementation of the PHPMailer OAuthTokenProvider interface.
*
@@ -750,7 +757,7 @@ class PHPMailer
*
* @var string
*/
const VERSION = '6.8.1';
const VERSION = '6.9.1';
/**
* Error severity: message only, continue processing.
@@ -1571,6 +1578,10 @@ class PHPMailer
//Validate From, Sender, and ConfirmReadingTo addresses
foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) {
if ($this->{$address_kind} === null) {
$this->{$address_kind} = '';
continue;
}
$this->{$address_kind} = trim($this->{$address_kind});
if (empty($this->{$address_kind})) {
continue;
@@ -1997,6 +2008,38 @@ class PHPMailer
return $this->smtp;
}
/**
* Provide SMTP XCLIENT attributes
*
* @param string $name Attribute name
* @param ?string $value Attribute value
*
* @return bool
*/
public function setSMTPXclientAttribute($name, $value)
{
if (!in_array($name, SMTP::$xclient_allowed_attributes)) {
return false;
}
if (isset($this->SMTPXClient[$name]) && $value === null) {
unset($this->SMTPXClient[$name]);
} elseif ($value !== null) {
$this->SMTPXClient[$name] = $value;
}
return true;
}
/**
* Get SMTP XCLIENT attributes
*
* @return array
*/
public function getSMTPXclientAttributes()
{
return $this->SMTPXClient;
}
/**
* Send mail via SMTP.
* Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
@@ -2025,6 +2068,9 @@ class PHPMailer
} else {
$smtp_from = $this->Sender;
}
if (count($this->SMTPXClient)) {
$this->smtp->xclient($this->SMTPXClient);
}
if (!$this->smtp->mail($smtp_from)) {
$this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
throw new Exception($this->ErrorInfo, self::STOP_CRITICAL);
@@ -2187,10 +2233,17 @@ class PHPMailer
$this->smtp->hello($hello);
//Automatically enable TLS encryption if:
//* it's not disabled
//* we are not connecting to localhost
//* we have openssl extension
//* we are not already using SSL
//* the server offers STARTTLS
if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) {
if (
$this->SMTPAutoTLS &&
$this->Host !== 'localhost' &&
$sslext &&
$secure !== 'ssl' &&
$this->smtp->getServerExt('STARTTLS')
) {
$tls = true;
}
if ($tls) {
@@ -4047,6 +4100,79 @@ class PHPMailer
$this->CustomHeader = [];
}
/**
* Clear a specific custom header by name or name and value.
* $name value can be overloaded to contain
* both header name and value (name:value).
*
* @param string $name Custom header name
* @param string|null $value Header value
*
* @return bool True if a header was replaced successfully
*/
public function clearCustomHeader($name, $value = null)
{
if (null === $value && strpos($name, ':') !== false) {
//Value passed in as name:value
list($name, $value) = explode(':', $name, 2);
}
$name = trim($name);
$value = (null === $value) ? null : trim($value);
foreach ($this->CustomHeader as $k => $pair) {
if ($pair[0] == $name) {
// We remove the header if the value is not provided or it matches.
if (null === $value || $pair[1] == $value) {
unset($this->CustomHeader[$k]);
}
}
}
return true;
}
/**
* Replace a custom header.
* $name value can be overloaded to contain
* both header name and value (name:value).
*
* @param string $name Custom header name
* @param string|null $value Header value
*
* @return bool True if a header was replaced successfully
* @throws Exception
*/
public function replaceCustomHeader($name, $value = null)
{
if (null === $value && strpos($name, ':') !== false) {
//Value passed in as name:value
list($name, $value) = explode(':', $name, 2);
}
$name = trim($name);
$value = (null === $value) ? '' : trim($value);
$replaced = false;
foreach ($this->CustomHeader as $k => $pair) {
if ($pair[0] == $name) {
if ($replaced) {
unset($this->CustomHeader[$k]);
continue;
}
if (strpbrk($name . $value, "\r\n") !== false) {
if ($this->exceptions) {
throw new Exception($this->lang('invalid_header'));
}
return false;
}
$this->CustomHeader[$k] = [$name, $value];
$replaced = true;
}
}
return true;
}
/**
* Add an error message to the error container.
*

View File

@@ -46,7 +46,7 @@ class POP3
*
* @var string
*/
const VERSION = '6.8.1';
const VERSION = '6.9.1';
/**
* Default POP3 port number.

View File

@@ -35,7 +35,7 @@ class SMTP
*
* @var string
*/
const VERSION = '6.8.1';
const VERSION = '6.9.1';
/**
* SMTP line break constant.
@@ -198,6 +198,18 @@ class SMTP
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
];
/**
* Allowed SMTP XCLIENT attributes.
* Must be allowed by the SMTP server. EHLO response is not checked.
*
* @see https://www.postfix.org/XCLIENT_README.html
*
* @var array
*/
public static $xclient_allowed_attributes = [
'NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN', 'DESTADDR', 'DESTPORT'
];
/**
* The last transaction ID issued in response to a DATA command,
* if one was detected.
@@ -971,6 +983,25 @@ class SMTP
);
}
/**
* Send SMTP XCLIENT command to server and check its return code.
*
* @return bool True on success
*/
public function xclient(array $vars)
{
$xclient_options = "";
foreach ($vars as $key => $value) {
if (in_array($key, SMTP::$xclient_allowed_attributes)) {
$xclient_options .= " {$key}={$value}";
}
}
if (!$xclient_options) {
return true;
}
return $this->sendCommand('XCLIENT', 'XCLIENT' . $xclient_options, 250);
}
/**
* Send an SMTP RSET command.
* Abort any transaction that is currently in progress.

View File

@@ -1,4 +1,4 @@
Copyright (c) 2020-2022 Fabien Potencier
Copyright (c) 2020-present Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -15,7 +15,7 @@
}
],
"require": {
"php": ">=7.1"
"php": ">=8.1"
},
"autoload": {
"files": [
@@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "2.5-dev"
"dev-main": "3.4-dev"
},
"thanks": {
"name": "symfony/contracts",

View File

@@ -20,7 +20,7 @@ if (!function_exists('trigger_deprecation')) {
*
* @author Nicolas Grekas <p@tchwork.com>
*/
function trigger_deprecation(string $package, string $version, string $message, ...$args): void
function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void
{
@trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
}

View File

@@ -11,6 +11,7 @@
namespace Symfony\Component\Yaml\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\CI\GithubActionReporter;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Completion\CompletionInput;
@@ -32,34 +33,31 @@ use Symfony\Component\Yaml\Yaml;
* @author Grégoire Pineau <lyrixx@lyrixx.info>
* @author Robin Chalas <robin.chalas@gmail.com>
*/
#[AsCommand(name: 'lint:yaml', description: 'Lint a YAML file and outputs encountered errors')]
class LintCommand extends Command
{
protected static $defaultName = 'lint:yaml';
protected static $defaultDescription = 'Lint a YAML file and outputs encountered errors';
private $parser;
private $format;
private $displayCorrectFiles;
private $directoryIteratorProvider;
private $isReadableProvider;
private Parser $parser;
private ?string $format = null;
private bool $displayCorrectFiles;
private ?\Closure $directoryIteratorProvider;
private ?\Closure $isReadableProvider;
public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null)
{
parent::__construct($name);
$this->directoryIteratorProvider = $directoryIteratorProvider;
$this->isReadableProvider = $isReadableProvider;
$this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...);
$this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...);
}
/**
* {@inheritdoc}
* @return void
*/
protected function configure()
{
$this
->setDescription(self::$defaultDescription)
->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format')
->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
@@ -88,7 +86,7 @@ EOF
;
}
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$filenames = (array) $input->getArgument('filename');
@@ -96,10 +94,6 @@ EOF
$this->format = $input->getOption('format');
$flags = $input->getOption('parse-tags');
if ('github' === $this->format && !class_exists(GithubActionReporter::class)) {
throw new \InvalidArgumentException('The "github" format is only available since "symfony/console" >= 5.3.');
}
if (null === $this->format) {
// Autodetect format according to CI environment
$this->format = class_exists(GithubActionReporter::class) && GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt';
@@ -133,7 +127,7 @@ EOF
return $this->display($io, $filesInfo);
}
private function validate(string $content, int $flags, string $file = null)
private function validate(string $content, int $flags, string $file = null): array
{
$prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) {
if (\E_USER_DEPRECATED === $level) {
@@ -156,16 +150,12 @@ EOF
private function display(SymfonyStyle $io, array $files): int
{
switch ($this->format) {
case 'txt':
return $this->displayTxt($io, $files);
case 'json':
return $this->displayJson($io, $files);
case 'github':
return $this->displayTxt($io, $files, true);
default:
throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format));
}
return match ($this->format) {
'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()))),
};
}
private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int
@@ -186,7 +176,7 @@ EOF
$io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
$io->text(sprintf('<error> >> %s</error>', $info['message']));
if (false !== strpos($info['message'], 'PARSE_CUSTOM_TAGS')) {
if (str_contains($info['message'], 'PARSE_CUSTOM_TAGS')) {
$suggestTagOption = true;
}
@@ -215,7 +205,7 @@ EOF
++$errors;
}
if (isset($v['message']) && false !== strpos($v['message'], 'PARSE_CUSTOM_TAGS')) {
if (isset($v['message']) && str_contains($v['message'], 'PARSE_CUSTOM_TAGS')) {
$v['message'] .= ' Use the --parse-tags option if you want parse custom tags.';
}
});
@@ -244,21 +234,15 @@ EOF
private function getParser(): Parser
{
if (!$this->parser) {
$this->parser = new Parser();
}
return $this->parser;
return $this->parser ??= new Parser();
}
private function getDirectoryIterator(string $directory): iterable
{
$default = function ($directory) {
return new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS),
\RecursiveIteratorIterator::LEAVES_ONLY
);
};
$default = fn ($directory) => new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS),
\RecursiveIteratorIterator::LEAVES_ONLY
);
if (null !== $this->directoryIteratorProvider) {
return ($this->directoryIteratorProvider)($directory, $default);
@@ -269,9 +253,7 @@ EOF
private function isReadable(string $fileOrDirectory): bool
{
$default = function ($fileOrDirectory) {
return is_readable($fileOrDirectory);
};
$default = is_readable(...);
if (null !== $this->isReadableProvider) {
return ($this->isReadableProvider)($fileOrDirectory, $default);
@@ -283,7 +265,12 @@ EOF
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
{
if ($input->mustSuggestOptionValuesFor('format')) {
$suggestions->suggestValues(['txt', 'json', 'github']);
$suggestions->suggestValues($this->getAvailableFormatOptions());
}
}
private function getAvailableFormatOptions(): array
{
return ['txt', 'json', 'github'];
}
}

View File

@@ -24,10 +24,8 @@ class Dumper
{
/**
* The amount of spaces to use for indentation of nested nodes.
*
* @var int
*/
protected $indentation;
private int $indentation;
public function __construct(int $indentation = 4)
{
@@ -46,7 +44,7 @@ class Dumper
* @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
*/
public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): string
public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string
{
$output = '';
$prefix = $indent ? str_repeat(' ', $indent) : '';
@@ -68,7 +66,11 @@ class Dumper
$output .= "\n";
}
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && false !== strpos($value, "\n") && false === strpos($value, "\r")) {
if (\is_int($key) && Yaml::DUMP_NUMERIC_KEY_AS_STRING & $flags) {
$key = (string) $key;
}
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && str_contains($value, "\n") && !str_contains($value, "\r")) {
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value);
if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) {
@@ -95,7 +97,7 @@ class Dumper
if ($value instanceof TaggedValue) {
$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()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) {
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);
@@ -140,7 +142,7 @@ class Dumper
{
$output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag());
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) {
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);

View File

@@ -18,10 +18,10 @@ namespace Symfony\Component\Yaml\Exception;
*/
class ParseException extends RuntimeException
{
private $parsedFile;
private $parsedLine;
private $snippet;
private $rawMessage;
private ?string $parsedFile;
private int $parsedLine;
private ?string $snippet;
private string $rawMessage;
/**
* @param string $message The error message
@@ -43,16 +43,16 @@ class ParseException extends RuntimeException
/**
* Gets the snippet of code near the error.
*
* @return string
*/
public function getSnippet()
public function getSnippet(): string
{
return $this->snippet;
}
/**
* Sets the snippet of code near the error.
*
* @return void
*/
public function setSnippet(string $snippet)
{
@@ -65,16 +65,16 @@ class ParseException extends RuntimeException
* Gets the filename where the error occurred.
*
* This method returns null if a string is parsed.
*
* @return string
*/
public function getParsedFile()
public function getParsedFile(): string
{
return $this->parsedFile;
}
/**
* Sets the filename where the error occurred.
*
* @return void
*/
public function setParsedFile(string $parsedFile)
{
@@ -85,16 +85,16 @@ class ParseException extends RuntimeException
/**
* Gets the line where the error occurred.
*
* @return int
*/
public function getParsedLine()
public function getParsedLine(): int
{
return $this->parsedLine;
}
/**
* Sets the line where the error occurred.
*
* @return void
*/
public function setParsedLine(int $parsedLine)
{
@@ -103,12 +103,12 @@ class ParseException extends RuntimeException
$this->updateRepr();
}
private function updateRepr()
private function updateRepr(): void
{
$this->message = $this->rawMessage;
$dot = false;
if ('.' === substr($this->message, -1)) {
if (str_ends_with($this->message, '.')) {
$this->message = substr($this->message, 0, -1);
$dot = true;
}

View File

@@ -26,15 +26,15 @@ class Inline
{
public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')';
public static $parsedLineNumber = -1;
public static $parsedFilename;
public static int $parsedLineNumber = -1;
public static ?string $parsedFilename = null;
private static $exceptionOnInvalidType = false;
private static $objectSupport = false;
private static $objectForMap = false;
private static $constantSupport = false;
private static bool $exceptionOnInvalidType = false;
private static bool $objectSupport = false;
private static bool $objectForMap = false;
private static bool $constantSupport = false;
public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null)
public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null): void
{
self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags);
self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags);
@@ -50,15 +50,12 @@ class Inline
/**
* Converts a YAML string to a PHP value.
*
* @param string|null $value A YAML string
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
* @param array $references Mapping of variable names to values
*
* @return mixed
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
* @param array $references Mapping of variable names to values
*
* @throws ParseException
*/
public static function parse(string $value = null, int $flags = 0, array &$references = [])
public static function parse(string $value = null, int $flags = 0, array &$references = []): mixed
{
if (null === $value) {
return '';
@@ -72,42 +69,31 @@ class Inline
return '';
}
if (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) {
$mbEncoding = mb_internal_encoding();
mb_internal_encoding('ASCII');
$i = 0;
$tag = self::parseTag($value, $i, $flags);
switch ($value[$i]) {
case '[':
$result = self::parseSequence($value, $flags, $i, $references);
++$i;
break;
case '{':
$result = self::parseMapping($value, $flags, $i, $references);
++$i;
break;
default:
$result = self::parseScalar($value, $flags, null, $i, true, $references);
}
try {
$i = 0;
$tag = self::parseTag($value, $i, $flags);
switch ($value[$i]) {
case '[':
$result = self::parseSequence($value, $flags, $i, $references);
++$i;
break;
case '{':
$result = self::parseMapping($value, $flags, $i, $references);
++$i;
break;
default:
$result = self::parseScalar($value, $flags, null, $i, true, $references);
}
// 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);
}
if (null !== $tag && '' !== $tag) {
return new TaggedValue($tag, $result);
}
return $result;
} finally {
if (isset($mbEncoding)) {
mb_internal_encoding($mbEncoding);
}
// 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);
}
if (null !== $tag && '' !== $tag) {
return new TaggedValue($tag, $result);
}
return $result;
}
/**
@@ -118,7 +104,7 @@ class Inline
*
* @throws DumpException When trying to dump PHP resource
*/
public static function dump($value, int $flags = 0): string
public static function dump(mixed $value, int $flags = 0): string
{
switch (true) {
case \is_resource($value):
@@ -128,9 +114,13 @@ class Inline
return self::dumpNull($flags);
case $value instanceof \DateTimeInterface:
return $value->format('c');
return $value->format(match (true) {
!$length = \strlen(rtrim($value->format('u'), '0')) => 'c',
$length < 4 => 'Y-m-d\TH:i:s.vP',
default => 'Y-m-d\TH:i:s.uP',
});
case $value instanceof \UnitEnum:
return sprintf('!php/const %s::%s', \get_class($value), $value->name);
return sprintf('!php/const %s::%s', $value::class, $value->name);
case \is_object($value):
if ($value instanceof TaggedValue) {
return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags);
@@ -141,13 +131,7 @@ class Inline
}
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) {
$output = [];
foreach ($value as $key => $val) {
$output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags));
}
return sprintf('{ %s }', implode(', ', $output));
return self::dumpHashArray($value, $flags);
}
if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
@@ -176,7 +160,7 @@ class Inline
$repr = str_ireplace('INF', '.Inf', $repr);
} elseif (floor($value) == $value && $repr == $value) {
// Preserve float data type since storing a whole number will result in integer value.
if (false === strpos($repr, 'E')) {
if (!str_contains($repr, 'E')) {
$repr = $repr.'.0';
}
}
@@ -195,6 +179,14 @@ class Inline
case Escaper::requiresDoubleQuoting($value):
return Escaper::escapeWithDoubleQuotes($value);
case Escaper::requiresSingleQuoting($value):
$singleQuoted = Escaper::escapeWithSingleQuotes($value);
if (!str_contains($value, "'")) {
return $singleQuoted;
}
// Attempt double-quoting the string instead to see if it's more efficient.
$doubleQuoted = Escaper::escapeWithDoubleQuotes($value);
return \strlen($doubleQuoted) < \strlen($singleQuoted) ? $doubleQuoted : $singleQuoted;
case Parser::preg_match('{^[0-9]+[_0-9]*$}', $value):
case Parser::preg_match(self::getHexRegex(), $value):
case Parser::preg_match(self::getTimestampRegex(), $value):
@@ -206,10 +198,8 @@ class Inline
/**
* Check if given array is hash or just normal indexed array.
*
* @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check
*/
public static function isHash($value): bool
public static function isHash(array|\ArrayObject|\stdClass $value): bool
{
if ($value instanceof \stdClass || $value instanceof \ArrayObject) {
return true;
@@ -244,9 +234,23 @@ class Inline
return sprintf('[%s]', implode(', ', $output));
}
// hash
return self::dumpHashArray($value, $flags);
}
/**
* Dumps hash array to a YAML string.
*
* @param array|\ArrayObject|\stdClass $value The hash array to dump
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
*/
private static function dumpHashArray(array|\ArrayObject|\stdClass $value, int $flags): string
{
$output = [];
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));
}
@@ -265,11 +269,9 @@ class Inline
/**
* Parses a YAML scalar.
*
* @return mixed
*
* @throws ParseException When malformed inline YAML string is parsed
*/
public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null)
public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null): mixed
{
if (\in_array($scalar[$i], ['"', "'"], true)) {
// quoted scalar
@@ -379,12 +381,12 @@ class Inline
$value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references, $isQuoted);
// the value can be an array if a reference has been resolved to an array var
if (\is_string($value) && !$isQuoted && false !== strpos($value, ': ')) {
if (\is_string($value) && !$isQuoted && str_contains($value, ': ')) {
// embedded mapping?
try {
$pos = 0;
$value = self::parseMapping('{'.$value.'}', $flags, $pos, $references);
} catch (\InvalidArgumentException $e) {
} catch (\InvalidArgumentException) {
// no, it's not
}
}
@@ -412,11 +414,9 @@ class Inline
/**
* Parses a YAML mapping.
*
* @return array|\stdClass
*
* @throws ParseException When malformed inline YAML string is parsed
*/
private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = [])
private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = []): array|\stdClass
{
$output = [];
$len = \strlen($mapping);
@@ -448,7 +448,7 @@ class Inline
throw new ParseException('Missing mapping key.', self::$parsedLineNumber + 1, $mapping);
}
if ('!php/const' === $key) {
if ('!php/const' === $key || '!php/enum' === $key) {
$key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false);
$key = self::evaluateScalar($key, $flags);
}
@@ -531,7 +531,7 @@ class Inline
if ('<<' === $key) {
$output += $value;
} elseif ($allowOverwrite || !isset($output[$key])) {
if (!$isValueQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) {
if (!$isValueQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && !self::isBinaryString($value) && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) {
$references[$matches['ref']] = $matches['value'];
$value = $matches['value'];
}
@@ -558,16 +558,14 @@ class Inline
/**
* Evaluates scalars and replaces magic values.
*
* @return mixed
*
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved
*/
private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null)
private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null): mixed
{
$isQuotedString = false;
$scalar = trim($scalar);
if (0 === strpos($scalar, '*')) {
if (str_starts_with($scalar, '*')) {
if (false !== $pos = strpos($scalar, '#')) {
$value = substr($scalar, 1, $pos - 2);
} else {
@@ -599,7 +597,7 @@ class Inline
return false;
case '!' === $scalar[0]:
switch (true) {
case 0 === strpos($scalar, '!!str '):
case str_starts_with($scalar, '!!str '):
$s = (string) substr($scalar, 6);
if (\in_array($s[0] ?? '', ['"', "'"], true)) {
@@ -608,14 +606,12 @@ class Inline
}
return $s;
case 0 === strpos($scalar, '! '):
case str_starts_with($scalar, '! '):
return substr($scalar, 2);
case 0 === strpos($scalar, '!php/object'):
case str_starts_with($scalar, '!php/object'):
if (self::$objectSupport) {
if (!isset($scalar[12])) {
trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/object tag without a value is deprecated.');
return false;
throw new ParseException('Missing value for tag "!php/object".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
return unserialize(self::parseScalar(substr($scalar, 12)));
@@ -626,12 +622,10 @@ class Inline
}
return null;
case 0 === strpos($scalar, '!php/const'):
case str_starts_with($scalar, '!php/const'):
if (self::$constantSupport) {
if (!isset($scalar[11])) {
trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/const tag without a value is deprecated.');
return '';
throw new ParseException('Missing value for tag "!php/const".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
$i = 0;
@@ -646,9 +640,43 @@ class Inline
}
return null;
case 0 === strpos($scalar, '!!float '):
case str_starts_with($scalar, '!php/enum'):
if (self::$constantSupport) {
if (!isset($scalar[11])) {
throw new ParseException('Missing value for tag "!php/enum".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
$i = 0;
$enum = self::parseScalar(substr($scalar, 10), 0, null, $i, false);
if ($useValue = str_ends_with($enum, '->value')) {
$enum = substr($enum, 0, -7);
}
if (!\defined($enum)) {
throw new ParseException(sprintf('The enum "%s" is not defined.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
$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 (!$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);
}
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);
}
return null;
case str_starts_with($scalar, '!!float '):
return (float) substr($scalar, 8);
case 0 === strpos($scalar, '!!binary '):
case str_starts_with($scalar, '!!binary '):
return self::evaluateBinaryScalar(substr($scalar, 9));
}
@@ -668,22 +696,7 @@ class Inline
switch (true) {
case ctype_digit($scalar):
if (preg_match('/^0[0-7]+$/', $scalar)) {
trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '0o'.substr($scalar, 1));
return octdec($scalar);
}
$cast = (int) $scalar;
return ($scalar === (string) $cast) ? $cast : $scalar;
case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)):
if (preg_match('/^-0[0-7]+$/', $scalar)) {
trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '-0o'.substr($scalar, 2));
return -octdec(substr($scalar, 1));
}
$cast = (int) $scalar;
return ($scalar === (string) $cast) ? $cast : $scalar;
@@ -701,17 +714,21 @@ class Inline
return (float) str_replace('_', '', $scalar);
case Parser::preg_match(self::getTimestampRegex(), $scalar):
// When no timezone is provided in the parsed date, YAML spec says we must assume UTC.
$time = new \DateTime($scalar, new \DateTimeZone('UTC'));
$time = new \DateTimeImmutable($scalar, new \DateTimeZone('UTC'));
if (Yaml::PARSE_DATETIME & $flags) {
return $time;
}
if ('' !== rtrim($time->format('u'), '0')) {
return (float) $time->format('U.u');
}
try {
if (false !== $scalar = $time->getTimestamp()) {
return $scalar;
}
} catch (\ValueError $e) {
} catch (\ValueError) {
// no-op
}
@@ -739,7 +756,7 @@ class Inline
}
// Is followed by a scalar and is a built-in tag
if ('' !== $tag && (!isset($value[$nextOffset]) || !\in_array($value[$nextOffset], ['[', '{'], true)) && ('!' === $tag[0] || 'str' === $tag || 'php/const' === $tag || 'php/object' === $tag)) {
if ('' !== $tag && (!isset($value[$nextOffset]) || !\in_array($value[$nextOffset], ['[', '{'], true)) && ('!' === $tag[0] || \in_array($tag, ['str', 'php/const', 'php/enum', 'php/object'], true))) {
// Manage in {@link self::evaluateScalar()}
return null;
}

View File

@@ -27,17 +27,17 @@ class Parser
public const BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?';
public const REFERENCE_PATTERN = '#^&(?P<ref>[^ ]++) *+(?P<value>.*)#u';
private $filename;
private $offset = 0;
private $numberOfParsedLines = 0;
private $totalNumberOfLines;
private $lines = [];
private $currentLineNb = -1;
private $currentLine = '';
private $refs = [];
private $skippedLineNumbers = [];
private $locallySkippedLineNumbers = [];
private $refsBeingParsed = [];
private ?string $filename = null;
private int $offset = 0;
private int $numberOfParsedLines = 0;
private ?int $totalNumberOfLines = null;
private array $lines = [];
private int $currentLineNb = -1;
private string $currentLine = '';
private array $refs = [];
private array $skippedLineNumbers = [];
private array $locallySkippedLineNumbers = [];
private array $refsBeingParsed = [];
/**
* Parses a YAML file into a PHP value.
@@ -45,11 +45,9 @@ class Parser
* @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
*
* @return mixed
*
* @throws ParseException If the file could not be read or the YAML is not valid
*/
public function parseFile(string $filename, int $flags = 0)
public function parseFile(string $filename, int $flags = 0): mixed
{
if (!is_file($filename)) {
throw new ParseException(sprintf('File "%s" does not exist.', $filename));
@@ -74,11 +72,9 @@ class Parser
* @param string $value A YAML string
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
*
* @return mixed
*
* @throws ParseException If the YAML is not valid
*/
public function parse(string $value, int $flags = 0)
public function parse(string $value, int $flags = 0): mixed
{
if (false === preg_match('//u', $value)) {
throw new ParseException('The YAML value does not appear to be valid UTF-8.', -1, null, $this->filename);
@@ -86,19 +82,9 @@ class Parser
$this->refs = [];
$mbEncoding = null;
if (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) {
$mbEncoding = mb_internal_encoding();
mb_internal_encoding('UTF-8');
}
try {
$data = $this->doParse($value, $flags);
} finally {
if (null !== $mbEncoding) {
mb_internal_encoding($mbEncoding);
}
$this->refsBeingParsed = [];
$this->offset = 0;
$this->lines = [];
@@ -113,7 +99,7 @@ class Parser
return $data;
}
private function doParse(string $value, int $flags)
private function doParse(string $value, int $flags): mixed
{
$this->currentLineNb = -1;
$this->currentLine = '';
@@ -121,10 +107,7 @@ class Parser
$this->lines = explode("\n", $value);
$this->numberOfParsedLines = \count($this->lines);
$this->locallySkippedLineNumbers = [];
if (null === $this->totalNumberOfLines) {
$this->totalNumberOfLines = $this->numberOfParsedLines;
}
$this->totalNumberOfLines ??= $this->numberOfParsedLines;
if (!$this->moveToNextLine()) {
return null;
@@ -175,7 +158,7 @@ class Parser
}
// array
if (isset($values['value']) && 0 === strpos(ltrim($values['value'], ' '), '-')) {
if (isset($values['value']) && str_starts_with(ltrim($values['value'], ' '), '-')) {
// Inline first child
$currentLineNumber = $this->getRealCurrentLineNb();
@@ -184,7 +167,7 @@ class Parser
$sequenceYaml .= "\n".$this->getNextEmbedBlock($sequenceIndentation, true);
$data[] = $this->parseBlock($currentLineNumber, rtrim($sequenceYaml), $flags);
} elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) {
} elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || str_starts_with(ltrim($values['value'], ' '), '#')) {
$data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true) ?? '', $flags);
} elseif (null !== $subTag = $this->getLineTag(ltrim($values['value'], ' '), $flags)) {
$data[] = new TaggedValue(
@@ -199,9 +182,8 @@ class Parser
|| self::preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->trimTag($values['value']), $matches)
)
) {
// this is a compact notation element, add to next block and parse
$block = $values['value'];
if ($this->isNextLineIndented()) {
if ($this->isNextLineIndented() || isset($matches['value']) && '>-' === $matches['value']) {
$block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1);
}
@@ -215,9 +197,14 @@ 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)
&& (false === strpos($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"]))
&& (!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);
}
@@ -311,7 +298,7 @@ class Parser
$subTag = null;
if ($mergeNode) {
// Merge keys
} elseif (!isset($values['value']) || '' === $values['value'] || 0 === strpos($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) {
} elseif (!isset($values['value']) || '' === $values['value'] || str_starts_with($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) {
// hash
// if next line is less indented or equal, then it means that the current value is null
if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) {
@@ -459,7 +446,7 @@ class Parser
throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
}
if (false !== strpos($line, ': ')) {
if (str_contains($line, ': ')) {
throw new ParseException('Mapping values are not allowed in multi-line blocks.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
}
@@ -469,7 +456,7 @@ class Parser
$value .= ' ';
}
if ('' !== $trimmedLine && '\\' === substr($line, -1)) {
if ('' !== $trimmedLine && str_ends_with($line, '\\')) {
$value .= ltrim(substr($line, 0, -1));
} elseif ('' !== $trimmedLine) {
$value .= $trimmedLine;
@@ -478,7 +465,7 @@ class Parser
if ('' === $trimmedLine) {
$previousLineWasNewline = true;
$previousLineWasTerminatedWithBackslash = false;
} elseif ('\\' === substr($line, -1)) {
} elseif (str_ends_with($line, '\\')) {
$previousLineWasNewline = false;
$previousLineWasTerminatedWithBackslash = true;
} else {
@@ -489,7 +476,7 @@ class Parser
try {
return Inline::parse(trim($value));
} catch (ParseException $e) {
} catch (ParseException) {
// fall-through to the ParseException thrown below
}
}
@@ -515,7 +502,7 @@ class Parser
return empty($data) ? null : $data;
}
private function parseBlock(int $offset, string $yaml, int $flags)
private function parseBlock(int $offset, string $yaml, int $flags): mixed
{
$skippedLineNumbers = $this->skippedLineNumbers;
@@ -557,9 +544,6 @@ class Parser
return $realCurrentLineNumber;
}
/**
* Returns the current line indentation.
*/
private function getCurrentLineIndentation(): int
{
if (' ' !== ($this->currentLine[0] ?? '')) {
@@ -714,13 +698,11 @@ class Parser
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
* @param string $context The parser context (either sequence or mapping)
*
* @return mixed
*
* @throws ParseException When reference does not exist
*/
private function parseValue(string $value, int $flags, string $context)
private function parseValue(string $value, int $flags, string $context): mixed
{
if (0 === strpos($value, '*')) {
if (str_starts_with($value, '*')) {
if (false !== $pos = strpos($value, '#')) {
$value = substr($value, 1, $pos - 2);
} else {
@@ -807,7 +789,7 @@ class Parser
$parsedValue = Inline::parse($value, $flags, $this->refs);
if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && false !== strpos($parsedValue, ': ')) {
if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && str_contains($parsedValue, ': ')) {
throw new ParseException('A colon cannot be used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename);
}
@@ -861,8 +843,8 @@ class Parser
while (
$notEOF && (
$isCurrentLineBlank ||
self::preg_match($pattern, $this->currentLine, $matches)
$isCurrentLineBlank
|| self::preg_match($pattern, $this->currentLine, $matches)
)
) {
if ($isCurrentLineBlank && \strlen($this->currentLine) > $indentation) {
@@ -949,6 +931,10 @@ class Parser
} while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()));
if ($EOF) {
for ($i = 0; $i < $movements; ++$i) {
$this->moveToPreviousLine();
}
return false;
}
@@ -961,25 +947,16 @@ class Parser
return $ret;
}
/**
* Returns true if the current line is blank or if it is a comment line.
*/
private function isCurrentLineEmpty(): bool
{
return $this->isCurrentLineBlank() || $this->isCurrentLineComment();
}
/**
* Returns true if the current line is blank.
*/
private function isCurrentLineBlank(): bool
{
return '' === $this->currentLine || '' === trim($this->currentLine, ' ');
}
/**
* Returns true if the current line is a comment line.
*/
private function isCurrentLineComment(): bool
{
// checking explicitly the first char of the trim is faster than loops or strpos
@@ -993,11 +970,6 @@ class Parser
return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1);
}
/**
* Cleanups a YAML string to be parsed.
*
* @param string $value The input YAML string
*/
private function cleanup(string $value): string
{
$value = str_replace(["\r\n", "\r"], "\n", $value);
@@ -1029,9 +1001,6 @@ class Parser
return $value;
}
/**
* Returns true if the next line starts unindented collection.
*/
private function isNextLineUnIndentedCollection(): bool
{
$currentIndentation = $this->getCurrentLineIndentation();
@@ -1058,12 +1027,9 @@ class Parser
return $ret;
}
/**
* Returns true if the string is un-indented collection item.
*/
private function isStringUnIndentedCollectionItem(): bool
{
return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- ');
return '-' === rtrim($this->currentLine) || str_starts_with($this->currentLine, '- ');
}
/**
@@ -1075,34 +1041,12 @@ class Parser
*
* @throws ParseException on a PCRE internal error
*
* @see preg_last_error()
*
* @internal
*/
public static function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int
{
if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) {
switch (preg_last_error()) {
case \PREG_INTERNAL_ERROR:
$error = 'Internal PCRE error.';
break;
case \PREG_BACKTRACK_LIMIT_ERROR:
$error = 'pcre.backtrack_limit reached.';
break;
case \PREG_RECURSION_LIMIT_ERROR:
$error = 'pcre.recursion_limit reached.';
break;
case \PREG_BAD_UTF8_ERROR:
$error = 'Malformed UTF-8 data.';
break;
case \PREG_BAD_UTF8_OFFSET_ERROR:
$error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.';
break;
default:
$error = 'Error.';
}
throw new ParseException($error);
throw new ParseException(preg_last_error_msg());
}
return $ret;

View File

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

View File

@@ -45,9 +45,7 @@ class Unescaper
*/
public function unescapeDoubleQuotedString(string $value): string
{
$callback = function ($match) {
return $this->unescapeCharacter($match[0]);
};
$callback = fn ($match) => $this->unescapeCharacter($match[0]);
// evaluate the string
return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value);
@@ -60,56 +58,34 @@ class Unescaper
*/
private function unescapeCharacter(string $value): string
{
switch ($value[1]) {
case '0':
return "\x0";
case 'a':
return "\x7";
case 'b':
return "\x8";
case 't':
return "\t";
case "\t":
return "\t";
case 'n':
return "\n";
case 'v':
return "\xB";
case 'f':
return "\xC";
case 'r':
return "\r";
case 'e':
return "\x1B";
case ' ':
return ' ';
case '"':
return '"';
case '/':
return '/';
case '\\':
return '\\';
case 'N':
// U+0085 NEXT LINE
return "\xC2\x85";
case '_':
// U+00A0 NO-BREAK SPACE
return "\xC2\xA0";
case 'L':
// U+2028 LINE SEPARATOR
return "\xE2\x80\xA8";
case 'P':
// U+2029 PARAGRAPH SEPARATOR
return "\xE2\x80\xA9";
case 'x':
return self::utf8chr(hexdec(substr($value, 2, 2)));
case 'u':
return self::utf8chr(hexdec(substr($value, 2, 4)));
case 'U':
return self::utf8chr(hexdec(substr($value, 2, 8)));
default:
throw new ParseException(sprintf('Found unknown escape character "%s".', $value));
}
return match ($value[1]) {
'0' => "\x0",
'a' => "\x7",
'b' => "\x8",
't' => "\t",
"\t" => "\t",
'n' => "\n",
'v' => "\xB",
'f' => "\xC",
'r' => "\r",
'e' => "\x1B",
' ' => ' ',
'"' => '"',
'/' => '/',
'\\' => '\\',
// U+0085 NEXT LINE
'N' => "\xC2\x85",
// U+00A0 NO-BREAK SPACE
'_' => "\xC2\xA0",
// U+2028 LINE SEPARATOR
'L' => "\xE2\x80\xA8",
// U+2029 PARAGRAPH SEPARATOR
'P' => "\xE2\x80\xA9",
'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)),
};
}
/**

View File

@@ -34,6 +34,7 @@ class Yaml
public const PARSE_CUSTOM_TAGS = 512;
public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024;
public const DUMP_NULL_AS_TILDE = 2048;
public const DUMP_NUMERIC_KEY_AS_STRING = 4096;
/**
* Parses a YAML file into a PHP value.
@@ -46,11 +47,9 @@ class Yaml
* @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
*
* @return mixed
*
* @throws ParseException If the file could not be read or the YAML is not valid
*/
public static function parseFile(string $filename, int $flags = 0)
public static function parseFile(string $filename, int $flags = 0): mixed
{
$yaml = new Parser();
@@ -69,11 +68,9 @@ class Yaml
* @param string $input A string containing YAML
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
*
* @return mixed
*
* @throws ParseException If the YAML is not valid
*/
public static function parse(string $input, int $flags = 0)
public static function parse(string $input, int $flags = 0): mixed
{
$yaml = new Parser();
@@ -91,7 +88,7 @@ class 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
*/
public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string
public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
{
$yaml = new Dumper($indent);

View File

@@ -16,18 +16,15 @@
}
],
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1|^3",
"php": ">=8.1",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"symfony/console": "^5.3|^6.0"
"symfony/console": "^5.4|^6.0"
},
"conflict": {
"symfony/console": "<5.3"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
"symfony/console": "<5.4"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Yaml\\": "" },