Skip to content

Commit

Permalink
update typerocket core and bump version 5.1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindees committed Sep 7, 2022
1 parent 5cf5784 commit e1870cd
Show file tree
Hide file tree
Showing 22 changed files with 1,229 additions and 951 deletions.
4 changes: 2 additions & 2 deletions typerocket-v5.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: TypeRocket - Andromeda
Plugin URI: https://typerocket.com/
Description: TypeRocket is a framework that joins refined UI elements and modern programming architecture together.
Version: 5.1.12
Version: 5.1.13
Requires at least: 6.0
Requires PHP: 7.4
Author: TypeRocket
Expand Down Expand Up @@ -34,7 +34,7 @@ public function __construct()
return;
}

define('TYPEROCKET_PLUGIN_VERSION', '5.1.12');
define('TYPEROCKET_PLUGIN_VERSION', '5.1.13');
define('TYPEROCKET_PLUGIN_INSTALL', __DIR__);

if(!defined('TYPEROCKET_ROOT_WP'))
Expand Down
24 changes: 12 additions & 12 deletions typerocket/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion typerocket/vendor/bin/php-parse
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ if (PHP_VERSION_ID < 80000) {
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;
Expand Down Expand Up @@ -98,7 +108,10 @@ if (PHP_VERSION_ID < 80000) {
}
}

if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
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__ . '/..'.'/nikic/php-parser/bin/php-parse');
exit(0);
}
Expand Down
28 changes: 14 additions & 14 deletions typerocket/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,17 @@
},
{
"name": "nikic/php-parser",
"version": "v4.14.0",
"version_normalized": "4.14.0.0",
"version": "v4.15.1",
"version_normalized": "4.15.1.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1"
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1",
"reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
"shasum": ""
},
"require": {
Expand All @@ -158,7 +158,7 @@
"ircmaxell/php-yacc": "^0.0.7",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
},
"time": "2022-05-31T20:59:12+00:00",
"time": "2022-09-04T07:30:47+00:00",
"bin": [
"bin/php-parse"
],
Expand Down Expand Up @@ -190,7 +190,7 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1"
},
"install-path": "../nikic/php-parser"
},
Expand Down Expand Up @@ -2720,17 +2720,17 @@
},
{
"name": "typerocket/core",
"version": "v5.1.36",
"version_normalized": "5.1.36.0",
"version": "v5.1.37",
"version_normalized": "5.1.37.0",
"source": {
"type": "git",
"url": "https://github.com/TypeRocket/core.git",
"reference": "c589a9710285ada75dabcd5f123ae45935583697"
"reference": "719408206172763b84dea589571b5150afa2f609"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TypeRocket/core/zipball/c589a9710285ada75dabcd5f123ae45935583697",
"reference": "c589a9710285ada75dabcd5f123ae45935583697",
"url": "https://api.github.com/repos/TypeRocket/core/zipball/719408206172763b84dea589571b5150afa2f609",
"reference": "719408206172763b84dea589571b5150afa2f609",
"shasum": ""
},
"require": {
Expand All @@ -2744,7 +2744,7 @@
"require-dev": {
"phpunit/phpunit": "^9.5"
},
"time": "2022-09-03T00:23:16+00:00",
"time": "2022-09-07T19:54:00+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down Expand Up @@ -2773,7 +2773,7 @@
"support": {
"docs": "https://typerocket.com/docs/v5/",
"issues": "https://github.com/TypeRocket/core/issues",
"source": "https://github.com/TypeRocket/core/tree/v5.1.36"
"source": "https://github.com/TypeRocket/core/tree/v5.1.37"
},
"install-path": "../typerocket/core"
},
Expand Down
16 changes: 8 additions & 8 deletions typerocket/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'typerocket/typerocket',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '8af26d78efedd20566140445c9d388c3834a0913',
'reference' => '5cf578426d2f799bc7448fd3cc035723ea45ea64',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -29,9 +29,9 @@
'dev_requirement' => true,
),
'nikic/php-parser' => array(
'pretty_version' => 'v4.14.0',
'version' => '4.14.0.0',
'reference' => '34bea19b6e03d8153165d8f30bba4c3be86184c1',
'pretty_version' => 'v4.15.1',
'version' => '4.15.1.0',
'reference' => '0ef6c55a3f47f89d7a374e6f835197a0b5fcf900',
'type' => 'library',
'install_path' => __DIR__ . '/../nikic/php-parser',
'aliases' => array(),
Expand Down Expand Up @@ -368,9 +368,9 @@
'dev_requirement' => true,
),
'typerocket/core' => array(
'pretty_version' => 'v5.1.36',
'version' => '5.1.36.0',
'reference' => 'c589a9710285ada75dabcd5f123ae45935583697',
'pretty_version' => 'v5.1.37',
'version' => '5.1.37.0',
'reference' => '719408206172763b84dea589571b5150afa2f609',
'type' => 'library',
'install_path' => __DIR__ . '/../typerocket/core',
'aliases' => array(),
Expand All @@ -379,7 +379,7 @@
'typerocket/typerocket' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '8af26d78efedd20566140445c9d388c3834a0913',
'reference' => '5cf578426d2f799bc7448fd3cc035723ea45ea64',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down
6 changes: 3 additions & 3 deletions typerocket/vendor/nikic/php-parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ PHP Parser

[![Coverage Status](https://coveralls.io/repos/github/nikic/PHP-Parser/badge.svg?branch=master)](https://coveralls.io/github/nikic/PHP-Parser?branch=master)

This is a PHP 5.2 to PHP 8.1 parser written in PHP. Its purpose is to simplify static code analysis and
This is a PHP 5.2 to PHP 8.2 parser written in PHP. Its purpose is to simplify static code analysis and
manipulation.

[**Documentation for version 4.x**][doc_master] (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.1).
[**Documentation for version 4.x**][doc_4_x] (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.2).

[Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2).

Expand Down Expand Up @@ -222,4 +222,4 @@ Component documentation:
* Parent and sibling references

[doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc
[doc_master]: https://github.com/nikic/PHP-Parser/tree/master/doc
[doc_4_x]: https://github.com/nikic/PHP-Parser/tree/4.x/doc
38 changes: 28 additions & 10 deletions typerocket/vendor/nikic/php-parser/grammar/php7.y
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ type_expr:
type { $$ = $1; }
| '?' type { $$ = Node\NullableType[$2]; }
| union_type { $$ = Node\UnionType[$1]; }
| intersection_type { $$ = Node\IntersectionType[$1]; }
| intersection_type { $$ = $1; }
;

type:
Expand All @@ -585,34 +585,52 @@ type_without_static:
| T_CALLABLE { $$ = Node\Identifier['callable']; }
;

union_type_element:
type { $$ = $1; }
| '(' intersection_type ')' { $$ = $2; }
;

union_type:
type '|' type { init($1, $3); }
| union_type '|' type { push($1, $3); }
union_type_element '|' union_type_element { init($1, $3); }
| union_type '|' union_type_element { push($1, $3); }
;

union_type_without_static_element:
type_without_static { $$ = $1; }
| '(' intersection_type_without_static ')' { $$ = $2; }
;

union_type_without_static:
type_without_static '|' type_without_static { init($1, $3); }
| union_type_without_static '|' type_without_static { push($1, $3); }
union_type_without_static_element '|' union_type_without_static_element { init($1, $3); }
| union_type_without_static '|' union_type_without_static_element { push($1, $3); }
;

intersection_type:
intersection_type_list:
type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type { init($1, $3); }
| intersection_type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type
| intersection_type_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type
{ push($1, $3); }
;

intersection_type_without_static:
intersection_type:
intersection_type_list { $$ = Node\IntersectionType[$1]; }
;

intersection_type_without_static_list:
type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static
{ init($1, $3); }
| intersection_type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static
| intersection_type_without_static_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static
{ push($1, $3); }
;

intersection_type_without_static:
intersection_type_without_static_list { $$ = Node\IntersectionType[$1]; }
;

type_expr_without_static:
type_without_static { $$ = $1; }
| '?' type_without_static { $$ = Node\NullableType[$2]; }
| union_type_without_static { $$ = Node\UnionType[$1]; }
| intersection_type_without_static { $$ = Node\IntersectionType[$1]; }
| intersection_type_without_static { $$ = $1; }
;

optional_type_without_static:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,20 @@ public static function normalizeType($type) {
}

$builtinTypes = [
'array', 'callable', 'string', 'int', 'float', 'bool', 'iterable', 'void', 'object', 'mixed', 'never',
'array',
'callable',
'bool',
'int',
'float',
'string',
'iterable',
'void',
'object',
'null',
'false',
'mixed',
'never',
'true',
];

$lowerType = strtolower($type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function emulate(string $code, array $tokens): array

/**
* @param mixed[] $tokens
* @return mixed[]|null
* @return array|string|null
*/
private function getPreviousNonSpaceToken(array $tokens, int $start)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,17 @@ public function getKeywordToken(): int
{
return \T_READONLY;
}
}

protected function isKeywordContext(array $tokens, int $pos): bool
{
if (!parent::isKeywordContext($tokens, $pos)) {
return false;
}
// Support "function readonly("
return !(isset($tokens[$pos + 1]) &&
($tokens[$pos + 1][0] === '(' ||
($tokens[$pos + 1][0] === \T_WHITESPACE &&
isset($tokens[$pos + 2]) &&
$tokens[$pos + 2][0] === '(')));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function slice(int $offset, int $length = null) {
$realLength = $numParts - $realOffset;
} else {
$realLength = $length < 0 ? $length + $numParts - $realOffset : $length;
if ($realLength < 0 || $realLength > $numParts) {
if ($realLength < 0 || $realLength > $numParts - $realOffset) {
throw new \OutOfBoundsException(sprintf('Length %d is out of bounds', $length));
}
}
Expand Down
Loading

0 comments on commit e1870cd

Please sign in to comment.