Minor refactors, fix some typos

This commit is contained in:
Timothy Warren 2021-08-13 11:16:57 -04:00
parent 9c5493100f
commit 4d91919fb5
12 changed files with 198 additions and 180 deletions

View File

@ -2,6 +2,7 @@
"autoload": {
"files": [
"src/constants.php",
"src/config.php",
"src/functions.php"
],
"psr-4": {

292
composer.lock generated
View File

@ -136,16 +136,16 @@
},
{
"name": "nikic/php-parser",
"version": "v4.10.4",
"version": "v4.12.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e"
"reference": "6608f01670c3cc5079e18c1dab1104e002579143"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e",
"reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143",
"reference": "6608f01670c3cc5079e18c1dab1104e002579143",
"shasum": ""
},
"require": {
@ -186,22 +186,22 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0"
},
"time": "2020-12-20T10:01:03+00:00"
"time": "2021-07-21T10:44:31+00:00"
},
{
"name": "phar-io/manifest",
"version": "2.0.1",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/phar-io/manifest.git",
"reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133"
"reference": "97803eca37d319dfa7826cc2437fc020857acb53"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133",
"reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133",
"url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
"reference": "97803eca37d319dfa7826cc2437fc020857acb53",
"shasum": ""
},
"require": {
@ -246,9 +246,9 @@
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
"support": {
"issues": "https://github.com/phar-io/manifest/issues",
"source": "https://github.com/phar-io/manifest/tree/master"
"source": "https://github.com/phar-io/manifest/tree/2.0.3"
},
"time": "2020-06-27T14:33:11+00:00"
"time": "2021-07-20T11:28:43+00:00"
},
{
"name": "phar-io/version",
@ -461,16 +461,16 @@
},
{
"name": "phpspec/prophecy",
"version": "1.12.2",
"version": "1.13.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "245710e971a030f42e08f4912863805570f23d39"
"reference": "be1996ed8adc35c3fd795488a653f4b518be70ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39",
"reference": "245710e971a030f42e08f4912863805570f23d39",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea",
"reference": "be1996ed8adc35c3fd795488a653f4b518be70ea",
"shasum": ""
},
"require": {
@ -522,22 +522,22 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/1.12.2"
"source": "https://github.com/phpspec/prophecy/tree/1.13.0"
},
"time": "2020-12-19T10:15:11+00:00"
"time": "2021-03-17T13:42:18+00:00"
},
{
"name": "phpstan/phpstan",
"version": "0.12.81",
"version": "0.12.94",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "0dd5b0ebeff568f7000022ea5f04aa86ad3124b8"
"reference": "3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/0dd5b0ebeff568f7000022ea5f04aa86ad3124b8",
"reference": "0dd5b0ebeff568f7000022ea5f04aa86ad3124b8",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6",
"reference": "3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6",
"shasum": ""
},
"require": {
@ -568,13 +568,17 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/0.12.81"
"source": "https://github.com/phpstan/phpstan/tree/0.12.94"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://www.patreon.com/phpstan",
"type": "patreon"
@ -584,20 +588,20 @@
"type": "tidelift"
}
],
"time": "2021-03-08T22:03:02+00:00"
"time": "2021-07-30T09:05:27+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "9.2.5",
"version": "9.2.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1"
"reference": "f6293e1b30a2354e8428e004689671b83871edde"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1",
"reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde",
"reference": "f6293e1b30a2354e8428e004689671b83871edde",
"shasum": ""
},
"require": {
@ -653,7 +657,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6"
},
"funding": [
{
@ -661,7 +665,7 @@
"type": "github"
}
],
"time": "2020-11-28T06:44:49+00:00"
"time": "2021-03-28T07:26:59+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -906,16 +910,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.2",
"version": "9.5.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "f661659747f2f87f9e72095bb207bceb0f151cb4"
"reference": "191768ccd5c85513b4068bdbe99bb6390c7d54fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f661659747f2f87f9e72095bb207bceb0f151cb4",
"reference": "f661659747f2f87f9e72095bb207bceb0f151cb4",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/191768ccd5c85513b4068bdbe99bb6390c7d54fb",
"reference": "191768ccd5c85513b4068bdbe99bb6390c7d54fb",
"shasum": ""
},
"require": {
@ -927,7 +931,7 @@
"ext-xml": "*",
"ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.10.1",
"phar-io/manifest": "^2.0.1",
"phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
"php": ">=7.3",
"phpspec/prophecy": "^1.12.1",
@ -945,7 +949,7 @@
"sebastian/global-state": "^5.0.1",
"sebastian/object-enumerator": "^4.0.3",
"sebastian/resource-operations": "^3.0.3",
"sebastian/type": "^2.3",
"sebastian/type": "^2.3.4",
"sebastian/version": "^3.0.2"
},
"require-dev": {
@ -993,7 +997,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.2"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.8"
},
"funding": [
{
@ -1005,7 +1009,7 @@
"type": "github"
}
],
"time": "2021-02-02T14:45:58+00:00"
"time": "2021-07-31T15:17:34+00:00"
},
{
"name": "sebastian/cli-parser",
@ -1513,16 +1517,16 @@
},
{
"name": "sebastian/global-state",
"version": "5.0.2",
"version": "5.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "a90ccbddffa067b51f574dea6eb25d5680839455"
"reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455",
"reference": "a90ccbddffa067b51f574dea6eb25d5680839455",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49",
"reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49",
"shasum": ""
},
"require": {
@ -1565,7 +1569,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2"
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3"
},
"funding": [
{
@ -1573,7 +1577,7 @@
"type": "github"
}
],
"time": "2020-10-26T15:55:19+00:00"
"time": "2021-06-11T13:31:12+00:00"
},
{
"name": "sebastian/lines-of-code",
@ -1864,16 +1868,16 @@
},
{
"name": "sebastian/type",
"version": "2.3.1",
"version": "2.3.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
"reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2"
"reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2",
"reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914",
"reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914",
"shasum": ""
},
"require": {
@ -1908,7 +1912,7 @@
"homepage": "https://github.com/sebastianbergmann/type",
"support": {
"issues": "https://github.com/sebastianbergmann/type/issues",
"source": "https://github.com/sebastianbergmann/type/tree/2.3.1"
"source": "https://github.com/sebastianbergmann/type/tree/2.3.4"
},
"funding": [
{
@ -1916,7 +1920,7 @@
"type": "github"
}
],
"time": "2020-10-26T13:18:59+00:00"
"time": "2021-06-15T12:49:02+00:00"
},
{
"name": "sebastian/version",
@ -1973,16 +1977,16 @@
},
{
"name": "spatie/phpunit-snapshot-assertions",
"version": "4.2.5",
"version": "4.2.7",
"source": {
"type": "git",
"url": "https://github.com/spatie/phpunit-snapshot-assertions.git",
"reference": "b6c9aac4cee1e5176c2a90b23971c665e66a290f"
"reference": "981fa0e0a432315064db00b6b97a4f11f3b0c0fd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/phpunit-snapshot-assertions/zipball/b6c9aac4cee1e5176c2a90b23971c665e66a290f",
"reference": "b6c9aac4cee1e5176c2a90b23971c665e66a290f",
"url": "https://api.github.com/repos/spatie/phpunit-snapshot-assertions/zipball/981fa0e0a432315064db00b6b97a4f11f3b0c0fd",
"reference": "981fa0e0a432315064db00b6b97a4f11f3b0c0fd",
"shasum": ""
},
"require": {
@ -2027,7 +2031,7 @@
],
"support": {
"issues": "https://github.com/spatie/phpunit-snapshot-assertions/issues",
"source": "https://github.com/spatie/phpunit-snapshot-assertions/tree/4.2.5"
"source": "https://github.com/spatie/phpunit-snapshot-assertions/tree/4.2.7"
},
"funding": [
{
@ -2035,20 +2039,20 @@
"type": "custom"
}
],
"time": "2021-01-27T08:11:35+00:00"
"time": "2021-07-09T08:38:04+00:00"
},
{
"name": "symfony/deprecation-contracts",
"version": "v2.2.0",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665"
"reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665",
"reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627",
"reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627",
"shasum": ""
},
"require": {
@ -2057,7 +2061,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
"dev-main": "2.4-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -2086,7 +2090,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/master"
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0"
},
"funding": [
{
@ -2102,20 +2106,20 @@
"type": "tidelift"
}
],
"time": "2020-09-07T11:33:47+00:00"
"time": "2021-03-23T23:28:01+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.22.1",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"shasum": ""
},
"require": {
@ -2127,7 +2131,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -2165,7 +2169,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
},
"funding": [
{
@ -2181,20 +2185,20 @@
"type": "tidelift"
}
],
"time": "2021-01-07T16:49:33+00:00"
"time": "2021-02-19T12:13:01+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
"version": "v1.22.1",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
"reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170"
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170",
"reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535",
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535",
"shasum": ""
},
"require": {
@ -2206,7 +2210,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -2246,7 +2250,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1"
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1"
},
"funding": [
{
@ -2262,20 +2266,20 @@
"type": "tidelift"
}
],
"time": "2021-01-22T09:19:47+00:00"
"time": "2021-05-27T12:26:48+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
"version": "v1.22.1",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
"reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248"
"reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248",
"reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8",
"reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8",
"shasum": ""
},
"require": {
@ -2287,7 +2291,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -2330,7 +2334,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1"
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0"
},
"funding": [
{
@ -2346,20 +2350,20 @@
"type": "tidelift"
}
],
"time": "2021-01-22T09:19:47+00:00"
"time": "2021-02-19T12:13:01+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.22.1",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6",
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
"shasum": ""
},
"require": {
@ -2371,7 +2375,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -2410,7 +2414,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1"
},
"funding": [
{
@ -2426,20 +2430,20 @@
"type": "tidelift"
}
],
"time": "2021-01-22T09:19:47+00:00"
"time": "2021-05-27T12:26:48+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.22.1",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91"
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91",
"reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be",
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
"shasum": ""
},
"require": {
@ -2448,7 +2452,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -2493,7 +2497,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
},
"funding": [
{
@ -2509,26 +2513,26 @@
"type": "tidelift"
}
],
"time": "2021-01-07T16:49:33+00:00"
"time": "2021-07-28T13:41:28+00:00"
},
{
"name": "symfony/property-access",
"version": "v5.2.4",
"version": "v5.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/property-access.git",
"reference": "3af8ed262bd3217512a13b023981fe68f36ad5f3"
"reference": "098681253076af7070df7d9debe5f75733eea189"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/3af8ed262bd3217512a13b023981fe68f36ad5f3",
"reference": "3af8ed262bd3217512a13b023981fe68f36ad5f3",
"url": "https://api.github.com/repos/symfony/property-access/zipball/098681253076af7070df7d9debe5f75733eea189",
"reference": "098681253076af7070df7d9debe5f75733eea189",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/property-info": "^5.2"
},
"require-dev": {
@ -2574,7 +2578,7 @@
"reflection"
],
"support": {
"source": "https://github.com/symfony/property-access/tree/v5.2.4"
"source": "https://github.com/symfony/property-access/tree/v5.3.4"
},
"funding": [
{
@ -2590,26 +2594,26 @@
"type": "tidelift"
}
],
"time": "2021-01-27T10:15:41+00:00"
"time": "2021-07-21T12:40:44+00:00"
},
{
"name": "symfony/property-info",
"version": "v5.2.4",
"version": "v5.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/property-info.git",
"reference": "7185bbc74e6f49c3f1b5936b4d9e4ca133921189"
"reference": "0f42009150679a7a256eb6ee106401af5d974ed2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-info/zipball/7185bbc74e6f49c3f1b5936b4d9e4ca133921189",
"reference": "7185bbc74e6f49c3f1b5936b4d9e4ca133921189",
"url": "https://api.github.com/repos/symfony/property-info/zipball/0f42009150679a7a256eb6ee106401af5d974ed2",
"reference": "0f42009150679a7a256eb6ee106401af5d974ed2",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/string": "^5.1"
},
"conflict": {
@ -2664,7 +2668,7 @@
"validator"
],
"support": {
"source": "https://github.com/symfony/property-info/tree/v5.2.4"
"source": "https://github.com/symfony/property-info/tree/v5.3.4"
},
"funding": [
{
@ -2680,38 +2684,39 @@
"type": "tidelift"
}
],
"time": "2021-02-17T15:24:54+00:00"
"time": "2021-07-21T12:40:44+00:00"
},
{
"name": "symfony/serializer",
"version": "v5.2.4",
"version": "v5.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/serializer.git",
"reference": "a285f474a72397ccbd384900abc968ffcb511dda"
"reference": "f04e368e3cb35948550c7e95cc8918cb7e761c0c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/serializer/zipball/a285f474a72397ccbd384900abc968ffcb511dda",
"reference": "a285f474a72397ccbd384900abc968ffcb511dda",
"url": "https://api.github.com/repos/symfony/serializer/zipball/f04e368e3cb35948550c7e95cc8918cb7e761c0c",
"reference": "f04e368e3cb35948550c7e95cc8918cb7e761c0c",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-php80": "^1.15"
"symfony/polyfill-php80": "^1.16"
},
"conflict": {
"doctrine/annotations": "<1.12",
"phpdocumentor/reflection-docblock": "<3.2.2",
"phpdocumentor/type-resolver": "<1.4.0",
"symfony/dependency-injection": "<4.4",
"symfony/property-access": "<4.4",
"symfony/property-info": "<4.4",
"symfony/property-info": "<5.3",
"symfony/yaml": "<4.4"
},
"require-dev": {
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.0",
"doctrine/annotations": "^1.12",
"phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0",
"symfony/cache": "^4.4|^5.0",
"symfony/config": "^4.4|^5.0",
@ -2723,15 +2728,14 @@
"symfony/http-kernel": "^4.4|^5.0",
"symfony/mime": "^4.4|^5.0",
"symfony/property-access": "^4.4.9|^5.0.9",
"symfony/property-info": "^4.4|^5.0",
"symfony/property-info": "^5.3",
"symfony/uid": "^5.1",
"symfony/validator": "^4.4|^5.0",
"symfony/var-dumper": "^4.4|^5.0",
"symfony/var-exporter": "^4.4|^5.0",
"symfony/yaml": "^4.4|^5.0"
},
"suggest": {
"doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
"doctrine/cache": "For using the default cached annotation reader and metadata cache.",
"psr/cache-implementation": "For using the metadata cache.",
"symfony/config": "For using the XML mapping loader.",
"symfony/mime": "For using a MIME type guesser within the DataUriNormalizer.",
@ -2766,7 +2770,7 @@
"description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/serializer/tree/v5.2.4"
"source": "https://github.com/symfony/serializer/tree/v5.3.4"
},
"funding": [
{
@ -2782,20 +2786,20 @@
"type": "tidelift"
}
],
"time": "2021-03-02T12:14:02+00:00"
"time": "2021-07-21T13:18:10+00:00"
},
{
"name": "symfony/string",
"version": "v5.2.4",
"version": "v5.3.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "4e78d7d47061fa183639927ec40d607973699609"
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/4e78d7d47061fa183639927ec40d607973699609",
"reference": "4e78d7d47061fa183639927ec40d607973699609",
"url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
"shasum": ""
},
"require": {
@ -2849,7 +2853,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v5.2.4"
"source": "https://github.com/symfony/string/tree/v5.3.3"
},
"funding": [
{
@ -2865,20 +2869,20 @@
"type": "tidelift"
}
],
"time": "2021-02-16T10:20:28+00:00"
"time": "2021-06-27T11:44:38+00:00"
},
{
"name": "symfony/yaml",
"version": "v5.2.4",
"version": "v5.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "7d6ae0cce3c33965af681a4355f1c4de326ed277"
"reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/7d6ae0cce3c33965af681a4355f1c4de326ed277",
"reference": "7d6ae0cce3c33965af681a4355f1c4de326ed277",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7",
"reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7",
"shasum": ""
},
"require": {
@ -2924,7 +2928,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v5.2.4"
"source": "https://github.com/symfony/yaml/tree/v5.3.6"
},
"funding": [
{
@ -2940,20 +2944,20 @@
"type": "tidelift"
}
],
"time": "2021-02-22T15:48:39+00:00"
"time": "2021-07-29T06:20:01+00:00"
},
{
"name": "theseer/tokenizer",
"version": "1.2.0",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/theseer/tokenizer.git",
"reference": "75a63c33a8577608444246075ea0af0d052e452a"
"reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a",
"reference": "75a63c33a8577608444246075ea0af0d052e452a",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
"reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
"shasum": ""
},
"require": {
@ -2982,7 +2986,7 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": {
"issues": "https://github.com/theseer/tokenizer/issues",
"source": "https://github.com/theseer/tokenizer/tree/master"
"source": "https://github.com/theseer/tokenizer/tree/1.2.1"
},
"funding": [
{
@ -2990,7 +2994,7 @@
"type": "github"
}
],
"time": "2020-07-12T23:59:07+00:00"
"time": "2021-07-28T10:34:58+00:00"
},
{
"name": "webmozart/assert",
@ -3063,5 +3067,5 @@
"platform-dev": {
"ext-json": "*"
},
"plugin-api-version": "2.0.0"
"plugin-api-version": "2.1.0"
}

View File

@ -31,8 +31,18 @@ class ANSI {
public const BOLD_TEXT = "\e[1m";
public const DIM_TEXT = "\e[2m";
public const ITALIC_TEXT = "\d[3m";
public const UNDERLINE_TEXT = "\e[4m";
public const BLINKING_TEXT = "\e[5m";
public const INVERSE_TEXT = "\e[7m";
public const STRIKE_TEXT = "\e[9m";
/**
* Move the cursor to position 0,0 which is the top left
*/
@ -46,7 +56,7 @@ class ANSI {
public const SHOW_CURSOR = "\e[?25h";
/**
* Generate the ascii sequence for basic text color
* Generate the ascii sequence for basic foreground text color
*
* @param int $color
* @return string

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1);
namespace Aviat\Kilo\Enum;
namespace Aviat\Kilo;
use Aviat\Kilo\Traits;

View File

@ -444,7 +444,7 @@ class Editor {
}
else
{
$color = syntax_to_color($hl[$i]);
$color = get_syntax_color($hl[$i]);
if ($color !== $currentColor)
{
$currentColor = $color;

View File

@ -12,7 +12,7 @@ class Highlight {
public const NORMAL = 0;
public const COMMENT = 1;
public const ML_COMMENT = 2;
public const ML_COMMENT= 2;
public const KEYWORD1 = 3;
public const KEYWORD2 = 4;
public const STRING = 5;

View File

View File

@ -259,7 +259,7 @@ class Row {
|| $this->highlightSecondaryKeywords($i, $syntax)
|| $this->highlightString($i, $syntax)
|| $this->highlightOperators($i, $syntax)
|| $this->highlightCommonDelimeters($i)
|| $this->highlightCommonDelimiters($i)
|| $this->highlightCommonOperators($i, $syntax)
|| $this->highlightNumber($i, $syntax)
) {
@ -451,7 +451,7 @@ class Row {
* @param int $i
* @return bool
*/
protected function highlightCommonDelimeters(int &$i): bool
protected function highlightCommonDelimiters(int &$i): bool
{
return $this->highlightChar(
$i,

View File

@ -105,7 +105,7 @@ class Syntax {
{
return $this->highlightComments
&& strlen($this->multiLineCommentStart) !== 0
&& strlen($this->multiLineCommentStart) !== 0;
&& strlen($this->multiLineCommentEnd) !== 0;
}
public function comments(): bool

View File

@ -5,8 +5,6 @@ namespace Aviat\Kilo;
use FFI;
use FFI\CData;
use Aviat\Kilo\Enum\C;
/**
* An implicit singleton wrapper around terminal settings to simplify enabling/disabling raw mode
*/

32
src/config.php Normal file
View File

@ -0,0 +1,32 @@
<?php declare(strict_types=1);
namespace Aviat\Kilo;
use Aviat\Kilo\Enum\Color;
use Aviat\Kilo\Enum\Highlight;
/**
* Configure syntax highlighting colors
*
* @param int $hl
* @return int
*/
function get_syntax_color(int $hl): int {
return match ($hl)
{
Highlight::COMMENT => Color::FG_CYAN,
Highlight::ML_COMMENT => Color::FG_BRIGHT_BLACK,
Highlight::KEYWORD1 => Color::FG_YELLOW,
Highlight::KEYWORD2 => Color::FG_GREEN,
Highlight::STRING => Color::FG_MAGENTA,
Highlight::CHARACTER => Color::FG_BRIGHT_MAGENTA,
Highlight::NUMBER => Color::FG_BRIGHT_RED,
Highlight::OPERATOR => Color::FG_BRIGHT_GREEN,
Highlight::VARIABLE => Color::FG_BRIGHT_CYAN,
Highlight::DELIMITER => Color::FG_BLUE,
Highlight::INVALID => Color::BG_BRIGHT_RED,
Highlight::MATCH => Color::INVERT,
Highlight::IDENTIFIER => Color::FG_BRIGHT_WHITE,
default => Color::FG_WHITE,
};
}

View File

@ -150,33 +150,6 @@ function str_has(string $haystack, string $str, ?int $offset = NULL): bool
: \str_contains($haystack, $str);
}
/**
* Get the ASCII color escape number for the specified syntax type
*
* @param int $hl
* @return int
*/
function syntax_to_color(int $hl): int
{
return match ($hl)
{
Highlight::COMMENT => Color::FG_CYAN,
Highlight::ML_COMMENT => Color::FG_BRIGHT_BLACK,
Highlight::KEYWORD1 => Color::FG_YELLOW,
Highlight::KEYWORD2 => Color::FG_GREEN,
Highlight::STRING => Color::FG_MAGENTA,
Highlight::CHARACTER => Color::FG_BRIGHT_MAGENTA,
Highlight::NUMBER => Color::FG_BRIGHT_RED,
Highlight::OPERATOR => Color::FG_BRIGHT_GREEN,
Highlight::VARIABLE => Color::FG_BRIGHT_CYAN,
Highlight::DELIMITER => Color::FG_BLUE,
Highlight::INVALID => Color::BG_BRIGHT_RED,
Highlight::MATCH => Color::INVERT,
Highlight::IDENTIFIER => Color::FG_BRIGHT_WHITE,
default => Color::FG_WHITE,
};
}
/**
* Replace tabs with the specified number of spaces.
*