diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..9c0da1f --- /dev/null +++ b/composer.lock @@ -0,0 +1,242 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "d46473bf312a4fe30468e80ebd435221", + "packages": [ + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/yaml", + "version": "v5.4.44", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "7025b964f123bbf1896d7563db6ec7f1f63e918a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7025b964f123bbf1896d7563db6ec7f1f63e918a", + "reference": "7025b964f123bbf1896d7563db6ec7f1f63e918a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.3" + }, + "require-dev": { + "symfony/console": "^5.3|^6.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.4.44" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-16T14:36:56+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=7.4" + }, + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/src/helpers.php b/src/helpers.php index 9aef61d..e869f4b 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -3,7 +3,12 @@ if (!function_exists('wpkirk_toc')) { /** - * Table of Contents + * Generates a Table of Contents (TOC) based on the sections in the buffer. + * + * This function scans the output buffer for section headers and generates a TOC. + * The TOC is then displayed at the beginning of the content. + * + * @return void */ function wpkirk_toc() { @@ -35,7 +40,14 @@ function wpkirk_toc() if (!function_exists('wpkirk_output')) { /** - * Output + * Outputs the result of a function within a details HTML element. + * + * This function executes the provided function and displays its output + * within a details HTML element. The output is formatted based on the specified language. + * + * @param callable|string $func The function to execute or the code to evaluate. + * @param string $language The language for syntax highlighting (default: 'json'). + * @return void */ function wpkirk_output($func, $language = 'json') { @@ -50,7 +62,14 @@ function wpkirk_output($func, $language = 'json') if (!function_exists('wpkirk_section')) { /** - * Section + * Outputs a section header with the specified ID and content. + * + * This function generates an H2 header with the specified ID and content. + * The content can be a string or a callable function. + * + * @param string $id The ID for the section header. + * @param string|callable $strFunc The content for the section header. + * @return void */ function wpkirk_section($id, $strFunc) { @@ -68,7 +87,14 @@ function wpkirk_section($id, $strFunc) if (!function_exists('wpkirk_code')) { /** - * Code + * Outputs code within a preformatted code block. + * + * This function displays the provided code within a preformatted code block + * with syntax highlighting based on the specified language. + * + * @param string $language The language for syntax highlighting (default: 'php'). + * @param string $func The code to display. + * @return void */ function wpkirk_code($language = 'php', $func = '') { @@ -81,7 +107,15 @@ function wpkirk_code($language = 'php', $func = '') if (!function_exists('wpkirk_execute_code')) { /** - * Execute Code + * Executes the provided code and outputs the result within a preformatted code block. + * + * This function executes the provided code (either a callable function or a string) + * and displays the result within a preformatted code block with syntax highlighting + * based on the specified language. + * + * @param string $language The language for syntax highlighting (default: 'php'). + * @param callable|string $func The function to execute or the code to evaluate. + * @return void */ function wpkirk_execute_code($language = 'php', $func = '') {