refactor: susun semula struktur folder — Laravel source ke src/
This commit is contained in:
19
vendor/symfony/polyfill-php85/LICENSE
vendored
Normal file
19
vendor/symfony/polyfill-php85/LICENSE
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2025-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.
|
||||
139
vendor/symfony/polyfill-php85/Php85.php
vendored
Normal file
139
vendor/symfony/polyfill-php85/Php85.php
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
<?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\Php85;
|
||||
|
||||
/**
|
||||
* @author Pierre Ambroise <pierre27.ambroise@gmail.com>
|
||||
* @author Alexander Schranz <alexander@sulu.io>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class Php85
|
||||
{
|
||||
public static function get_error_handler(): ?callable
|
||||
{
|
||||
$handler = set_error_handler(null);
|
||||
restore_error_handler();
|
||||
|
||||
return $handler;
|
||||
}
|
||||
|
||||
public static function get_exception_handler(): ?callable
|
||||
{
|
||||
$handler = set_exception_handler(null);
|
||||
restore_exception_handler();
|
||||
|
||||
return $handler;
|
||||
}
|
||||
|
||||
public static function array_first(array $array)
|
||||
{
|
||||
foreach ($array as $value) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function array_last(array $array)
|
||||
{
|
||||
return $array ? current(\array_slice($array, -1)) : null;
|
||||
}
|
||||
|
||||
private const RTL_SCRIPTS = [
|
||||
'Adlm' => true, 'Arab' => true, 'Armi' => true, 'Hebr' => true,
|
||||
'Mand' => true, 'Mani' => true, 'Mend' => true, 'Nkoo' => true,
|
||||
'Orkh' => true, 'Phnx' => true, 'Rohg' => true, 'Samr' => true,
|
||||
'Syrc' => true, 'Thaa' => true, 'Yezi' => true,
|
||||
];
|
||||
|
||||
private const LANG_TO_SCRIPT = [
|
||||
'ar' => 'Arab',
|
||||
'ckb' => 'Arab',
|
||||
'dv' => 'Thaa',
|
||||
'fa' => 'Arab',
|
||||
'he' => 'Hebr',
|
||||
'ku' => 'Arab',
|
||||
'nqo' => 'Nkoo',
|
||||
'ps' => 'Arab',
|
||||
'sd' => 'Arab',
|
||||
'ug' => 'Arab',
|
||||
'ur' => 'Arab',
|
||||
'yi' => 'Hebr',
|
||||
];
|
||||
|
||||
public static function locale_is_right_to_left(string $locale): bool
|
||||
{
|
||||
if ('' === $locale) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parts = preg_split('/[_-]/', $locale);
|
||||
$language = strtolower($parts[0]);
|
||||
|
||||
foreach ($parts as $part) {
|
||||
if (4 === \strlen($part) && ctype_alpha($part)) {
|
||||
return isset(self::RTL_SCRIPTS[ucfirst(strtolower($part))]);
|
||||
}
|
||||
}
|
||||
|
||||
return isset(self::LANG_TO_SCRIPT[$language]) && isset(self::RTL_SCRIPTS[self::LANG_TO_SCRIPT[$language]]);
|
||||
}
|
||||
|
||||
public static function grapheme_levenshtein(string $s1, string $s2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1)
|
||||
{
|
||||
if (!preg_match('//u', $s1) || !preg_match('//u', $s2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0 > $insertion_cost || 0 > $replacement_cost || 0 > $deletion_cost) {
|
||||
throw new \ValueError('grapheme_levenshtein(): Argument #3 ($insertion_cost), #4 ($replacement_cost), and #5 ($deletion_cost) must be greater than or equal to 0');
|
||||
}
|
||||
|
||||
$regex = ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39)
|
||||
? '\X'
|
||||
: '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])';
|
||||
|
||||
preg_match_all('/'.$regex.'/u', $s1, $s1);
|
||||
preg_match_all('/'.$regex.'/u', $s2, $s2);
|
||||
|
||||
$s1 = $s1[0];
|
||||
$s2 = $s2[0];
|
||||
$l1 = \count($s1);
|
||||
$l2 = \count($s2);
|
||||
|
||||
if (0 === $l1) {
|
||||
return $l2 * $insertion_cost;
|
||||
}
|
||||
if (0 === $l2) {
|
||||
return $l1 * $deletion_cost;
|
||||
}
|
||||
|
||||
$dp = array_fill(0, $l1 + 1, array_fill(0, $l2 + 1, 0));
|
||||
|
||||
for ($i = 1; $i <= $l1; ++$i) {
|
||||
$dp[$i][0] = $dp[$i - 1][0] + $deletion_cost;
|
||||
}
|
||||
for ($j = 1; $j <= $l2; ++$j) {
|
||||
$dp[0][$j] = $dp[0][$j - 1] + $insertion_cost;
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= $l1; ++$i) {
|
||||
for ($j = 1; $j <= $l2; ++$j) {
|
||||
$cost = ($s1[$i - 1] === $s2[$j - 1]) ? 0 : $replacement_cost;
|
||||
$dp[$i][$j] = min($dp[$i - 1][$j] + $deletion_cost, $dp[$i][$j - 1] + $insertion_cost, $dp[$i - 1][$j - 1] + $cost);
|
||||
}
|
||||
}
|
||||
|
||||
return $dp[$l1][$l2];
|
||||
}
|
||||
}
|
||||
20
vendor/symfony/polyfill-php85/README.md
vendored
Normal file
20
vendor/symfony/polyfill-php85/README.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Symfony Polyfill / Php85
|
||||
========================
|
||||
|
||||
This component provides features added to PHP 8.5 core:
|
||||
|
||||
- [`get_error_handler` and `get_exception_handler`](https://wiki.php.net/rfc/get-error-exception-handler)
|
||||
- [`NoDiscard`](https://wiki.php.net/rfc/marking_return_value_as_important)
|
||||
- [`array_first` and `array_last`](https://wiki.php.net/rfc/array_first_last)
|
||||
- [`DelayedTargetValidation`](https://wiki.php.net/rfc/delayedtargetvalidation_attribute)
|
||||
- [`Filter\FilterException class`](https://wiki.php.net/rfc/filter_throw_on_failure)
|
||||
- [`Filter\FilterFailedException class`](https://wiki.php.net/rfc/filter_throw_on_failure)
|
||||
- [`locale_is_right_to_left`](https://php.watch/versions/8.5/locale_is_right_to_left-Locale-isRightToleft)
|
||||
|
||||
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).
|
||||
18
vendor/symfony/polyfill-php85/Resources/stubs/DelayedTargetValidation.php
vendored
Normal file
18
vendor/symfony/polyfill-php85/Resources/stubs/DelayedTargetValidation.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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 < 80500) {
|
||||
// @author Daniel Scherzer <daniel.e.scherzer@gmail.com>
|
||||
#[Attribute(Attribute::TARGET_ALL)]
|
||||
final class DelayedTargetValidation
|
||||
{
|
||||
}
|
||||
}
|
||||
18
vendor/symfony/polyfill-php85/Resources/stubs/Filter/FilterException.php
vendored
Normal file
18
vendor/symfony/polyfill-php85/Resources/stubs/Filter/FilterException.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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 Filter;
|
||||
|
||||
if (\PHP_VERSION_ID < 80500) {
|
||||
class FilterException extends \Exception
|
||||
{
|
||||
}
|
||||
}
|
||||
18
vendor/symfony/polyfill-php85/Resources/stubs/Filter/FilterFailedException.php
vendored
Normal file
18
vendor/symfony/polyfill-php85/Resources/stubs/Filter/FilterFailedException.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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 Filter;
|
||||
|
||||
if (\PHP_VERSION_ID < 80500) {
|
||||
class FilterFailedException extends FilterException
|
||||
{
|
||||
}
|
||||
}
|
||||
23
vendor/symfony/polyfill-php85/Resources/stubs/NoDiscard.php
vendored
Normal file
23
vendor/symfony/polyfill-php85/Resources/stubs/NoDiscard.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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 < 80500) {
|
||||
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION)]
|
||||
final class NoDiscard
|
||||
{
|
||||
public ?string $message;
|
||||
|
||||
public function __construct(?string $message = null)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
}
|
||||
}
|
||||
46
vendor/symfony/polyfill-php85/bootstrap.php
vendored
Normal file
46
vendor/symfony/polyfill-php85/bootstrap.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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\Php85 as p;
|
||||
|
||||
if (\PHP_VERSION_ID >= 80500) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!function_exists('get_error_handler')) {
|
||||
function get_error_handler(): ?callable { return p\Php85::get_error_handler(); }
|
||||
}
|
||||
|
||||
if (!function_exists('get_exception_handler')) {
|
||||
function get_exception_handler(): ?callable { return p\Php85::get_exception_handler(); }
|
||||
}
|
||||
|
||||
if (!function_exists('array_first')) {
|
||||
function array_first(array $array) { return p\Php85::array_first($array); }
|
||||
}
|
||||
|
||||
if (!function_exists('array_last')) {
|
||||
function array_last(array $array) { return p\Php85::array_last($array); }
|
||||
}
|
||||
|
||||
if (extension_loaded('intl') && !function_exists('locale_is_right_to_left')) {
|
||||
function locale_is_right_to_left(string $locale): bool { return p\Php85::locale_is_right_to_left($locale); }
|
||||
}
|
||||
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
require __DIR__.'/bootstrap80.php';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (extension_loaded('intl') && !function_exists('grapheme_levenshtein')) {
|
||||
function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = '') { return p\Php85::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); }
|
||||
}
|
||||
20
vendor/symfony/polyfill-php85/bootstrap80.php
vendored
Normal file
20
vendor/symfony/polyfill-php85/bootstrap80.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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\Php85 as p;
|
||||
|
||||
if (\PHP_VERSION_ID >= 80500) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (extension_loaded('intl') && !function_exists('grapheme_levenshtein')) {
|
||||
function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = ''): int|false { return p\Php85::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); }
|
||||
}
|
||||
33
vendor/symfony/polyfill-php85/composer.json
vendored
Normal file
33
vendor/symfony/polyfill-php85/composer.json
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "symfony/polyfill-php85",
|
||||
"type": "library",
|
||||
"description": "Symfony polyfill backporting some PHP 8.5+ 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\\Php85\\": "" },
|
||||
"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