+1
.gitignore
+1
.gitignore
-2
composer.json
-2
composer.json
+48
-245
composer.lock
+48
-245
composer.lock
···-"url": "https://api.github.com/repos/adhocore/php-cli/zipball/474dc3d7ab139796be98b104d891476e3916b6f4",···-"url": "https://api.github.com/repos/flightphp/runway/zipball/b88c1901b77eda935ef475af772445c3108cf23f",···-"url": "https://api.github.com/repos/nette/php-generator/zipball/4707546a1f11badd72f5d82af4f8a6bc64bd56ac",-"description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.",···+"url": "https://api.github.com/repos/flightphp/tracy-extensions/zipball/4150ea7dc9bbb56fa089e7a4662f68011a771256",+"description": "A few Flight specific extensions for Tracy Debugger to help debug your code quickly.",···-"url": "https://api.github.com/repos/flightphp/tracy-extensions/zipball/4150ea7dc9bbb56fa089e7a4662f68011a771256",-"description": "A few Flight specific extensions for Tracy Debugger to help debug your code quickly.",
data/sbs.db.example
data/sbs.db.example
This is a binary file and will not be displayed.
+7
-6
index.php
+7
-6
index.php
···Flight::route('/f/@did:did:plc:[0-9a-z]+/@name:[a-z0-9\-\_]+', function (string $did, string $name): void {
+87
-80
lib/bskyToucher.php
+87
-80
lib/bskyToucher.php
······if ($resp && property_exists($resp, 'service') && is_array($resp->service) && count($resp->service) > 0 && property_exists($resp->service[0], 'serviceEndpoint')) {···+$avatar = property_exists($userInfo->value, 'avatar') ? $this->getMediaUrl($pds, $did, $userInfo->value->avatar->ref->{'$link'}) : null;+$banner = property_exists($userInfo->value, 'banner') ? $this->getMediaUrl($pds, $did, $userInfo->value->banner->ref->{'$link'}) : null;+$pinned = property_exists($userInfo->value, 'pinnedPost') ? $userInfo->value->pinnedPost->uri : null;+\updateUserCache($userData->handle, $did, $userInfo->value->displayName, $pds, $avatar, $banner, $userInfo->value->description, $pinned);-'avatar' => property_exists($userInfo->value, 'avatar') ? $this->getMediaUrl($pds, $did, $userInfo->value->avatar->ref->{'$link'}) : null,-'banner' => property_exists($userInfo->value, 'banner') ? $this->getMediaUrl($pds, $did, $userInfo->value->banner->ref->{'$link'}) : null,-'pinnedPost' => property_exists($userInfo->value, 'pinnedPost') ? $userInfo->value->pinnedPost->uri : null···+\updatePostCache($post->rkey, $post->did, $post->text, $post->embed_type, json_encode($post->embeds));···function getUserPosts(string $did, $auth = false, $cursor = null, $newer = false):array|bool {·········$feedData = $this->getSlingshotData($uriComponents->did, $uriComponents->collection, $uriComponents->rkey);+\updateFeedCache($atUri, $feedData->value->displayName, $feedData->value->description, $feedData->value->avatar->ref->{'$link'}, $uriComponents->did);-'avatar' => $this->getMediaUrl($plcInfo->pds, $uriComponents->did, $feedData->value->avatar->ref->{'$link'}),+'avatar' => $this->getMediaUrl($authorInfo->pds, $uriComponents->did, $feedData->value->avatar->ref->{'$link'}),···$facets = property_exists($post->value, 'facets') ? $this->sanitizeFacets($post->value->facets) : [];-'displayName' => property_exists($authorInfo->value, 'displayName') && $authorInfo->value->displayName !== "" ? $authorInfo->value->displayName : $authorInfo->handle,-'avatar' => property_exists($authorInfo->value, 'avatar') ? $this->getMediaUrl($authorData->pds, $did, $authorInfo->value->avatar->ref->{'$link'}) : null,···'embeds' => property_exists($post->value, 'embed') ? $this->sanitizeEmbeds($post->value->embed, $authorData) : [],preg_match('/at:\/\/(did:plc:[a-z0-9]+)\/[a-zA-Z\.]+\/([a-z0-9]+)/', $post->uri, $rkeyMatch);$facets = property_exists($post->record, 'facets') ? $this->sanitizeFacets($post->record->facets) : [];-'displayName' => property_exists($post->author, 'displayName') && $post->author->displayName !== "" ? $post->author->displayName : $post->author->handle,···'embedType' => property_exists($post->record, 'embed') ? $post->record->embed->{'$type'} : null,-'embeds' => property_exists($post->record, 'embed') ? $this->sanitizeEmbeds($post->record->embed, $authorData) : [],+'embeds' => property_exists($post->record, 'embed') ? $this->sanitizeEmbeds($post->record->embed, $authorData) : []···-'displayName' => $actorSlingshot->value->displayName !== "" ? htmlspecialchars($actorSlingshot->value->displayName) : $actorData->handle,-'avatar' => $this->getMediaUrl($actorData->pds, $rec->did, $actorSlingshot->value->avatar->ref->{'$link'})
+132
lib/db.php
+132
lib/db.php
···+function updateUserCache(string $handle, string $did, ?string $displayName, string $pds, ?string $avatar, ?string $banner, ?string $description, ?string $pinned): void {+$db->exec("update user_cache set handle='".$handle."', display_name='".SQLite3::escapeString($displayName)."', pds='".$pds."', avatar='".$avatar."', banner='".$banner."', description='".SQLite3::escapeString($description)."', pinned_post='".$pinned."', expires='".$newExpiration."' where did='".$did."';");+$db->exec("insert into user_cache (handle, did, display_name, pds, avatar, banner, description, pinned_post, expires) values ('".$handle."', '".$did."', '".SQLite3::escapeString($displayName)."', '".$pds."', '".$avatar."', '".$banner."', '".SQLite3::escapeString($description)."', '".$pinned."', '".$newExpiration."');");+$db->exec("update plc_cache set plcdoc='".$plcdoc."', expires='".$newExpiration."' where did='".$did."';");+$db->exec("insert into plc_cache (did, plcdoc, expires) values ('".$did."', '".$plcdoc."', '".$newExpiration."');");+function updateFeedCache(string $atUri, string $title, ?string $description, ?string $avatar, string $creator_did) {+$db->exec("update feed_cache set title='".SQLite3::escapeString($title)."', description='".SQLite3::escapeString($description)."', avatar='".$avatar."', creator_did='".$creator_did."', expires='".$newExpiration."' where at_uri='".$atUri."';");+$db->exec("insert into feed_cache (at_uri, title, description, avatar, creator_did, expires) values ('".$atUri."', '".SQLite3::escapeString($title)."', '".SQLite3::escapeString($description)."', '".$avatar."', '".$creator_did."', '".$newExpiration."');");+function updatePostCache(string $rkey, string $did, string $text, ?string $embedType, ?string $embedData): void {+$db->exec("update post_cache set text='".SQLite3::escapeString($text)."', embed_type='".$embedtype."' where embed_data='".SQLite3::escapeString($embedData)."', expires='".$newExpiration."' where rkey='".$rkey."';");+$db->exec("insert into post_cache (rkey, did, text, embed_type, embed_data, expires) values ('".$rkey."', '".$did."', '".SQLite3::escapeString($text)."', '".$embedType."', '".SQLite3::escapeString($embedData)."', '".$newExpiration."');");+$suspension = $db->query("select count(*) from client_suspensions where did='".$did."' and expires > ".strtotime('now').";");
+2
templates/feed.latte
+2
templates/feed.latte
···{include '_partials/feedHeader.latte', displayName: $feedName, description: $description, avatar: $avatar, creatorDisplay: $creatorDisplay, creatorHandle: $creatorHandle, creatorPds: $creatorPds, creatorDid: $creatorDid, feedAtUri: $feedAtUri}
-257
vendor/adhocore/cli/CHANGELOG.md
-257
vendor/adhocore/cli/CHANGELOG.md
···-- **App**: Set common group to commands set via callable (Jitendra Adhikari) [_6c6e53c_](https://github.com/adhocore/php-cli/commit/6c6e53c)-- **Helper**: Support grouped sorting for show help (Jitendra Adhikari) [_314a887_](https://github.com/adhocore/php-cli/commit/314a887)-- **Input**: Add Groupable interface, make Command groupable (Jitendra Adhikari) [_29b09ce_](https://github.com/adhocore/php-cli/commit/29b09ce)-- Adapt for strict type php8 (Jitendra Adhikari) [_8198969_](https://github.com/adhocore/php-cli/commit/8198969)-- *****: Use imports instead of FQN (Jitendra Adhikari) [_bd0a70c_](https://github.com/adhocore/php-cli/commit/bd0a70c)-- **Travis**: Retire it :( (Jitendra Adhikari) [_70e510b_](https://github.com/adhocore/php-cli/commit/70e510b)-- Add Grouping commands section (Jitendra Adhikari) [_3e05837_](https://github.com/adhocore/php-cli/commit/3e05837)-- **Workflow**: Add github action build (Jitendra Adhikari) [_9b4da7d_](https://github.com/adhocore/php-cli/commit/9b4da7d)-- Correct io() fallback mechanism (Daniel Jakob) [_4072eaf_](https://github.com/adhocore/php-cli/commit/4072eaf)-- **Travis**: Add php 7.3 and 7.4 (Jitendra Adhikari) [_a5c4a16_](https://github.com/adhocore/php-cli/commit/a5c4a16)-- **App**: Extract cmd not found to outputhelper (Jitendra Adhikari) [_c317634_](https://github.com/adhocore/php-cli/commit/c317634)-- **Normalizer**: Complex option containing value delimited by = (Jitendra Adhikari) [_5d5394a_](https://github.com/adhocore/php-cli/commit/5d5394a)-- **Cmd.action**: Can be array too (besides closure/null) (Jitendra Adhikari) [_238c8b1_](https://github.com/adhocore/php-cli/commit/238c8b1)-- **Cmd.action**: Bind to $this (Jitendra Adhikari) [_c479995_](https://github.com/adhocore/php-cli/commit/c479995)-- Add credits, update license year (Jitendra Adhikari) [_2bf08c5_](https://github.com/adhocore/php-cli/commit/2bf08c5)-- **App**: Add onExit prop, execute or action can return exit code (Jitendra Adhikari) [_1e754a8_](https://github.com/adhocore/php-cli/commit/1e754a8)-- About cmd exit code (Jitendra Adhikari) [_32d45c2_](https://github.com/adhocore/php-cli/commit/32d45c2)-- About cmd usage ($0 and ##) (Jitendra Adhikari) [_2319370_](https://github.com/adhocore/php-cli/commit/2319370)-- **Cmd.help**: Usage label was printed even if no text (Jitendra Adhikari) [_4639624_](https://github.com/adhocore/php-cli/commit/4639624)-- **Phpunit**: Rm xml.syntaxCheck (Jitendra Adhikari) [_6ae66b0_](https://github.com/adhocore/php-cli/commit/6ae66b0)-- **Interactor**: Reduce complexity in prompt (Jitendra Adhikari) [_dd008af_](https://github.com/adhocore/php-cli/commit/dd008af)-- **Composer**: Tweak script.test (Jitendra Adhikari) [_9b8ee5d_](https://github.com/adhocore/php-cli/commit/9b8ee5d)-- **Travis**: Script (Jitendra Adhikari) [_c41e256_](https://github.com/adhocore/php-cli/commit/c41e256)-- **Output.helper**: Pad ## (Jitendra Adhikari) [_73a4a4e_](https://github.com/adhocore/php-cli/commit/73a4a4e)-- **Normalizer**: Invert bool iff type is bool not value (Jitendra Adhikari) [_6ff4acd_](https://github.com/adhocore/php-cli/commit/6ff4acd)-- **Option**: Improve bool() check (Jitendra Adhikari) [_e7e95e3_](https://github.com/adhocore/php-cli/commit/e7e95e3)-- **Color**: Comment line shows white trailing bar (daemonu) [_b578d9a_](https://github.com/adhocore/php-cli/commit/b578d9a)-- Extend exception from throwable (Jitendra Adhikari) [_ab6b351_](https://github.com/adhocore/php-cli/commit/ab6b351)-- **Table**: Add table renderer class (Jitendra Adhikari) [_808e80e_](https://github.com/adhocore/php-cli/commit/808e80e)-- **Reader**: Add readAll() (Jitendra Adhikari) [_9264082_](https://github.com/adhocore/php-cli/commit/9264082)-- **Output**: Add show usage (Jitendra Adhikari) [_1356515_](https://github.com/adhocore/php-cli/commit/1356515)-- **Reader**: Add read piped (Jitendra Adhikari) [_790f2a1_](https://github.com/adhocore/php-cli/commit/790f2a1)-- **Reader**: Visibility (Jitendra Adhikari) [_bcea11b_](https://github.com/adhocore/php-cli/commit/bcea11b)-- **Writer**: Use Table::render instead (Jitendra Adhikari) [_f0f33ee_](https://github.com/adhocore/php-cli/commit/f0f33ee)-- **Command**: Use helper showUsage() instead (Jitendra Adhikari) [_ef5ea2b_](https://github.com/adhocore/php-cli/commit/ef5ea2b)-- **Composer**: Add test scripts (Jitendra Adhikari) [_4d292ca_](https://github.com/adhocore/php-cli/commit/4d292ca)-- **Color**: Add dark and light gray colors (Jitendra Adhikari) [_2d4051d_](https://github.com/adhocore/php-cli/commit/2d4051d)-- Add readAll() usage (Jitendra Adhikari) [_62cbfd0_](https://github.com/adhocore/php-cli/commit/62cbfd0)-- Update intro and credits (Jitendra Adhikari) [_7cbaae6_](https://github.com/adhocore/php-cli/commit/7cbaae6)-- Add readHidden, readPiped usage (Jitendra Adhikari) [_57dae5e_](https://github.com/adhocore/php-cli/commit/57dae5e)-- **Reader**: Add read hidden for win os (Jitendra Adhikari) [_742c622_](https://github.com/adhocore/php-cli/commit/742c622)-- **Interactor**: Prompt hidden now supported in win os (Jitendra Adhikari) [_491d162_](https://github.com/adhocore/php-cli/commit/491d162)-- Add a note about hidden prompt on win os (Jitendra Adhikari) [_43fe762_](https://github.com/adhocore/php-cli/commit/43fe762)-- **Interactor**: Add promptHidden (unix only) (Jitendra Adhikari) [_1eb06c6_](https://github.com/adhocore/php-cli/commit/1eb06c6)-- **Reader**: Add readHidden (Jitendra Adhikari) [_3628331_](https://github.com/adhocore/php-cli/commit/3628331)-- About hidden prompt (Jitendra Adhikari) [_af086f9_](https://github.com/adhocore/php-cli/commit/af086f9)-- [573d3c1](https://github.com/adhocore/php-cli/commit/573d3c1) refactor: remove sc folder and update readme with imgur link (Sushil Gupta)-- [121ab6c](https://github.com/adhocore/php-cli/commit/121ab6c) refactor(plugin): use gawk, cleanup (Jitendra Adhikari)-- [aeaf5f4](https://github.com/adhocore/php-cli/commit/aeaf5f4) refactor(plugin): phpcli => ahccli (Jitendra Adhikari)-- [e625fd0](https://github.com/adhocore/php-cli/commit/e625fd0) chore: phpcli => ahccli (Jitendra Adhikari)-- [9e31caf](https://github.com/adhocore/php-cli/commit/9e31caf) docs: improve auto completion docs, rename phpcli to ahccli (Jitendra Adhikari)-- [6e8755f](https://github.com/adhocore/php-cli/commit/6e8755f) docs: autocompletion (Jitendra Adhikari)-- [1152671](https://github.com/adhocore/php-cli/commit/1152671) chore(zsh.plugin): auto complete provider for zsh with oh-my-zsh (Jitendra Adhikari)-- [f390b6b](https://github.com/adhocore/php-cli/commit/f390b6b) refactor: remove redundant codeCoverageIgnore (Sushil Gupta)-- [cd8d109](https://github.com/adhocore/php-cli/commit/cd8d109) refactor: minor refactor on messages + add isWindows() method using DIRECTORY_SEPARATOR check to set pipes (Sushil Gupta)-- [a1c2c30](https://github.com/adhocore/php-cli/commit/a1c2c30) docs: add shell section and contributors (Jitendra Adhikari)-- [5146260](https://github.com/adhocore/php-cli/commit/5146260) test: shell tests (Jitendra Adhikari)-- [d1e8e73](https://github.com/adhocore/php-cli/commit/d1e8e73) refactor(shell): ignore cov, cleanup etc (Jitendra Adhikari)-- [8d5ebe9](https://github.com/adhocore/php-cli/commit/8d5ebe9) feat(shell): a shell wrapper (Jitendra Adhikari)-- [37c0e4c](https://github.com/adhocore/php-cli/commit/37c0e4c) Async true gives the process ID (Sushil Gupta)-- [1052ca0](https://github.com/adhocore/php-cli/commit/1052ca0) More style fixes (Sushil Gupta)-- [29e8d13](https://github.com/adhocore/php-cli/commit/29e8d13) If timeout is set, and is set to wait (not async by default), then either wait until it runs or kill it after timeout occurs - if async (not wait) - then don't care about the process at all (Sushil Gupta)-- [7cf9536](https://github.com/adhocore/php-cli/commit/7cf9536) If not async, then check for timeout if it is still running and attempt to stop it (Sushil Gupta)-- [88bc092](https://github.com/adhocore/php-cli/commit/88bc092) Stop - not kill (Sushil Gupta)-- [40ba003](https://github.com/adhocore/php-cli/commit/40ba003) Minor formatting fixed (Sushil Gupta)-- [f81237e](https://github.com/adhocore/php-cli/commit/f81237e) Added set options method (Sushil Gupta)-- [2d44553](https://github.com/adhocore/php-cli/commit/2d44553) On destruct, if running, waiting until timeout and then attempting to stop, instead of directly attempting to stop (Sushil Gupta)-- [acabcca](https://github.com/adhocore/php-cli/commit/acabcca) Root namespace appended for microtime (Sushil Gupta)-- [e86580a](https://github.com/adhocore/php-cli/commit/e86580a) Removed redundant unblocking of getOutput (Sushil Gupta)-- [76fce1b](https://github.com/adhocore/php-cli/commit/76fce1b) Minor DocBlock update (Sushil Gupta)-- [926c4a6](https://github.com/adhocore/php-cli/commit/926c4a6) WIP - Implemented timeout checking and wait system - not working yet (Sushil Gupta)-- [641d229](https://github.com/adhocore/php-cli/commit/641d229) Minor refactor - removing updateProcessStatus when asking for getState - not related (Sushil Gupta)-- [205daed](https://github.com/adhocore/php-cli/commit/205daed) Refactored to add another state variable to store actual state of the shell execution vs the process status (Sushil Gupta)-- [62acd2d](https://github.com/adhocore/php-cli/commit/62acd2d) File default info added (Sushil Gupta)-- [acdbd64](https://github.com/adhocore/php-cli/commit/acdbd64) Refactor - assigning default null + only assigning exit value if not already set and process has stopped (Sushil Gupta)-- [d742ecb](https://github.com/adhocore/php-cli/commit/d742ecb) Updating status before sending back exitcodes (Sushil Gupta)-- [96e3a9e](https://github.com/adhocore/php-cli/commit/96e3a9e) Made private methods protected (Sushil Gupta)-- [3939825](https://github.com/adhocore/php-cli/commit/3939825) Setting exit code on proc_close from the proc_get_status itself (Sushil Gupta)-- [56ba25d](https://github.com/adhocore/php-cli/commit/56ba25d) Implemented suggestions from code-review (Sushil Gupta)-- [dbb3c21](https://github.com/adhocore/php-cli/commit/dbb3c21) Refactored small things (Sushil Gupta)-- [13380da](https://github.com/adhocore/php-cli/commit/13380da) Removed timeout - not used anywhere for now (Sushil Gupta)-- [2d0f815](https://github.com/adhocore/php-cli/commit/2d0f815) One more style fix (Sushil Gupta)-- [e93b398](https://github.com/adhocore/php-cli/commit/e93b398) More style fixes :/ (Sushil Gupta)-- [1be59a6](https://github.com/adhocore/php-cli/commit/1be59a6) More style fixes (Sushil Gupta)-- [e43a34f](https://github.com/adhocore/php-cli/commit/e43a34f) More style fixes (Sushil Gupta)-- [0874497](https://github.com/adhocore/php-cli/commit/0874497) Style fixes - unindenting inside <?php tag (Sushil Gupta)-- [304f148](https://github.com/adhocore/php-cli/commit/304f148) Removed wait method - wasn't working - to be added (Sushil Gupta)-- [735294c](https://github.com/adhocore/php-cli/commit/735294c) Removed env + cwd from the options, passing null, for the sprit of minimalism ;) (Sushil Gupta)-- [bfe1965](https://github.com/adhocore/php-cli/commit/bfe1965) Added basic test case for getOutput (Sushil Gupta)-- [4972de3](https://github.com/adhocore/php-cli/commit/4972de3) Moved to helper (Sushil Gupta)-- [425af5e](https://github.com/adhocore/php-cli/commit/425af5e) Added pipes for different platform, checking directory separator + added public method to return PID (Sushil Gupta)-- [19ce603](https://github.com/adhocore/php-cli/commit/19ce603) Minor refactoring (Sushil Gupta)-- [22a759a](https://github.com/adhocore/php-cli/commit/22a759a) Moved public functions to the bottom (Sushil Gupta)-- [87ed2e4](https://github.com/adhocore/php-cli/commit/87ed2e4) Made some methods private + added exitCode method (Sushil Gupta)-- [c4c4f4e](https://github.com/adhocore/php-cli/commit/c4c4f4e) Added wait and other methods (Sushil Gupta)-- [bd54feb](https://github.com/adhocore/php-cli/commit/bd54feb) Using constants for descriptors key (Sushil Gupta)-- [4d8578e](https://github.com/adhocore/php-cli/commit/4d8578e) Minor refactoring (Sushil Gupta)-- [1e42021](https://github.com/adhocore/php-cli/commit/1e42021) Shell wrapper - basic proc_open implemented (Sushil Gupta)-- [25c3f1a](https://github.com/adhocore/php-cli/commit/25c3f1a) docs: improve readability and organize (Jitendra Adhikari)-- [a75c76e](https://github.com/adhocore/php-cli/commit/a75c76e) feat(cmd.option): support multiline desc and indent them properly on help (Jitendra Adhikari)-- [7b04d18](https://github.com/adhocore/php-cli/commit/7b04d18) refactor: readme > README (Jitendra Adhikari)-- [6e79204](https://github.com/adhocore/php-cli/commit/6e79204) docs: exceptions preview (Jitendra Adhikari)-- [c5ffb12](https://github.com/adhocore/php-cli/commit/c5ffb12) test: 100% cov ftw (Jitendra Adhikari)-- [92f41ba](https://github.com/adhocore/php-cli/commit/92f41ba) feat(output.helper): add print trace (Jitendra Adhikari)-- [7b5080e](https://github.com/adhocore/php-cli/commit/7b5080e) refactor(app): output helper instantiation and print trace (Jitendra Adhikari)
-21
vendor/adhocore/cli/LICENSE
-21
vendor/adhocore/cli/LICENSE
···
-928
vendor/adhocore/cli/README.md
-928
vendor/adhocore/cli/README.md
···-Framework agnostic Command Line Interface utilities and helpers for PHP. Build Console App with ease, fun and love.-[](https://github.com/adhocore/php-cli/releases)-[](https://github.com/adhocore/php-cli/actions/workflows/build.yml)-[](https://scrutinizer-ci.com/g/adhocore/php-cli/?branch=main)-[](https://codecov.io/gh/adhocore/php-cli)-[](LICENSE)-[](https://twitter.com/intent/tweet?text=Framework+agnostic+Command+Line+Interface+utilities+and+helpers+for+PHP&url=https://github.com/adhocore/php-cli&hashtags=php,cli,cliapp,console)-[](https://github.com/sponsors/adhocore)-<!-- [](https://www.paypal.me/ji10/15usd)-[](https://www.paypal.me/ji10/25usd)-[](https://www.paypal.me/ji10/50usd) -->-[](https://github.com/adhocore/phalcon-ext/tree/master/example/cli)-**Core:** [Argv parser](#argv-parser) · [Cli application](#console-app) · [Shell](#shell)-**IO:** [Colorizer](#color) · [Cursor manipulator](#cursor) · [Progress bar](#progress-bar) · [Stream writer](#writer) · [Stream reader](#reader)-It can be triggered manually with `$command->showHelp()` or automatic when `-h` or `--help` option is passed to `$command->parse()`.-It can be triggered manually with `$command->showVersion()` or automatic when `-V` or `--version` option is passed to `$command->parse()`.-Definitely check [adhocore/phint](https://github.com/adhocore/phint) - a real world console application made using `adhocore/cli`.-Instead of inline commands/actions, we define and add our own commands (having `interact()` and `execute()`) to the app:-// append details or explanation of given example with ` ## ` so they will be uniformly aligned when shown-Grouped commands are listed together in commands list. Explicit grouping a command is optional.-> Example: command name `app:env` has a default group `app`, command name `appenv` has group `*`.-By default, running your CLI app without any arguments will show the help screen. However you can set the default action to run one of your commands either by setting the third parameter of the `add` function to `true` or by using the `defaultCommand` function.-Set a custom exception handler as callback. The callback receives exception & exit code. The callback may rethrow exception or may exit the program or just log exception and do nothing else.-It can be triggered manually with `$app->showHelp()` or automatic when `-h` or `--help` option is passed to `$app->parse()`.-**Note** If you pass something like `['app', cmd', '-h']` to `$app->parse()` it will automatically and instantly show you help of that `cmd` and not the `$app`.-Same version number is passed to all attached Commands. So you can trigger version on any of the commands.-You can perform user interaction like printing colored output, reading user input programatically and moving the cursors around with provided `Ahc\Cli\IO\Interactor`.-> On windows platform, it may change the fontface which can be [fixed](https://superuser.com/a/757591).-The interactor is composed of `Ahc\Cli\Input\Reader` and `Ahc\Cli\Output\Writer` while the `Writer` itself is composed of `Ahc\Cli\Output\Color`. All these components can be used standalone.-There are a number of pre-defined built-in styles that allows you granular customization to different output conditions such as help and prompts:-... in any order (eg: `bgRedFgBlaock`, `boldRed`, `greenBold`, `commentBgPurple` and so on ...)-You can define the style of a cell dynamically using a callback. You could then apply one style or another depending on a value.-The example above only processes the cells in the second column of the table. If you want to process any cell, you can use the `*:*` key. You could then customise each cell in the table-If you want to display certain configurations (from your .env file for example) a bit like Laravel does (via the `php artisan about` command) you can use the `justify` method.-In addition, the text color, the background color and the thickness of the two texts can be defined via the 3rd argument of this method.-Whenever an exception is caught by `Application::handle()`, it will show a beautiful stack trace and exit with non 0 status code.--**adhocore/cli** also supports internationalisation. This is particularly useful if you are not very comfortable with English or if you are creating a framework or CLI application that could be used by people from a variety of backgrounds.-By default, all the texts generated by our system are in English. But you can easily modify them by defining your translations as follows-You can also change the default English text to make the description more explicit if you wish.-you can find all the translation keys supported by the package in this gist : https://gist.github.com/dimtrovich/1597c16d5c74334e68eef15a4e7ba3fd-Any console applications that are built on top of **adhocore/cli** can entertain autocomplete of commands and options in zsh shell with oh-my-zsh.-All you have to do is add one line to the end of `~/.oh-my-zsh/custom/plugins/ahccli/ahccli.plugin.zsh`:-[ -f ./ahccli.plugin.zsh ] || curl -sSLo ./ahccli.plugin.zsh https://raw.githubusercontent.com/adhocore/php-cli/master/ahccli.plugin.zsh-- [adhocore/phalcon-ext](https://github.com/adhocore/phalcon-ext) · Phalcon extension using `adhocore/cli`-- [adhocore/phint](https://github.com/adhocore/phint) · PHP project scaffolding app using `adhocore/cli`-- [adhocore/type-hinter](https://github.com/adhocore/php-type-hinter) · Auto PHP7 typehinter tool using `adhocore/cli`
-1
vendor/adhocore/cli/VERSION
-1
vendor/adhocore/cli/VERSION
···
-54
vendor/adhocore/cli/composer.json
-54
vendor/adhocore/cli/composer.json
···-"test:cov": "phpunit --coverage-text --coverage-clover coverage.xml --coverage-html vendor/cov",
-480
vendor/adhocore/cli/src/Application.php
-480
vendor/adhocore/cli/src/Application.php
···-/** @var callable The callable to catch exception, receives exception & exit code, may rethrow exception or may exit program */-public function __construct(protected string $name, protected string $version = '0.0.1', ?callable $onExit = null)-$this->commands[$name] = $command->version($this->version)->onExit($this->onExit)->bind($this);
-19
vendor/adhocore/cli/src/Exception.php
-19
vendor/adhocore/cli/src/Exception.php
···
-19
vendor/adhocore/cli/src/Exception/InvalidArgumentException.php
-19
vendor/adhocore/cli/src/Exception/InvalidArgumentException.php
···
-17
vendor/adhocore/cli/src/Exception/InvalidParameterException.php
-17
vendor/adhocore/cli/src/Exception/InvalidParameterException.php
···
-19
vendor/adhocore/cli/src/Exception/RuntimeException.php
-19
vendor/adhocore/cli/src/Exception/RuntimeException.php
···
-78
vendor/adhocore/cli/src/Helper/InflectsString.php
-78
vendor/adhocore/cli/src/Helper/InflectsString.php
···
-76
vendor/adhocore/cli/src/Helper/Normalizer.php
-76
vendor/adhocore/cli/src/Helper/Normalizer.php
···
-387
vendor/adhocore/cli/src/Helper/OutputHelper.php
-387
vendor/adhocore/cli/src/Helper/OutputHelper.php
···-$trace += ['class' => '', 'type' => '', 'function' => '', 'file' => '', 'line' => '', 'args' => []];-$traceStr .= '<eol/> <yellow>' . t('at') . " $file</end><white>:{$trace['line']}</end><eol/>";-public function showArgumentsHelp(array $arguments, string $header = '', string $footer = ''): self-public function showOptionsHelp(array $options, string $header = '', string $footer = ''): self-public function showCommandsHelp(array $commands, string $header = '', string $footer = ''): self-$this->maxCmdName = $commands ? max(array_map(static fn (Command $cmd) => strlen($cmd->name()), $commands)) : 0;-protected function showHelp(string $for, array $items, string $header = '', string $footer = ''): void-$desc = str_replace(["\r\n", "\n"], str_pad("\n", $padLen + $space + 3), $item->desc($withDefault));
-333
vendor/adhocore/cli/src/Helper/Shell.php
-333
vendor/adhocore/cli/src/Helper/Shell.php
···-/** @var string Current state of the shell execution, set from this class, NOT for proc_get_status */-protected function prepareDescriptors(?array $stdin = null, ?array $stdout = null, ?array $stderr = null): array-public function execute(bool $async = false, ?array $stdin = null, ?array $stdout = null, ?array $stderr = null): self-return $isRes ? stream_set_blocking($this->pipes[self::STDOUT_DESCRIPTOR_KEY], false) : false;
-99
vendor/adhocore/cli/src/Helper/Terminal.php
-99
vendor/adhocore/cli/src/Helper/Terminal.php
···-* @todo provide different adapters for the platforms (linux and windows) for better organization.
-439
vendor/adhocore/cli/src/IO/Interactor.php
-439
vendor/adhocore/cli/src/IO/Interactor.php
···-public function choice(string $text, array $choices, $default = null, bool $case = false): mixed-public function choices(string $text, array $choices, $default = null, bool $case = false): mixed-public function prompt(string $text, $default = null, ?callable $fn = null, int $retry = 3): mixed
-51
vendor/adhocore/cli/src/Input/Argument.php
-51
vendor/adhocore/cli/src/Input/Argument.php
···
-453
vendor/adhocore/cli/src/Input/Command.php
-453
vendor/adhocore/cli/src/Input/Command.php
···-public function option(string $raw, string $desc = '', ?callable $filter = null, $default = null): self-if (($logo = $this->logo()) || ($app && ($logo = $app->logo()) && $app->getDefaultCommand() === $this->_name)) {-$io->help_header(t('Command') . " {$this->_name}, " . t('version') . " {$this->_version}", true)->eol();-$io->help_text(t('Usage') . ': ')->help_example("{$this->_name} " . t('[OPTIONS...] [ARGUMENTS...]'), true);
-33
vendor/adhocore/cli/src/Input/Groupable.php
-33
vendor/adhocore/cli/src/Input/Groupable.php
···
-85
vendor/adhocore/cli/src/Input/Option.php
-85
vendor/adhocore/cli/src/Input/Option.php
···
-147
vendor/adhocore/cli/src/Input/Parameter.php
-147
vendor/adhocore/cli/src/Input/Parameter.php
···
-330
vendor/adhocore/cli/src/Input/Parser.php
-330
vendor/adhocore/cli/src/Input/Parser.php
···-return false === $this->emit($option->attributeName(), $value) ? false : $this->setValue($option, $value);-* @throws \RuntimeException When given arg is not registered and allow unkown flag is not set.-fn ($item) => $item->required() && in_array($this->_values[$item->attributeName()], [null, []])
-164
vendor/adhocore/cli/src/Input/Reader.php
-164
vendor/adhocore/cli/src/Input/Reader.php
···
-289
vendor/adhocore/cli/src/Output/Color.php
-289
vendor/adhocore/cli/src/Output/Color.php
···
-139
vendor/adhocore/cli/src/Output/Cursor.php
-139
vendor/adhocore/cli/src/Output/Cursor.php
···
-376
vendor/adhocore/cli/src/Output/ProgressBar.php
-376
vendor/adhocore/cli/src/Output/ProgressBar.php
···-// in spinner/async mode, you may hide the progress percentage as you won't know in advance how long it will take-if (strlen($label) > 0 && in_array($this->options['labelPosition'], ['bottom', 'top'], true)) {-* Format the output of the progress bar by placing the label in the right place (top, right, bottom or left).-$progress[] = '<' . $this->options['color'] . '>' . $bar . ' ' . $number . '</end>'; // bar + percentage-$progress[] = '<' . $this->options['color'] . '>' . $bar . ' ' . $number . '</end> '; // bar + percentage-return $this->forceRedraw || $percentage != $this->currentPercentage || $label != $this->label;
-189
vendor/adhocore/cli/src/Output/Table.php
-189
vendor/adhocore/cli/src/Output/Table.php
···-return $string . $this->substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired);
-378
vendor/adhocore/cli/src/Output/Writer.php
-378
vendor/adhocore/cli/src/Output/Writer.php
···-* @param array $options Options to use when writing Eg: ['fg' => Color::GREEN, 'bold' => 1, 'sep' => '-']-// remove left and right margins because we're going to add 1 space on each side (after/before the text).
-23
vendor/adhocore/cli/src/functions.php
-23
vendor/adhocore/cli/src/functions.php
···
-119
vendor/bin/runway
-119
vendor/bin/runway
···-(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))-|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
-41
vendor/composer/autoload_classmap.php
-41
vendor/composer/autoload_classmap.php
···-'Nette\\PhpGenerator\\Attribute' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Attribute.php',-'Nette\\PhpGenerator\\ClassLike' => $vendorDir . '/nette/php-generator/src/PhpGenerator/ClassLike.php',-'Nette\\PhpGenerator\\ClassManipulator' => $vendorDir . '/nette/php-generator/src/PhpGenerator/ClassManipulator.php',-'Nette\\PhpGenerator\\ClassType' => $vendorDir . '/nette/php-generator/src/PhpGenerator/ClassType.php',-'Nette\\PhpGenerator\\Closure' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Closure.php',-'Nette\\PhpGenerator\\Constant' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Constant.php',-'Nette\\PhpGenerator\\Dumper' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Dumper.php',-'Nette\\PhpGenerator\\EnumCase' => $vendorDir . '/nette/php-generator/src/PhpGenerator/EnumCase.php',-'Nette\\PhpGenerator\\EnumType' => $vendorDir . '/nette/php-generator/src/PhpGenerator/EnumType.php',-'Nette\\PhpGenerator\\Extractor' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Extractor.php',-'Nette\\PhpGenerator\\Factory' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Factory.php',-'Nette\\PhpGenerator\\GlobalFunction' => $vendorDir . '/nette/php-generator/src/PhpGenerator/GlobalFunction.php',-'Nette\\PhpGenerator\\Helpers' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Helpers.php',-'Nette\\PhpGenerator\\InterfaceType' => $vendorDir . '/nette/php-generator/src/PhpGenerator/InterfaceType.php',-'Nette\\PhpGenerator\\Literal' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Literal.php',-'Nette\\PhpGenerator\\Method' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Method.php',-'Nette\\PhpGenerator\\Parameter' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Parameter.php',-'Nette\\PhpGenerator\\PhpFile' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PhpFile.php',-'Nette\\PhpGenerator\\PhpLiteral' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PhpLiteral.php',-'Nette\\PhpGenerator\\PhpNamespace' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PhpNamespace.php',-'Nette\\PhpGenerator\\Printer' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Printer.php',-'Nette\\PhpGenerator\\PromotedParameter' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PromotedParameter.php',-'Nette\\PhpGenerator\\Property' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Property.php',-'Nette\\PhpGenerator\\PropertyAccessMode' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PropertyAccessMode.php',-'Nette\\PhpGenerator\\PropertyHook' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PropertyHook.php',-'Nette\\PhpGenerator\\PropertyHookType' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PropertyHookType.php',-'Nette\\PhpGenerator\\PsrPrinter' => $vendorDir . '/nette/php-generator/src/PhpGenerator/PsrPrinter.php',-'Nette\\PhpGenerator\\TraitType' => $vendorDir . '/nette/php-generator/src/PhpGenerator/TraitType.php',-'Nette\\PhpGenerator\\TraitUse' => $vendorDir . '/nette/php-generator/src/PhpGenerator/TraitUse.php',-'Nette\\PhpGenerator\\Traits\\AttributeAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php',-'Nette\\PhpGenerator\\Traits\\CommentAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php',-'Nette\\PhpGenerator\\Traits\\ConstantsAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/ConstantsAware.php',-'Nette\\PhpGenerator\\Traits\\FunctionLike' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php',-'Nette\\PhpGenerator\\Traits\\MethodsAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/MethodsAware.php',-'Nette\\PhpGenerator\\Traits\\NameAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/NameAware.php',-'Nette\\PhpGenerator\\Traits\\PropertiesAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/PropertiesAware.php',-'Nette\\PhpGenerator\\Traits\\PropertyLike' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/PropertyLike.php',-'Nette\\PhpGenerator\\Traits\\TraitsAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/TraitsAware.php',-'Nette\\PhpGenerator\\Traits\\VisibilityAware' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php',-'Nette\\PhpGenerator\\Visibility' => $vendorDir . '/nette/php-generator/src/PhpGenerator/Visibility.php','Nette\\Schema\\DynamicParameter' => $vendorDir . '/nette/schema/src/Schema/DynamicParameter.php',
-1
vendor/composer/autoload_files.php
-1
vendor/composer/autoload_files.php
···'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php','0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php','ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
+1
-3
vendor/composer/autoload_psr4.php
+1
-3
vendor/composer/autoload_psr4.php
······'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),···
+1
-60
vendor/composer/autoload_static.php
+1
-60
vendor/composer/autoload_static.php
···'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php','320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php','0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php','4cdafd4a5191caf078235e7dd119fdaf' => __DIR__ . '/..' . '/flightphp/core/flight/autoload.php','ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php','a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',···············-'Nette\\PhpGenerator\\Attribute' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Attribute.php',-'Nette\\PhpGenerator\\ClassLike' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/ClassLike.php',-'Nette\\PhpGenerator\\ClassManipulator' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/ClassManipulator.php',-'Nette\\PhpGenerator\\ClassType' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/ClassType.php',-'Nette\\PhpGenerator\\Closure' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Closure.php',-'Nette\\PhpGenerator\\Constant' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Constant.php',-'Nette\\PhpGenerator\\Dumper' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Dumper.php',-'Nette\\PhpGenerator\\EnumCase' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/EnumCase.php',-'Nette\\PhpGenerator\\EnumType' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/EnumType.php',-'Nette\\PhpGenerator\\Extractor' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Extractor.php',-'Nette\\PhpGenerator\\Factory' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Factory.php',-'Nette\\PhpGenerator\\GlobalFunction' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/GlobalFunction.php',-'Nette\\PhpGenerator\\Helpers' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Helpers.php',-'Nette\\PhpGenerator\\InterfaceType' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/InterfaceType.php',-'Nette\\PhpGenerator\\Literal' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Literal.php',-'Nette\\PhpGenerator\\Method' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Method.php',-'Nette\\PhpGenerator\\Parameter' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Parameter.php',-'Nette\\PhpGenerator\\PhpFile' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PhpFile.php',-'Nette\\PhpGenerator\\PhpLiteral' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PhpLiteral.php',-'Nette\\PhpGenerator\\PhpNamespace' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PhpNamespace.php',-'Nette\\PhpGenerator\\Printer' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Printer.php',-'Nette\\PhpGenerator\\PromotedParameter' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PromotedParameter.php',-'Nette\\PhpGenerator\\Property' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Property.php',-'Nette\\PhpGenerator\\PropertyAccessMode' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PropertyAccessMode.php',-'Nette\\PhpGenerator\\PropertyHook' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PropertyHook.php',-'Nette\\PhpGenerator\\PropertyHookType' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PropertyHookType.php',-'Nette\\PhpGenerator\\PsrPrinter' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/PsrPrinter.php',-'Nette\\PhpGenerator\\TraitType' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/TraitType.php',-'Nette\\PhpGenerator\\TraitUse' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/TraitUse.php',-'Nette\\PhpGenerator\\Traits\\AttributeAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php',-'Nette\\PhpGenerator\\Traits\\CommentAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php',-'Nette\\PhpGenerator\\Traits\\ConstantsAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/ConstantsAware.php',-'Nette\\PhpGenerator\\Traits\\FunctionLike' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php',-'Nette\\PhpGenerator\\Traits\\MethodsAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/MethodsAware.php',-'Nette\\PhpGenerator\\Traits\\NameAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/NameAware.php',-'Nette\\PhpGenerator\\Traits\\PropertiesAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/PropertiesAware.php',-'Nette\\PhpGenerator\\Traits\\PropertyLike' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/PropertyLike.php',-'Nette\\PhpGenerator\\Traits\\TraitsAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/TraitsAware.php',-'Nette\\PhpGenerator\\Traits\\VisibilityAware' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php',-'Nette\\PhpGenerator\\Type' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Type.php',-'Nette\\PhpGenerator\\Visibility' => __DIR__ . '/..' . '/nette/php-generator/src/PhpGenerator/Visibility.php','Nette\\Schema\\DynamicParameter' => __DIR__ . '/..' . '/nette/schema/src/Schema/DynamicParameter.php',
+2
-207
vendor/composer/installed.json
+2
-207
vendor/composer/installed.json
···-"url": "https://api.github.com/repos/adhocore/php-cli/zipball/474dc3d7ab139796be98b104d891476e3916b6f4",···-"url": "https://api.github.com/repos/flightphp/runway/zipball/b88c1901b77eda935ef475af772445c3108cf23f",···-"url": "https://api.github.com/repos/nette/php-generator/zipball/4707546a1f11badd72f5d82af4f8a6bc64bd56ac",-"description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.",···
+3
-30
vendor/composer/installed.php
+3
-30
vendor/composer/installed.php
···············
-9
vendor/flightphp/runway/.gitignore
-9
vendor/flightphp/runway/.gitignore
-21
vendor/flightphp/runway/LICENSE
-21
vendor/flightphp/runway/LICENSE
···
-31
vendor/flightphp/runway/README.md
-31
vendor/flightphp/runway/README.md
···-Runway is a console app for managing your Flight projects. This is built off the backbone of the amazing [adhocore/php-cli](https://github.com/adhocore/php-cli) libraries.
-47
vendor/flightphp/runway/composer.json
-47
vendor/flightphp/runway/composer.json
···-"test-coverage": "rm -f clover.xml && XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage --coverage-clover=clover.xml && vendor/bin/coverage-check clover.xml 100",
-52
vendor/flightphp/runway/phpcs.xml
-52
vendor/flightphp/runway/phpcs.xml
···
-7
vendor/flightphp/runway/phpstan.neon
-7
vendor/flightphp/runway/phpstan.neon
-29
vendor/flightphp/runway/phpunit.xml
-29
vendor/flightphp/runway/phpunit.xml
···
-116
vendor/flightphp/runway/runway
-116
vendor/flightphp/runway/runway
···-foreach ([ __DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php' ] as $file) {-if($baseName === 'AbstractBaseCommand.php' || strpos($baseName, 'CommandTest.php') !== false) {
-45
vendor/flightphp/runway/scripts/setup.php
-45
vendor/flightphp/runway/scripts/setup.php
···-$interactor->blue('This wizard will help you get your settings correct for your Flight project.', true);-$choice = $interactor->choice('Where is your root index.php file located for your project?', $possible_file_locations, '1');-$choice = $interactor->choice('Where is your root app directory where you store all your controllers, views, utility classes, etc?', $possible_app_locations, '1');
-24
vendor/flightphp/runway/src/commands/AbstractBaseCommand.php
-24
vendor/flightphp/runway/src/commands/AbstractBaseCommand.php
···
-47
vendor/nette/php-generator/composer.json
-47
vendor/nette/php-generator/composer.json
···-"description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.",
-60
vendor/nette/php-generator/license.md
-60
vendor/nette/php-generator/license.md
···
-1008
vendor/nette/php-generator/readme.md
-1008
vendor/nette/php-generator/readme.md
···-[](https://doc.nette.org/en/php-generator)-[](https://github.com/nette/php-generator/releases) [](https://packagist.org/packages/nette/php-generator)-Are you looking for a tool to generate PHP code for [classes](#classes), [functions](#global-functions), or complete [PHP files](#php-files)?-✅ Supports all the latest PHP features like [property hooks](#property-hooks), [enums](#enums), [attributes](#attributes), etc.<br>-Download and install the library using the [Composer](https://doc.nette.org/en/best-practices/composer) tool:-PhpGenerator 4.2 is compatible with PHP 8.1 to 8.5. Documentation can be found on the [library's website](https://doc.nette.org/php-generator).-[](https://github.com/sponsors/dg)-Let's start with an example of creating a class using [ClassType](https://api.nette.org/php-generator/master/Nette/PhpGenerator/ClassType.html):-To generate the code, you can also use a so-called printer, which, unlike `echo $class`, can be [further configured](#printer-and-psr-compliance):-You can add constants (class [Constant](https://api.nette.org/php-generator/master/Nette/PhpGenerator/Constant.html)) and properties (class [Property](https://api.nette.org/php-generator/master/Nette/PhpGenerator/Property.html)):-Class members can be removed using `removeProperty()`, `removeConstant()`, `removeMethod()`, or `removeParameter()`.-You can also clone existing methods, properties, and constants under a different name using `cloneWithName()`:-You can create interfaces and traits (classes [InterfaceType](https://api.nette.org/php-generator/master/Nette/PhpGenerator/InterfaceType.html) and [TraitType](https://api.nette.org/php-generator/master/Nette/PhpGenerator/TraitType.html)):-You can easily create enums introduced in PHP 8.1 like this (class [EnumType](https://api.nette.org/php-generator/master/Nette/PhpGenerator/EnumType.html)):-For each *case*, you can add a comment or [attributes](#attributes) using `addComment()` or `addAttribute()`.-The code for functions is generated by the class [GlobalFunction](https://api.nette.org/php-generator/master/Nette/PhpGenerator/GlobalFunction.html):-The code for anonymous functions is generated by the class [Closure](https://api.nette.org/php-generator/master/Nette/PhpGenerator/Closure.html):-Methods are represented by the class [Method](https://api.nette.org/php-generator/master/Nette/PhpGenerator/Method.html). You can set visibility, return value, add comments, [attributes](#attributes), etc.:-Individual parameters are represented by the class [Parameter](https://api.nette.org/php-generator/master/Nette/PhpGenerator/Parameter.html). Again, you can set all conceivable properties:-To define the so-called variadics parameters (or also the splat, spread, ellipsis, unpacking or three dots operator), use `setVariadic()`:-The body can be passed all at once to the `setBody()` method or gradually (line by line) by repeatedly calling `addBody()`:-The [Printer](https://api.nette.org/php-generator/master/Nette/PhpGenerator/Printer.html) class is used for generating PHP code:-It can generate code for all other elements, offering methods like `printFunction()`, `printNamespace()`, etc.-There's also the `PsrPrinter` class, which outputs in accordance with PSR-2 / PSR-12 / PER coding style:-Need custom behavior? Create your own version by inheriting the `Printer` class. You can reconfigure these variables:-// number of blank lines between 'use statements' groups for classes, functions, and constants-How and why does the standard `Printer` differ from `PsrPrinter`? Why isn't there just one printer, the `PsrPrinter`, in the package?-The standard `Printer` formats the code as we do throughout Nette. Since Nette was established much earlier than PSR, and also because PSR took years to deliver standards on time, sometimes even several years after introducing a new feature in PHP, it resulted in a [coding standard](https://doc.nette.org/en/contributing/coding-standard) that differs in a few minor aspects.-The major difference is the use of tabs instead of spaces. We know that by using tabs in our projects, we allow for width customization, which is [essential for people with visual impairments](https://doc.nette.org/en/contributing/coding-standard#toc-tabs-instead-of-spaces).-An example of a minor difference is placing the curly brace on a separate line for functions and methods, always. The PSR recommendation seems illogical to us and [leads to reduced code clarity](https://doc.nette.org/en/contributing/coding-standard#toc-wrapping-and-braces).-Every type or union/intersection type can be passed as a string; you can also use predefined constants for native types:-Using `Literal`, you can pass any PHP code, for example, for default property values or parameters, etc:-You can also pass parameters to `Literal` and have them formatted into valid PHP code using [placeholders](#method-and-function-bodies):-A literal representing the creation of a new object can easily be generated using the `new` method:-With PHP 8, you can add attributes to all classes, methods, properties, constants, enum cases, functions, closures, and parameters. You can also use [literals](#literals) as parameter values.-You can also define property hooks (represented by the class [PropertyHook](https://api.nette.org/php-generator/master/Nette/PhpGenerator/PropertyHook.html)) for get and set operations, a feature introduced in PHP 8.4:-PHP 8.4 introduces asymmetric visibility for properties. You can set different access levels for reading and writing.-The visibility can be set using either the `setVisibility()` method with two parameters, or by using `setPublic()`, `setProtected()`, or `setPrivate()` with the `mode` parameter that specifies whether the visibility applies to getting or setting the property. The default mode is 'get'.-Classes, traits, interfaces, and enums (hereafter referred to as classes) can be grouped into namespaces represented by the [PhpNamespace](https://api.nette.org/php-generator/master/Nette/PhpGenerator/PhpNamespace.html) class:-To simplify a fully qualified class, function, or constant name based on defined aliases, use the `simplifyName` method:-echo $namespace->simplifyName('iter\range', $namespace::NameFunction); // 'range', due to the defined use-statement-Conversely, you can convert a simplified class, function, or constant name back to a fully qualified name using the `resolveName` method:-**When a class is part of a namespace, it's rendered slightly differently:** all types (e.g., type hints, return types, parent class name, implemented interfaces, used traits, and attributes) are automatically *resolved* (unless you turn it off, see below).-This means you must use **fully qualified class names** in definitions, and they will be replaced with aliases (based on use clauses) or fully qualified names in the resulting code:-$method->addComment('@return ' . $namespace->simplifyType('Foo\D')); // we manually simplify in comments-Classes, functions, and namespaces can be grouped into PHP files represented by the [PhpFile](https://api.nette.org/php-generator/master/Nette/PhpGenerator/PhpFile.html) class:-**Please note:** No additional code can be added to the files outside of functions and classes.-In addition to being able to model classes and functions using the API described above, you can also have them automatically generated using existing ones:-By default, function and method bodies are empty. If you also want to load them, use this method-You can also load functions, classes, interfaces, and enums directly from a string containing PHP code. For example, to create a `ClassType` object:-When loading classes from PHP code, single-line comments outside method bodies are ignored (e.g., for properties, etc.), as this library doesn't have an API to work with them.-You can also directly load an entire PHP file, which can contain any number of classes, functions, or even namespaces:-The file's initial comment and `strict_types` declaration are also loaded. However, all other global code is ignored.-*(If you need to manipulate global code in files or individual statements in method bodies, it's better to use the `nikic/php-parser` library directly.)*-The [ClassManipulator](https://api.nette.org/php-generator/master/Nette/PhpGenerator/ClassManipulator.html) class provides tools for manipulating classes.-The `inheritMethod()` method copies a method from a parent class or implemented interface into your class. This allows you to override the method or extend its signature:-The `inheritProperty()` method copies a property from a parent class into your class. This is useful when you want to have the same property in your class, but possibly with a different default value:-The `implement()` method automatically implements all methods and properties from the given interface or abstract class:-The `Dumper` class converts a variable into parseable PHP code. It provides a better and clearer output than the standard `var_export()` function.
-49
vendor/nette/php-generator/src/PhpGenerator/Attribute.php
-49
vendor/nette/php-generator/src/PhpGenerator/Attribute.php
···
-148
vendor/nette/php-generator/src/PhpGenerator/ClassLike.php
-148
vendor/nette/php-generator/src/PhpGenerator/ClassLike.php
···-throw new Nette\InvalidArgumentException("$class cannot be represented with " . static::class . '. Call ' . $instance::class . '::' . __FUNCTION__ . '() or ' . __METHOD__ . '() instead.');-throw new Nette\InvalidArgumentException('Provided code cannot be represented with ' . static::class . '. Call ' . $instance::class . '::' . __FUNCTION__ . '() or ' . __METHOD__ . '() instead.');-if ($name !== null && (!Helpers::isIdentifier($name) || isset(Helpers::Keywords[strtolower($name)]))) {
-124
vendor/nette/php-generator/src/PhpGenerator/ClassManipulator.php
-124
vendor/nette/php-generator/src/PhpGenerator/ClassManipulator.php
···-: throw new Nette\InvalidStateException("Cannot inherit property '$name', because it already exists.");-?: throw new Nette\InvalidStateException("Class '{$this->class->getName()}' has neither setExtends() nor setImplements() set.");-throw new Nette\InvalidStateException("Property '$name' has not been found in any ancestor: " . implode(', ', $parents));-: throw new Nette\InvalidStateException("Cannot inherit method '$name', because it already exists.");-?: throw new Nette\InvalidStateException("Class '{$this->class->getName()}' has neither setExtends() nor setImplements() set.");-throw new Nette\InvalidStateException("Method '$name' has not been found in any ancestor: " . implode(', ', $parents));
-198
vendor/nette/php-generator/src/PhpGenerator/ClassType.php
-198
vendor/nette/php-generator/src/PhpGenerator/ClassType.php
···-public function addMember(Method|Property|Constant|TraitUse $member, bool $overwrite = false): static-throw new Nette\InvalidStateException("Cannot add member '$name', because it already exists.");-throw new Nette\InvalidStateException("Class '$name' cannot be abstract and final at the same time.");
-66
vendor/nette/php-generator/src/PhpGenerator/Closure.php
-66
vendor/nette/php-generator/src/PhpGenerator/Closure.php
···
-66
vendor/nette/php-generator/src/PhpGenerator/Constant.php
-66
vendor/nette/php-generator/src/PhpGenerator/Constant.php
···
-288
vendor/nette/php-generator/src/PhpGenerator/Dumper.php
-288
vendor/nette/php-generator/src/PhpGenerator/Dumper.php
···-use function addcslashes, array_keys, array_shift, count, dechex, implode, in_array, is_array, is_int, is_object, is_resource, is_string, ltrim, method_exists, ord, preg_match, preg_replace, preg_replace_callback, preg_split, range, serialize, str_contains, str_pad, str_repeat, str_replace, strlen, strrpos, strtoupper, substr, trim, unserialize, var_export;-private function dumpVar(mixed $var, array $parents = [], int $level = 0, int $column = 0): string-$hideKeys = is_int(($keys = array_keys($var))[0]) && $keys === range($keys[0], $keys[0] + count($var) - 1);-$pairs[] = $keyPart . $this->dumpVar($v, $parents, $level + 1, strlen($keyPart) + 1); // 1 = comma after item-return !str_contains($line, "\n") && $level * self::IndentLength + $column + strlen($line) <= $this->wrapLength-: "[\n$space" . $this->indentation . implode(",\n$space" . $this->indentation, $pairs) . ",\n$space]";-$tokens = preg_split('#(\.\.\.\?:?|\$\?|->\?|::\?|\\\\\?|\?\*|\?(?!\w))#', $statement, -1, PREG_SPLIT_DELIM_CAPTURE);-$pairs[] = $name . $this->dumpVar($v, [$args], 0, $column + strlen($name) + 1); // 1 = ) after args-return count($args) < 2 || (!str_contains($line, "\n") && $column + strlen($line) <= $this->wrapLength)
-36
vendor/nette/php-generator/src/PhpGenerator/EnumCase.php
-36
vendor/nette/php-generator/src/PhpGenerator/EnumCase.php
···
-148
vendor/nette/php-generator/src/PhpGenerator/EnumType.php
-148
vendor/nette/php-generator/src/PhpGenerator/EnumType.php
···-public function addCase(string $name, string|int|Literal|null $value = null, bool $overwrite = false): EnumCase-throw new Nette\InvalidStateException("Cannot add cases '$name', because it already exists.");-* Adds a member. If it already exists, throws an exception or overwrites it if $overwrite is true.-public function addMember(Method|Constant|EnumCase|TraitUse $member, bool $overwrite = false): static-throw new Nette\InvalidStateException("Cannot add member '$name', because it already exists.");
-595
vendor/nette/php-generator/src/PhpGenerator/Extractor.php
-595
vendor/nette/php-generator/src/PhpGenerator/Extractor.php
···-use function addcslashes, array_map, assert, class_exists, end, in_array, is_array, rtrim, str_contains, str_repeat, str_replace, str_starts_with, strlen, substr, substr_replace, usort;-throw new Nette\NotSupportedException("PHP-Parser is required to load method bodies, install package 'nikic/php-parser' 4.7 or newer.");-$traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver(null, ['preserveOriginalNames' => true]));-fn(Node $node) => $node instanceof Node\Stmt\ClassLike && $node->namespacedName->toString() === $className,-foreach ($nodeFinder->findInstanceOf($classNode, Node\Stmt\ClassMethod::class) as $methodNode) {-fn(Node $node) => $node instanceof Node\Stmt\ClassLike && $node->namespacedName->toString() === $className,-foreach ($nodeFinder->findInstanceOf($classNode, Node\Stmt\Property::class) as $propertyNode) {-fn(Node $node) => $node instanceof Node\Stmt\Function_ && $node->namespacedName->toString() === $name,-(new NodeFinder)->find($nodes, function (Node $node) use (&$replacements, $start, $level, $indent) {-&& in_array($node->getAttribute('kind'), [Node\Scalar\String_::KIND_SINGLE_QUOTED, Node\Scalar\String_::KIND_DOUBLE_QUOTED], true)-&& in_array($node->getAttribute('kind'), [Node\Scalar\String_::KIND_NOWDOC, Node\Scalar\String_::KIND_HEREDOC], true)-&& Helpers::unindent($node->getAttribute('docIndentation'), $level) === $node->getAttribute('docIndentation')-$node instanceof Node\Scalar\Encapsed && $node->getAttribute('kind') === Node\Scalar\String_::KIND_HEREDOC-&& Helpers::unindent($node->getAttribute('docIndentation'), $level) === $node->getAttribute('docIndentation')-$tmp = $node->getStartFilePos() - $start + strlen($node->getAttribute('docLabel')) + 3, // <<<-$node instanceof Node\Stmt\Use_ => $this->addUseToNamespace($phpFile->addNamespace($name), $node),-$prop->setVisibility($this->toVisibility($node->flags), $this->toSetterVisibility($node->flags));-$prop->setReadOnly($node->isReadonly() || ($class instanceof ClassType && $class->isReadOnly()));-private function addHooksToProperty(Property|PromotedParameter $prop, Node\Stmt\Property|Node\Param $node): void-if ($method->getName() === Method::Constructor && $class instanceof ClassType && $class->isReadOnly()) {-array_map(fn($param) => $param instanceof PromotedParameter ? $param->setReadOnly() : $param, $method->getParameters());-$node->expr instanceof Node\Scalar\LNumber, $node->expr instanceof Node\Scalar\String_ => $node->expr->value,-PhpFile|ClassLike|Constant|Property|GlobalFunction|Method|Parameter|EnumCase|TraitUse|PropertyHook $element,-private function setupFunction(GlobalFunction|Method|PropertyHook $function, Node\FunctionLike $node): void-$function->setReturnType($node->getReturnType() ? $this->toPhp($node->getReturnType()) : null);
-378
vendor/nette/php-generator/src/PhpGenerator/Factory.php
-378
vendor/nette/php-generator/src/PhpGenerator/Factory.php
···-use function array_diff, array_filter, array_key_exists, array_map, count, explode, file_get_contents, implode, is_object, is_subclass_of, method_exists, reset;-throw new Nette\NotSupportedException('The $withBodies parameter cannot be used for anonymous or internal classes or interfaces.');-$class = new InterfaceType($from->getShortName(), new PhpNamespace($from->getNamespaceName()));-$class->setImplements(array_diff($class->getImplements(), $from->getParentClass()->getInterfaceNames()));-$hookBodies ??= $this->getExtractor($declaringClass->getFileName())->extractPropertyHookBodies($declaringClass->name);-$bodies ??= $this->getExtractor($declaringClass->getFileName())->extractMethodBodies($declaringClass->name);-$method->setParameters(array_map([$this, 'fromParameterReflection'], $from->getParameters()));-public function fromFunctionReflection(\ReflectionFunction $from, bool $withBody = false): GlobalFunction|Closure-$function->setParameters(array_map([$this, 'fromParameterReflection'], $from->getParameters()));-throw new Nette\NotSupportedException('The $withBody parameter cannot be used for closures or internal functions.');-$function->setBody($this->getExtractor($from->getFileName())->extractFunctionBody($from->name));-return reset($classes) ?: throw new Nette\InvalidStateException('The code does not contain any class.');-private function getVisibility(\ReflectionProperty|\ReflectionMethod|\ReflectionClassConstant $from): Visibility
-41
vendor/nette/php-generator/src/PhpGenerator/GlobalFunction.php
-41
vendor/nette/php-generator/src/PhpGenerator/GlobalFunction.php
···-return (new Factory)->fromFunctionReflection(Nette\Utils\Callback::toReflection($function), $withBody);
-156
vendor/nette/php-generator/src/PhpGenerator/Helpers.php
-156
vendor/nette/php-generator/src/PhpGenerator/Helpers.php
···-use function is_string, preg_match, preg_replace, preg_replace_callback, str_contains, str_repeat, str_replace, strrpos, strtolower, substr, trim;-'bool' => 1, 'false' => 1, 'float' => 1, 'int' => 1, 'iterable' => 1, 'mixed' => 1, 'never' => 1, 'null' => 1,-'__halt_compiler' => 1, 'abstract' => 1, 'and' => 1, 'array' => 1, 'as' => 1, 'break' => 1, 'callable' => 1,-'case' => 1, 'catch' => 1, 'class' => 1, 'clone' => 1, 'const' => 1, 'continue' => 1, 'declare' => 1, 'default' => 1,-'die' => 1, 'do' => 1, 'echo' => 1, 'else' => 1, 'elseif' => 1, 'empty' => 1, 'enddeclare' => 1, 'endfor' => 1,-'endforeach' => 1, 'endif' => 1, 'endswitch' => 1, 'endwhile' => 1, 'eval' => 1, 'exit' => 1, 'extends' => 1,-'final' => 1, 'finally' => 1, 'fn' => 1, 'for' => 1, 'foreach' => 1, 'function' => 1, 'global' => 1, 'goto' => 1,-'if' => 1, 'implements' => 1, 'include' => 1, 'include_once' => 1, 'instanceof' => 1, 'insteadof' => 1,-'interface' => 1, 'isset' => 1, 'list' => 1, 'match' => 1, 'namespace' => 1, 'new' => 1, 'or' => 1, 'print' => 1,-'private' => 1, 'protected' => 1, 'public' => 1, 'readonly' => 1, 'require' => 1, 'require_once' => 1, 'return' => 1,-'static' => 1, 'switch' => 1, 'throw' => 1, 'trait' => 1, 'try' => 1, 'unset' => 1, 'use' => 1, 'var' => 1,-'while' => 1, 'xor' => 1, 'yield' => 1, '__CLASS__' => 1, '__DIR__' => 1, '__FILE__' => 1, '__FUNCTION__' => 1,-'__LINE__' => 1, '__METHOD__' => 1, '__NAMESPACE__' => 1, '__PROPERTY__' => 1, '__TRAIT__' => 1,-return preg_replace_callback('~/\*\(([ncf])\*/([\w\x7f-\xff\\\]++)~', function ($m) use ($namespace) {-public static function isNamespaceIdentifier(mixed $value, bool $allowLeadingSlash = false): bool-$re = '#^' . ($allowLeadingSlash ? '\\\?' : '') . self::ReIdentifier . '(\\\\' . self::ReIdentifier . ')*$#D';
-95
vendor/nette/php-generator/src/PhpGenerator/InterfaceType.php
-95
vendor/nette/php-generator/src/PhpGenerator/InterfaceType.php
···-* Adds a member. If it already exists, throws an exception or overwrites it if $overwrite is true.-throw new Nette\InvalidStateException("Cannot add member '$name', because it already exists.");-throw new Nette\InvalidStateException("Property {$this->getName()}::\${$property->getName()}: Interface cannot have initialized properties.");-throw new Nette\InvalidStateException("Property {$this->getName()}::\${$property->getName()}: Interface cannot have properties without hooks.");
-49
vendor/nette/php-generator/src/PhpGenerator/Literal.php
-49
vendor/nette/php-generator/src/PhpGenerator/Literal.php
···
-115
vendor/nette/php-generator/src/PhpGenerator/Method.php
-115
vendor/nette/php-generator/src/PhpGenerator/Method.php
···-public function addPromotedParameter(string $name, mixed $defaultValue = null): PromotedParameter-throw new Nette\InvalidStateException("Method $this->name() cannot be abstract and final or private at the same time.");
-96
vendor/nette/php-generator/src/PhpGenerator/Parameter.php
-96
vendor/nette/php-generator/src/PhpGenerator/Parameter.php
···
-193
vendor/nette/php-generator/src/PhpGenerator/PhpFile.php
-193
vendor/nette/php-generator/src/PhpGenerator/PhpFile.php
···-public function addUse(string $name, ?string $alias = null, string $of = PhpNamespace::NameNormal): static
-16
vendor/nette/php-generator/src/PhpGenerator/PhpLiteral.php
-16
vendor/nette/php-generator/src/PhpGenerator/PhpLiteral.php
···
-412
vendor/nette/php-generator/src/PhpGenerator/PhpNamespace.php
-412
vendor/nette/php-generator/src/PhpGenerator/PhpNamespace.php
···-public function addUse(string $name, ?string $alias = null, string $of = self::NameNormal): static-throw new Nette\InvalidArgumentException("Value '$name' is not valid class/function/constant name.");-} elseif ($alias && (!Helpers::isIdentifier($alias) || isset(Helpers::Keywords[strtolower($alias)]))) {-$used = [self::NameNormal => $this->classes, self::NameFunction => $this->functions, self::NameConstant => []][$of];-} while ((isset($aliases[$lower]) && strcasecmp($aliases[$lower], $name) !== 0) || isset($used[$lower]));-throw new Nette\InvalidStateException("Name '$alias' used already for '$this->name\\{$used[$lower]->getName()}'.");-uasort($this->aliases[$of], fn(string $a, string $b): int => strtr($a, '\\', ' ') <=> strtr($b, '\\', ' '));-fn($name, $alias) => (bool) strcasecmp(($this->name ? $this->name . '\\' : '') . $alias, $name),-?? $this->resolveName(Helpers::extractNamespace($name) . '\\') . Helpers::extractShortName($name);-return preg_replace_callback('~[\w\x7f-\xff\\\]+~', fn($m) => $this->simplifyName($m[0], $of), $type);-return $this->simplifyName(Helpers::extractNamespace($name) . '\\') . Helpers::extractShortName($name);-return $this->classes[strtolower($name)] ?? throw new Nette\InvalidArgumentException("Class '$name' not found.");-} elseif ($orig = array_change_key_case($this->aliases[self::NameFunction])[$lower] ?? null) {-return $this->functions[strtolower($name)] ?? throw new Nette\InvalidArgumentException("Function '$name' not found.");
-543
vendor/nette/php-generator/src/PhpGenerator/Printer.php
-543
vendor/nette/php-generator/src/PhpGenerator/Printer.php
···-use function array_filter, array_map, count, end, get_debug_type, implode, is_scalar, ltrim, preg_replace, rtrim, str_contains, str_repeat, str_replace, strlen, substr;-public function printFunction(GlobalFunction $function, ?PhpNamespace $namespace = null): string-$params = $this->printParameters($function, strlen($line) + strlen($returnType) + 2); // 2 = parentheses-throw new Nette\InvalidArgumentException('Arrow function cannot bind variables by-reference.');-public function printMethod(Method $method, ?PhpNamespace $namespace = null, bool $isInterface = false): string-$params = $this->printParameters($method, strlen($line) + strlen($returnType) + strlen($this->indentation) + 2);-private function printFunctionBody(Closure|GlobalFunction|Method|PropertyHook $function): string-if ($class instanceof ClassType || $class instanceof TraitType || $class instanceof EnumType) {-array_map(fn($param) => $param instanceof PromotedParameter ? $param->setReadOnly(false) : null, $method->getParameters());-if ($class instanceof ClassType || $class instanceof TraitType || $class instanceof InterfaceType) {-$properties[] = $this->printProperty($property, $readOnlyClass, $class instanceof InterfaceType);-$class instanceof EnumType => 'enum ' . $class->getName() . ($enumType ? $this->returnTypeColon . $enumType : ''),-$line[] = ($class instanceof ClassType || $class instanceof InterfaceType) && $class->getExtends()-$line[] = ($class instanceof ClassType || $class instanceof EnumType) && $class->getImplements()-protected function printUses(PhpNamespace $namespace, string $of = PhpNamespace::NameNormal): string-protected function printParameters(Closure|GlobalFunction|Method|PropertyHook $function, int $column = 0): string-$special = $special || $param instanceof PromotedParameter || $param->getAttributes() || $param->getComment();-if (!$special || ($this->singleParameterOnOneLine && count($function->getParameters()) === 1)) {-private function formatParameters(Closure|GlobalFunction|Method|PropertyHook $function, bool $multiline): string-$variadic = !$function instanceof PropertyHook && $function->isVariadic() && $param === end($params);-. ($param->hasDefaultValue() && !$variadic ? ' = ' . $this->dump($param->getDefaultValue()) : '')-private function printProperty(Property $property, bool $readOnlyClass = false, bool $isInterface = false): string-$items[] = $this->printType($attr->getName(), nullable: false) . ($args === '' ? '' : "($args)");-private function printHooks(Property|PromotedParameter $property, bool $isInterface = false): string
-35
vendor/nette/php-generator/src/PhpGenerator/PromotedParameter.php
-35
vendor/nette/php-generator/src/PhpGenerator/PromotedParameter.php
···-throw new Nette\InvalidStateException("Property \${$this->getName()}: Read-only properties are only supported on typed property.");
-138
vendor/nette/php-generator/src/PhpGenerator/Property.php
-138
vendor/nette/php-generator/src/PhpGenerator/Property.php
···-throw new Nette\InvalidStateException("Property \$$this->name: Read-only properties are only supported on typed property.");-throw new Nette\InvalidStateException("Property \$$this->name cannot be abstract and final at the same time.");-throw new Nette\InvalidStateException("Property \$$this->name: Abstract property must have at least one abstract hook.");
-20
vendor/nette/php-generator/src/PhpGenerator/PropertyAccessMode.php
-20
vendor/nette/php-generator/src/PhpGenerator/PropertyAccessMode.php
···
-129
vendor/nette/php-generator/src/PhpGenerator/PropertyHook.php
-129
vendor/nette/php-generator/src/PhpGenerator/PropertyHook.php
···
-20
vendor/nette/php-generator/src/PhpGenerator/PropertyHookType.php
-20
vendor/nette/php-generator/src/PhpGenerator/PropertyHookType.php
···
-27
vendor/nette/php-generator/src/PhpGenerator/PsrPrinter.php
-27
vendor/nette/php-generator/src/PhpGenerator/PsrPrinter.php
···
-54
vendor/nette/php-generator/src/PhpGenerator/TraitType.php
-54
vendor/nette/php-generator/src/PhpGenerator/TraitType.php
···-* Adds a member. If it already exists, throws an exception or overwrites it if $overwrite is true.-public function addMember(Method|Property|Constant|TraitUse $member, bool $overwrite = false): static-throw new Nette\InvalidStateException("Cannot add member '$name', because it already exists.");
-49
vendor/nette/php-generator/src/PhpGenerator/TraitUse.php
-49
vendor/nette/php-generator/src/PhpGenerator/TraitUse.php
···
-49
vendor/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php
-49
vendor/nette/php-generator/src/PhpGenerator/Traits/AttributeAware.php
···
-49
vendor/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php
-49
vendor/nette/php-generator/src/PhpGenerator/Traits/CommentAware.php
···
-79
vendor/nette/php-generator/src/PhpGenerator/Traits/ConstantsAware.php
-79
vendor/nette/php-generator/src/PhpGenerator/Traits/ConstantsAware.php
···-return $this->consts[$name] ?? throw new Nette\InvalidArgumentException("Constant '$name' not found.");-* Adds a constant. If it already exists, throws an exception or overwrites it if $overwrite is true.-throw new Nette\InvalidStateException("Cannot add constant '$name', because it already exists.");
-179
vendor/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php
-179
vendor/nette/php-generator/src/PhpGenerator/Traits/FunctionLike.php
···-return $this->parameters[$name] ?? throw new Nette\InvalidArgumentException("Parameter '$name' not found.");
-89
vendor/nette/php-generator/src/PhpGenerator/Traits/MethodsAware.php
-89
vendor/nette/php-generator/src/PhpGenerator/Traits/MethodsAware.php
···-return $this->methods[strtolower($name)] ?? throw new Nette\InvalidArgumentException("Method '$name' not found.");-* Adds a method. If it already exists, throws an exception or overwrites it if $overwrite is true.-throw new Nette\InvalidStateException("Cannot add method '$name', because it already exists.");
-48
vendor/nette/php-generator/src/PhpGenerator/Traits/NameAware.php
-48
vendor/nette/php-generator/src/PhpGenerator/Traits/NameAware.php
···
-82
vendor/nette/php-generator/src/PhpGenerator/Traits/PropertiesAware.php
-82
vendor/nette/php-generator/src/PhpGenerator/Traits/PropertiesAware.php
···-return $this->properties[$name] ?? throw new Nette\InvalidArgumentException("Property '$name' not found.");-* Adds a property. If it already exists, throws an exception or overwrites it if $overwrite is true.-public function addProperty(string $name, mixed $value = null, bool $overwrite = false): Property-throw new Nette\InvalidStateException("Cannot add property '$name', because it already exists.");
-160
vendor/nette/php-generator/src/PhpGenerator/Traits/PropertyLike.php
-160
vendor/nette/php-generator/src/PhpGenerator/Traits/PropertyLike.php
···-public function setVisibility(Visibility|string|null $get, Visibility|string|null $set = null): static-public function getVisibility(PropertyAccessMode|string $mode = PropertyAccessMode::Get): ?string-public function setProtected(PropertyAccessMode|string $mode = PropertyAccessMode::Get): static
-78
vendor/nette/php-generator/src/PhpGenerator/Traits/TraitsAware.php
-78
vendor/nette/php-generator/src/PhpGenerator/Traits/TraitsAware.php
···-trigger_error('Passing second argument to ' . __METHOD__ . '() is deprecated, use addResolution() instead.');
-75
vendor/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php
-75
vendor/nette/php-generator/src/PhpGenerator/Traits/VisibilityAware.php
···
-123
vendor/nette/php-generator/src/PhpGenerator/Type.php
-123
vendor/nette/php-generator/src/PhpGenerator/Type.php
···
-21
vendor/nette/php-generator/src/PhpGenerator/Visibility.php
-21
vendor/nette/php-generator/src/PhpGenerator/Visibility.php
···
+8
-1
vite.config.js
+8
-1
vite.config.js
······