-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ added option for symfony yaml parser (default: spyc)
⬆️ upgraded dependencies Signed-off-by: bnomei <[email protected]>
- Loading branch information
Showing
18 changed files
with
3,665 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
/** | ||
* Proxy PHP file generated by Composer | ||
* | ||
* This file includes the referenced bin path (../symfony/yaml/Resources/bin/yaml-lint) | ||
* using a stream wrapper to prevent the shebang from being output on PHP<8 | ||
* | ||
* @generated | ||
*/ | ||
|
||
namespace Composer; | ||
|
||
$GLOBALS['_composer_bin_dir'] = __DIR__; | ||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; | ||
|
||
if (PHP_VERSION_ID < 80000) { | ||
if (!class_exists('Composer\BinProxyWrapper')) { | ||
/** | ||
* @internal | ||
*/ | ||
final class BinProxyWrapper | ||
{ | ||
private $handle; | ||
private $position; | ||
private $realpath; | ||
|
||
public function stream_open($path, $mode, $options, &$opened_path) | ||
{ | ||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution | ||
$opened_path = substr($path, 17); | ||
$this->realpath = realpath($opened_path) ?: $opened_path; | ||
$opened_path = $this->realpath; | ||
$this->handle = fopen($this->realpath, $mode); | ||
$this->position = 0; | ||
|
||
return (bool) $this->handle; | ||
} | ||
|
||
public function stream_read($count) | ||
{ | ||
$data = fread($this->handle, $count); | ||
|
||
if ($this->position === 0) { | ||
$data = preg_replace('{^#!.*\r?\n}', '', $data); | ||
} | ||
|
||
$this->position += strlen($data); | ||
|
||
return $data; | ||
} | ||
|
||
public function stream_cast($castAs) | ||
{ | ||
return $this->handle; | ||
} | ||
|
||
public function stream_close() | ||
{ | ||
fclose($this->handle); | ||
} | ||
|
||
public function stream_lock($operation) | ||
{ | ||
return $operation ? flock($this->handle, $operation) : true; | ||
} | ||
|
||
public function stream_seek($offset, $whence) | ||
{ | ||
if (0 === fseek($this->handle, $offset, $whence)) { | ||
$this->position = ftell($this->handle); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
public function stream_tell() | ||
{ | ||
return $this->position; | ||
} | ||
|
||
public function stream_eof() | ||
{ | ||
return feof($this->handle); | ||
} | ||
|
||
public function stream_stat() | ||
{ | ||
return array(); | ||
} | ||
|
||
public function stream_set_option($option, $arg1, $arg2) | ||
{ | ||
return true; | ||
} | ||
|
||
public function url_stat($path, $flags) | ||
{ | ||
$path = substr($path, 17); | ||
if (file_exists($path)) { | ||
return stat($path); | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} | ||
|
||
if ( | ||
(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); | ||
} | ||
} | ||
|
||
include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
if (!function_exists('trigger_deprecation')) { | ||
/** | ||
* Triggers a silenced deprecation notice. | ||
* | ||
* @param string $package The name of the Composer package that is triggering the deprecation | ||
* @param string $version The version of the package that introduced the deprecation | ||
* @param string $message The message of the deprecation | ||
* @param mixed ...$args Values to insert in the message using printf() formatting | ||
* | ||
* @author Nicolas Grekas <[email protected]> | ||
*/ | ||
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,232 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Polyfill\Ctype; | ||
|
||
/** | ||
* Ctype implementation through regex. | ||
* | ||
* @internal | ||
* | ||
* @author Gert de Pagter <[email protected]> | ||
*/ | ||
final class Ctype | ||
{ | ||
/** | ||
* Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. | ||
* | ||
* @see https://php.net/ctype-alnum | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_alnum($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text is a letter, FALSE otherwise. | ||
* | ||
* @see https://php.net/ctype-alpha | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_alpha($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. | ||
* | ||
* @see https://php.net/ctype-cntrl | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_cntrl($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. | ||
* | ||
* @see https://php.net/ctype-digit | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_digit($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. | ||
* | ||
* @see https://php.net/ctype-graph | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_graph($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text is a lowercase letter. | ||
* | ||
* @see https://php.net/ctype-lower | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_lower($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. | ||
* | ||
* @see https://php.net/ctype-print | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_print($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. | ||
* | ||
* @see https://php.net/ctype-punct | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_punct($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. | ||
* | ||
* @see https://php.net/ctype-space | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_space($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text is an uppercase letter. | ||
* | ||
* @see https://php.net/ctype-upper | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_upper($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); | ||
} | ||
|
||
/** | ||
* Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. | ||
* | ||
* @see https://php.net/ctype-xdigit | ||
* | ||
* @param mixed $text | ||
* | ||
* @return bool | ||
*/ | ||
public static function ctype_xdigit($text) | ||
{ | ||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); | ||
|
||
return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); | ||
} | ||
|
||
/** | ||
* Converts integers to their char versions according to normal ctype behaviour, if needed. | ||
* | ||
* If an integer between -128 and 255 inclusive is provided, | ||
* it is interpreted as the ASCII value of a single character | ||
* (negative values have 256 added in order to allow characters in the Extended ASCII range). | ||
* Any other integer is interpreted as a string containing the decimal digits of the integer. | ||
* | ||
* @param mixed $int | ||
* @param string $function | ||
* | ||
* @return mixed | ||
*/ | ||
private static function convert_int_to_char_for_ctype($int, $function) | ||
{ | ||
if (!\is_int($int)) { | ||
return $int; | ||
} | ||
|
||
if ($int < -128 || $int > 255) { | ||
return (string) $int; | ||
} | ||
|
||
if (\PHP_VERSION_ID >= 80100) { | ||
@trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); | ||
} | ||
|
||
if ($int < 0) { | ||
$int += 256; | ||
} | ||
|
||
return \chr($int); | ||
} | ||
} |
Oops, something went wrong.