Initial Drupal 11 with DDEV setup
This commit is contained in:
19
vendor/symfony/polyfill-php84/LICENSE
vendored
Normal file
19
vendor/symfony/polyfill-php84/LICENSE
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2024-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
|
||||
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.
|
||||
177
vendor/symfony/polyfill-php84/Php84.php
vendored
Normal file
177
vendor/symfony/polyfill-php84/Php84.php
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Polyfill\Php84;
|
||||
|
||||
/**
|
||||
* @author Ayesh Karunaratne <ayesh@aye.sh>
|
||||
* @author Pierre Ambroise <pierre27.ambroise@gmail.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class Php84
|
||||
{
|
||||
public static function mb_ucfirst(string $string, ?string $encoding = null): string
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = mb_internal_encoding();
|
||||
}
|
||||
|
||||
try {
|
||||
$validEncoding = @mb_check_encoding('', $encoding);
|
||||
} catch (\ValueError $e) {
|
||||
throw new \ValueError(sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
// BC for PHP 7.3 and lower
|
||||
if (!$validEncoding) {
|
||||
throw new \ValueError(sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
$firstChar = mb_substr($string, 0, 1, $encoding);
|
||||
$firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding);
|
||||
|
||||
return $firstChar.mb_substr($string, 1, null, $encoding);
|
||||
}
|
||||
|
||||
public static function mb_lcfirst(string $string, ?string $encoding = null): string
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = mb_internal_encoding();
|
||||
}
|
||||
|
||||
try {
|
||||
$validEncoding = @mb_check_encoding('', $encoding);
|
||||
} catch (\ValueError $e) {
|
||||
throw new \ValueError(sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
// BC for PHP 7.3 and lower
|
||||
if (!$validEncoding) {
|
||||
throw new \ValueError(sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
$firstChar = mb_substr($string, 0, 1, $encoding);
|
||||
$firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding);
|
||||
|
||||
return $firstChar.mb_substr($string, 1, null, $encoding);
|
||||
}
|
||||
|
||||
public static function array_find(array $array, callable $callback)
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
if ($callback($value, $key)) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function array_find_key(array $array, callable $callback)
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
if ($callback($value, $key)) {
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function array_any(array $array, callable $callback): bool
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
if ($callback($value, $key)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function array_all(array $array, callable $callback): bool
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
if (!$callback($value, $key)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function fpow(float $num, float $exponent): float
|
||||
{
|
||||
return $num ** $exponent;
|
||||
}
|
||||
|
||||
public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
{
|
||||
return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
{
|
||||
return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
{
|
||||
return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = mb_internal_encoding();
|
||||
}
|
||||
|
||||
try {
|
||||
$validEncoding = @mb_check_encoding('', $encoding);
|
||||
} catch (\ValueError $e) {
|
||||
throw new \ValueError(sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding));
|
||||
}
|
||||
|
||||
// BC for PHP 7.3 and lower
|
||||
if (!$validEncoding) {
|
||||
throw new \ValueError(sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding));
|
||||
}
|
||||
|
||||
if ('' === $characters) {
|
||||
return null === $encoding ? $string : mb_convert_encoding($string, $encoding);
|
||||
}
|
||||
|
||||
if ('UTF-8' === $encoding || \in_array(strtolower($encoding), ['utf-8', 'utf8'], true)) {
|
||||
$encoding = 'UTF-8';
|
||||
}
|
||||
|
||||
$string = mb_convert_encoding($string, 'UTF-8', $encoding);
|
||||
|
||||
if (null !== $characters) {
|
||||
$characters = mb_convert_encoding($characters, 'UTF-8', $encoding);
|
||||
}
|
||||
|
||||
if (null === $characters) {
|
||||
$characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}";
|
||||
} else {
|
||||
$characters = preg_quote($characters);
|
||||
}
|
||||
|
||||
$string = preg_replace(sprintf($regex, $characters), '', $string);
|
||||
|
||||
if ('UTF-8' === $encoding) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
return mb_convert_encoding($string, $encoding, 'UTF-8');
|
||||
}
|
||||
}
|
||||
19
vendor/symfony/polyfill-php84/README.md
vendored
Normal file
19
vendor/symfony/polyfill-php84/README.md
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Symfony Polyfill / Php84
|
||||
========================
|
||||
|
||||
This component provides features added to PHP 8.4 core:
|
||||
|
||||
- [`mb_ucfirst` and `mb_lcfirst`](https://wiki.php.net/rfc/mb_ucfirst)
|
||||
- [`array_find`, `array_find_key`, `array_any` and `array_all`](https://wiki.php.net/rfc/array_find)
|
||||
- [`Deprecated`](https://wiki.php.net/rfc/deprecated_attribute)
|
||||
- `CURL_HTTP_VERSION_3` and `CURL_HTTP_VERSION_3ONLY` constants
|
||||
- [`fpow`](https://wiki.php.net/rfc/raising_zero_to_power_of_negative_number)
|
||||
- [`mb_trim`, `mb_ltrim` and `mb_rtrim`](https://wiki.php.net/rfc/mb_trim)
|
||||
|
||||
More information can be found in the
|
||||
[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
This library is released under the [MIT license](LICENSE).
|
||||
25
vendor/symfony/polyfill-php84/Resources/stubs/Deprecated.php
vendored
Normal file
25
vendor/symfony/polyfill-php84/Resources/stubs/Deprecated.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80400) {
|
||||
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::TARGET_CLASS_CONSTANT)]
|
||||
final class Deprecated
|
||||
{
|
||||
public readonly ?string $message;
|
||||
public readonly ?string $since;
|
||||
|
||||
public function __construct(?string $message = null, ?string $since = null)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->since = $since;
|
||||
}
|
||||
}
|
||||
}
|
||||
68
vendor/symfony/polyfill-php84/bootstrap.php
vendored
Normal file
68
vendor/symfony/polyfill-php84/bootstrap.php
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Polyfill\Php84 as p;
|
||||
|
||||
if (\PHP_VERSION_ID >= 80400) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (defined('CURL_VERSION_HTTP3') || PHP_VERSION_ID < 80200 && function_exists('curl_version') && curl_version()['version'] >= 0x074200) { // libcurl >= 7.66.0
|
||||
if (!defined('CURL_HTTP_VERSION_3')) {
|
||||
define('CURL_HTTP_VERSION_3', 30);
|
||||
}
|
||||
|
||||
if (!defined('CURL_HTTP_VERSION_3ONLY') && defined('CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256')) { // libcurl >= 7.80.0 (7.88 would be better but is slow to check)
|
||||
define('CURL_HTTP_VERSION_3ONLY', 31);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('array_find')) {
|
||||
function array_find(array $array, callable $callback) { return p\Php84::array_find($array, $callback); }
|
||||
}
|
||||
|
||||
if (!function_exists('array_find_key')) {
|
||||
function array_find_key(array $array, callable $callback) { return p\Php84::array_find_key($array, $callback); }
|
||||
}
|
||||
|
||||
if (!function_exists('array_any')) {
|
||||
function array_any(array $array, callable $callback): bool { return p\Php84::array_any($array, $callback); }
|
||||
}
|
||||
|
||||
if (!function_exists('array_all')) {
|
||||
function array_all(array $array, callable $callback): bool { return p\Php84::array_all($array, $callback); }
|
||||
}
|
||||
|
||||
if (!function_exists('fpow')) {
|
||||
function fpow(float $num, float $exponent): float { return p\Php84::fpow($num, $exponent); }
|
||||
}
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
if (!function_exists('mb_ucfirst')) {
|
||||
function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Php84::mb_ucfirst($string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_lcfirst')) {
|
||||
function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Php84::mb_lcfirst($string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_trim')) {
|
||||
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_trim($string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ltrim')) {
|
||||
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_ltrim($string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_rtrim')) {
|
||||
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_rtrim($string, $characters, $encoding); }
|
||||
}
|
||||
}
|
||||
33
vendor/symfony/polyfill-php84/composer.json
vendored
Normal file
33
vendor/symfony/polyfill-php84/composer.json
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "symfony/polyfill-php84",
|
||||
"type": "library",
|
||||
"description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions",
|
||||
"keywords": ["polyfill", "shim", "compatibility", "portable"],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Polyfill\\Php84\\": "" },
|
||||
"files": [ "bootstrap.php" ],
|
||||
"classmap": [ "Resources/stubs" ]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user