From 7449faaa76a5b4008fd51a6562cca2e0a852ea6b Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 1 May 2020 17:33:13 +0200 Subject: Clean up code and improve documentation This switches the code documentation genarator (we're now using phpdoc instead of NaturalDoc). Also various small code cleanup tasks: - Remove unused code - Get rid of `and` / `or`, we're using `&&` / `||` now - Adding missing return values - Helping PhpStorm to detect some dynamically called functions (mark_builtin_callable in Transcompiler) - Reword transcompiling => compiling in documentation --- .gitignore | 1 + README.markdown | 2 +- composer.json | 7 +- composer.lock | 3052 +++++++++++++++++++++++++++++++++++ docu/README | 5 +- docu/index.html | 2 +- docu/language_definition.html | 80 +- example/index.php | 2 +- mkdocu.sh | 12 +- src/ste/ASTNode.php | 8 + src/ste/Calc.php | 48 +- src/ste/CantLoadTemplate.php | 8 +- src/ste/CantSaveTemplate.php | 8 +- src/ste/FatalRuntimeError.php | 6 +- src/ste/FilesystemStorageAccess.php | 28 +- src/ste/Misc.php | 4 + src/ste/ParseCompileError.php | 8 +- src/ste/Parser.php | 114 +- src/ste/RuntimeError.php | 8 +- src/ste/STECore.php | 177 +- src/ste/STEStandardLibrary.php | 74 + src/ste/Scope.php | 39 + src/ste/StorageAccess.php | 51 +- src/ste/TagNode.php | 11 + src/ste/TextNode.php | 7 + src/ste/Transcompiler.php | 181 ++- src/ste/VariableNode.php | 13 +- tests/dump_ast.php | 1 + 28 files changed, 3699 insertions(+), 258 deletions(-) create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 234ce20..f7e841f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vendor .php_cs.cache +docu/phpdoc/ diff --git a/README.markdown b/README.markdown index ec1379f..a48eeec 100644 --- a/README.markdown +++ b/README.markdown @@ -26,7 +26,7 @@ Why should you use it? * It has a simple, yet powerful plugin interface. You can easily define your own template functions / tags. It is even possible to write them in the template language itself, which makes it kind of a programming language... -* It can transcompile templates into PHP. +* It can compile templates into PHP. * You can use anonymous functions to define custom tags. Documentation diff --git a/composer.json b/composer.json index 54edefd..c530140 100644 --- a/composer.json +++ b/composer.json @@ -20,5 +20,8 @@ "description": "A compiling template engine with an XML-ish syntax", "type": "library", "keywords": ["templating"], - "homepage": "http://github.com/silvasur/ste" -} \ No newline at end of file + "homepage": "http://github.com/silvasur/ste", + "require-dev": { + "phpdocumentor/phpdocumentor": "^2.9" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..b14f168 --- /dev/null +++ b/composer.lock @@ -0,0 +1,3052 @@ +{ + "_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": "f45ad110a19695736796a2738838799d", + "packages": [], + "packages-dev": [ + { + "name": "cilex/cilex", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Cilex/Cilex.git", + "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Cilex/Cilex/zipball/7acd965a609a56d0345e8b6071c261fbdb926cb5", + "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5", + "shasum": "" + }, + "require": { + "cilex/console-service-provider": "1.*", + "php": ">=5.3.3", + "pimple/pimple": "~1.0", + "symfony/finder": "~2.1", + "symfony/process": "~2.1" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*", + "symfony/validator": "~2.1" + }, + "suggest": { + "monolog/monolog": ">=1.0.0", + "symfony/validator": ">=1.0.0", + "symfony/yaml": ">=1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Cilex": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "description": "The PHP micro-framework for Command line tools based on the Symfony2 Components", + "homepage": "http://cilex.github.com", + "keywords": [ + "cli", + "microframework" + ], + "time": "2014-03-29T14:03:13+00:00" + }, + { + "name": "cilex/console-service-provider", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/Cilex/console-service-provider.git", + "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Cilex/console-service-provider/zipball/25ee3d1875243d38e1a3448ff94bdf944f70d24e", + "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "pimple/pimple": "1.*@dev", + "symfony/console": "~2.1" + }, + "require-dev": { + "cilex/cilex": "1.*@dev", + "silex/silex": "1.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Cilex\\Provider\\Console": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "description": "Console Service Provider", + "keywords": [ + "cilex", + "console", + "pimple", + "service-provider", + "silex" + ], + "time": "2012-12-19T10:50:58+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.2.7", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-04-08T08:27:21+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "doctrine/annotations", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "b9d758e831c70751155c698c2f7df4665314a1cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/b9d758e831c70751155c698c2f7df4665314a1cb", + "reference": "b9d758e831c70751155c698c2f7df4665314a1cb", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^7.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2020-04-20T09:18:32+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2019-10-21T16:45:58+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "time": "2019-10-30T14:39:59+00:00" + }, + { + "name": "erusev/parsedown", + "version": "1.7.4", + "source": { + "type": "git", + "url": "https://github.com/erusev/parsedown.git", + "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3", + "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35" + }, + "type": "library", + "autoload": { + "psr-0": { + "Parsedown": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Emanuil Rusev", + "email": "hello@erusev.com", + "homepage": "http://erusev.com" + } + ], + "description": "Parser for Markdown.", + "homepage": "http://parsedown.org", + "keywords": [ + "markdown", + "parser" + ], + "time": "2019-12-30T22:54:17+00:00" + }, + { + "name": "jms/metadata", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/metadata.git", + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/e5854ab1aa643623dc64adde718a8eec32b957a8", + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "doctrine/cache": "~1.0", + "symfony/cache": "~3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Metadata\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Class/method/property metadata management in PHP", + "keywords": [ + "annotations", + "metadata", + "xml", + "yaml" + ], + "time": "2018-10-26T12:40:10+00:00" + }, + { + "name": "jms/parser-lib", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/parser-lib.git", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "shasum": "" + }, + "require": { + "phpoption/phpoption": ">=0.9,<2.0-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "description": "A library for easily creating recursive-descent parsers.", + "time": "2012-11-18T18:08:43+00:00" + }, + { + "name": "jms/serializer", + "version": "1.7.1", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/serializer.git", + "reference": "4fad8bbbe76e05de3b79ffa3db027058ed3813ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/4fad8bbbe76e05de3b79ffa3db027058ed3813ff", + "reference": "4fad8bbbe76e05de3b79ffa3db027058ed3813ff", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/instantiator": "^1.0.3", + "jms/metadata": "~1.1", + "jms/parser-lib": "1.*", + "php": ">=5.5.0", + "phpcollection/phpcollection": "~0.1", + "phpoption/phpoption": "^1.1" + }, + "conflict": { + "jms/serializer-bundle": "<1.2.1", + "twig/twig": "<1.12" + }, + "require-dev": { + "doctrine/orm": "~2.1", + "doctrine/phpcr-odm": "^1.3|^2.0", + "ext-pdo_sqlite": "*", + "jackalope/jackalope-doctrine-dbal": "^1.1.5", + "phpunit/phpunit": "^4.8|^5.0", + "propel/propel1": "~1.7", + "symfony/expression-language": "^2.6|^3.0", + "symfony/filesystem": "^2.1", + "symfony/form": "~2.1|^3.0", + "symfony/translation": "^2.1|^3.0", + "symfony/validator": "^2.2|^3.0", + "symfony/yaml": "^2.1|^3.0", + "twig/twig": "~1.12|~2.0" + }, + "suggest": { + "doctrine/cache": "Required if you like to use cache functionality.", + "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.", + "symfony/yaml": "Required if you'd like to serialize data to YAML format." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\Serializer": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", + "homepage": "http://jmsyst.com/libs/serializer", + "keywords": [ + "deserialization", + "jaxb", + "json", + "serialization", + "xml" + ], + "time": "2017-05-15T08:35:42+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.25.3", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "fa82921994db851a8becaf3787a9e73c5976b6f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fa82921994db851a8becaf3787a9e73c5976b6f1", + "reference": "fa82921994db851a8becaf3787a9e73c5976b6f1", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2019-12-20T14:15:16+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", + "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "files": [ + "lib/bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2015-09-19T14:15:08+00:00" + }, + { + "name": "padraic/humbug_get_contents", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/humbug/file_get_contents.git", + "reference": "dcb086060c9dd6b2f51d8f7a895500307110b7a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/humbug/file_get_contents/zipball/dcb086060c9dd6b2f51d8f7a895500307110b7a7", + "reference": "dcb086060c9dd6b2f51d8f7a895500307110b7a7", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "ext-openssl": "*", + "php": "^5.3 || ^7.0 || ^7.1 || ^7.2" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.1", + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": false + }, + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Humbug\\": "src/" + }, + "files": [ + "src/function.php", + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Théo Fidry", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Secure wrapper for accessing HTTPS resources with file_get_contents for PHP 5.3+", + "homepage": "https://github.com/padraic/file_get_contents", + "keywords": [ + "download", + "file_get_contents", + "http", + "https", + "ssl", + "tls" + ], + "time": "2018-02-12T18:47:17+00:00" + }, + { + "name": "padraic/phar-updater", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/humbug/phar-updater.git", + "reference": "d01d3b8f26e541ac9b9eeba1e18d005d852f7ff1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/humbug/phar-updater/zipball/d01d3b8f26e541ac9b9eeba1e18d005d852f7ff1", + "reference": "d01d3b8f26e541ac9b9eeba1e18d005d852f7ff1", + "shasum": "" + }, + "require": { + "padraic/humbug_get_contents": "^1.0", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Humbug\\SelfUpdate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + } + ], + "description": "A thing to make PHAR self-updating easy and secure.", + "keywords": [ + "humbug", + "phar", + "self-update", + "update" + ], + "time": "2018-03-30T12:52:15+00:00" + }, + { + "name": "phpcollection/phpcollection", + "version": "0.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-collection.git", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "shasum": "" + }, + "require": { + "phpoption/phpoption": "1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4-dev" + } + }, + "autoload": { + "psr-0": { + "PhpCollection": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "General-Purpose Collection Library for PHP", + "keywords": [ + "collection", + "list", + "map", + "sequence", + "set" + ], + "time": "2015-05-17T12:39:23+00:00" + }, + { + "name": "phpdocumentor/fileset", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/Fileset.git", + "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/Fileset/zipball/bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0", + "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/finder": "~2.1" + }, + "require-dev": { + "phpunit/phpunit": "~3.7" + }, + "type": "library", + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Fileset component for collecting a set of files given directories and file paths", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "files", + "fileset", + "phpdoc" + ], + "time": "2013-08-06T21:07:42+00:00" + }, + { + "name": "phpdocumentor/graphviz", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/GraphViz.git", + "reference": "a906a90a9f230535f25ea31caf81b2323956283f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/a906a90a9f230535f25ea31caf81b2323956283f", + "reference": "a906a90a9f230535f25ea31caf81b2323956283f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-02-02T13:00:08+00:00" + }, + { + "name": "phpdocumentor/phpdocumentor", + "version": "v2.9.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/phpDocumentor.git", + "reference": "2e4f981a55ebe6f5db592d7da892d13d5b3c7816" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/phpDocumentor/zipball/2e4f981a55ebe6f5db592d7da892d13d5b3c7816", + "reference": "2e4f981a55ebe6f5db592d7da892d13d5b3c7816", + "shasum": "" + }, + "require": { + "cilex/cilex": "~1.0", + "erusev/parsedown": "~1.0", + "jms/serializer": ">=0.12 < 1.8.0", + "monolog/monolog": "~1.6", + "padraic/phar-updater": "^1.0", + "php": ">=5.3.3", + "phpdocumentor/fileset": "~1.0", + "phpdocumentor/graphviz": "~1.0", + "phpdocumentor/reflection": "^3.0", + "phpdocumentor/reflection-docblock": "~2.0", + "symfony/config": "~2.3", + "symfony/console": "~2.3", + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.0", + "symfony/stopwatch": "~2.3", + "symfony/validator": "~2.2", + "twig/twig": "~1.3", + "webmozart/assert": "^1.2", + "zendframework/zend-cache": "~2.1", + "zendframework/zend-config": "~2.1", + "zendframework/zend-filter": "~2.1", + "zendframework/zend-i18n": "~2.1", + "zendframework/zend-serializer": "~2.1", + "zendframework/zend-servicemanager": "~2.1", + "zendframework/zend-stdlib": "~2.1", + "zetacomponents/document": ">=1.3.1" + }, + "require-dev": { + "behat/behat": "^3.0", + "mikey179/vfsstream": "~1.2", + "mockery/mockery": "^0.9@dev", + "phpunit/phpunit": "^4.0", + "squizlabs/php_codesniffer": "^1.4", + "symfony/expression-language": "^2.4" + }, + "suggest": { + "ext-twig": "Enabling the twig extension improves the generation of twig based templates.", + "ext-xslcache": "Enabling the XSLCache extension improves the generation of xml based templates." + }, + "bin": [ + "bin/phpdoc.php", + "bin/phpdoc" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.9-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/" + ], + "Cilex\\Provider": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Documentation Generator for PHP", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "api", + "application", + "dga", + "documentation", + "phpdoc" + ], + "time": "2020-01-12T19:44:16+00:00" + }, + { + "name": "phpdocumentor/reflection", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/Reflection.git", + "reference": "793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d", + "reference": "793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^1.0", + "php": ">=5.3.3", + "phpdocumentor/reflection-docblock": "~2.0", + "psr/log": "~1.0" + }, + "require-dev": { + "behat/behat": "~2.4", + "mockery/mockery": "~0.8", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/", + "tests/mocks/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Reflection library to do Static Analysis for PHP Projects", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2016-05-21T08:42:32+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-01-25T08:17:30+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.7.3", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "4acfd6a4b33a509d8c88f50e5222f734b6aeebae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/4acfd6a4b33a509d8c88f50e5222f734b6aeebae", + "reference": "4acfd6a4b33a509d8c88f50e5222f734b6aeebae", + "shasum": "" + }, + "require": { + "php": "^5.5.9 || ^7.0 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.3", + "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "time": "2020-03-21T18:07:53+00:00" + }, + { + "name": "pimple/pimple", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2013-11-22T08:30:29+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "symfony/config", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "7dd5f5040dc04c118d057fb5886563963eb70011" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/7dd5f5040dc04c118d057fb5886563963eb70011", + "reference": "7dd5f5040dc04c118d057fb5886563963eb70011", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/filesystem": "~2.3|~3.0.0", + "symfony/polyfill-ctype": "~1.8" + }, + "require-dev": { + "symfony/yaml": "~2.7|~3.0.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "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": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-11-26T09:38:12+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "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": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-11-20T15:55:20+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "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": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2016-07-30T07:22:48+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "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": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-11-21T14:20:20+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2da5009d9bacbd91d83486aa1f44c793a8c380d", + "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "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": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2016-07-20T05:43:46+00:00" + }, + { + "name": "symfony/finder", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "1444eac52273e345d9b95129bf914639305a9ba4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/1444eac52273e345d9b95129bf914639305a9ba4", + "reference": "1444eac52273e345d9b95129bf914639305a9ba4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "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": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "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" + ], + "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": "2020-02-27T09:26:54+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.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": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "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": "2020-03-09T19:04:49+00:00" + }, + { + "name": "symfony/process", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/c3591a09c78639822b0b290d44edb69bf9f05dc8", + "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "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": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "752586c80af8a85aeb74d1ae8202411c68836663" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/752586c80af8a85aeb74d1ae8202411c68836663", + "reference": "752586c80af8a85aeb74d1ae8202411c68836663", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "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": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/translation", + "version": "v3.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "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": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2016-07-30T07:22:48+00:00" + }, + { + "name": "symfony/validator", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/d5d2090bba3139d8ddb79959fbf516e87238fe3a", + "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~2.4|~3.0.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.1", + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.4|~3.0.0", + "symfony/http-foundation": "~2.3|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/property-access": "~2.3|~3.0.0", + "symfony/yaml": "^2.0.5|~3.0.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.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "symfony/config": "", + "symfony/expression-language": "For using the 2.4 Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For using the 2.4 Validator API", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "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": "Symfony Validator Component", + "homepage": "https://symfony.com", + "time": "2018-11-14T14:06:48+00:00" + }, + { + "name": "twig/twig", + "version": "v1.42.5", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", + "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.42-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "time": "2020-02-11T05:59:23+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2020-04-18T12:12:48+00:00" + }, + { + "name": "zendframework/zend-cache", + "version": "2.8.3", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-cache.git", + "reference": "edde41f1ee5c28e01701a032f434d03751b65df4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/edde41f1ee5c28e01701a032f434d03751b65df4", + "reference": "edde41f1ee5c28e01701a032f434d03751b65df4", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "zendframework/zend-eventmanager": "^2.6.3 || ^3.2", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "provide": { + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" + }, + "require-dev": { + "cache/integration-tests": "^0.16", + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-serializer": "^2.6", + "zendframework/zend-session": "^2.7.4" + }, + "suggest": { + "ext-apc": "APC or compatible extension, to use the APC storage adapter", + "ext-apcu": "APCU >= 5.1.0, to use the APCu storage adapter", + "ext-dba": "DBA, to use the DBA storage adapter", + "ext-memcache": "Memcache >= 2.0.0 to use the Memcache storage adapter", + "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", + "ext-mongo": "Mongo, to use MongoDb storage adapter", + "ext-mongodb": "MongoDB, to use the ExtMongoDb storage adapter", + "ext-redis": "Redis, to use Redis storage adapter", + "ext-wincache": "WinCache, to use the WinCache storage adapter", + "ext-xcache": "XCache, to use the XCache storage adapter", + "mongodb/mongodb": "Required for use with the ext-mongodb adapter", + "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-session": "Zend\\Session component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" + }, + "zf": { + "component": "Zend\\Cache", + "config-provider": "Zend\\Cache\\ConfigProvider" + } + }, + "autoload": { + "files": [ + "autoload/patternPluginManagerPolyfill.php" + ], + "psr-4": { + "Zend\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output", + "keywords": [ + "ZendFramework", + "cache", + "psr-16", + "psr-6", + "zf" + ], + "abandoned": "laminas/laminas-cache", + "time": "2019-08-28T21:34:32+00:00" + }, + { + "name": "zendframework/zend-config", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-config.git", + "reference": "2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-config/zipball/2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d", + "reference": "2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-i18n": "^2.5", + "zendframework/zend-json": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", + "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Config\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "homepage": "https://github.com/zendframework/zend-config", + "keywords": [ + "config", + "zf2" + ], + "abandoned": "laminas/laminas-config", + "time": "2016-02-04T23:01:10+00:00" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "abandoned": "laminas/laminas-eventmanager", + "time": "2018-04-25T15:33:34+00:00" + }, + { + "name": "zendframework/zend-filter", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-filter.git", + "reference": "d78f2cdde1c31975e18b2a0753381ed7b61118ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/d78f2cdde1c31975e18b2a0753381ed7b61118ef", + "reference": "d78f2cdde1c31975e18b2a0753381ed7b61118ef", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "conflict": { + "zendframework/zend-validator": "<2.10.1" + }, + "require-dev": { + "pear/archive_tar": "^1.4.3", + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "psr/http-factory": "^1.0", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-crypt": "^3.2.1", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-uri": "^2.6" + }, + "suggest": { + "psr/http-factory-implementation": "psr/http-factory-implementation, for creating file upload instances when consuming PSR-7 in file upload filters", + "zendframework/zend-crypt": "Zend\\Crypt component, for encryption filters", + "zendframework/zend-i18n": "Zend\\I18n component for filters depending on i18n functionality", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for using the filter chain functionality", + "zendframework/zend-uri": "Zend\\Uri component, for the UriNormalize filter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" + }, + "zf": { + "component": "Zend\\Filter", + "config-provider": "Zend\\Filter\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Filter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Programmatically filter and normalize data and files", + "keywords": [ + "ZendFramework", + "filter", + "zf" + ], + "abandoned": "laminas/laminas-filter", + "time": "2019-08-19T07:08:04+00:00" + }, + { + "name": "zendframework/zend-hydrator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-hydrator.git", + "reference": "22652e1661a5a10b3f564cf7824a2206cf5a4a65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/22652e1661a5a10b3f564cf7824a2206cf5a4a65", + "reference": "22652e1661a5a10b3f564cf7824a2206cf5a4a65", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.0@dev", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-inputfilter": "^2.6", + "zendframework/zend-serializer": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0, to support aggregate hydrator usage", + "zendframework/zend-filter": "^2.6, to support naming strategy hydrator usage", + "zendframework/zend-serializer": "^2.6.1, to use the SerializableStrategy", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3, to support hydrator plugin manager usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-release-1.0": "1.0-dev", + "dev-release-1.1": "1.1-dev", + "dev-master": "2.0-dev", + "dev-develop": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Hydrator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-hydrator", + "keywords": [ + "hydrator", + "zf2" + ], + "abandoned": "laminas/laminas-hydrator", + "time": "2016-02-18T22:38:26+00:00" + }, + { + "name": "zendframework/zend-i18n", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-i18n.git", + "reference": "e17a54b3aee333ab156958f570cde630acee8b07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/e17a54b3aee333ab156958f570cde630acee8b07", + "reference": "e17a54b3aee333ab156958f570cde630acee8b07", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.6", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-filter": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-validator": "^2.6", + "zendframework/zend-view": "^2.6.3" + }, + "suggest": { + "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", + "zendframework/zend-cache": "Zend\\Cache component", + "zendframework/zend-config": "Zend\\Config component", + "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", + "zendframework/zend-filter": "You should install this package to use the provided filters", + "zendframework/zend-i18n-resources": "Translation resources", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-validator": "You should install this package to use the provided validators", + "zendframework/zend-view": "You should install this package to use the provided view helpers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" + }, + "zf": { + "component": "Zend\\I18n", + "config-provider": "Zend\\I18n\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\I18n\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Provide translations for your application, and filter and validate internationalized values", + "keywords": [ + "ZendFramework", + "i18n", + "zf" + ], + "abandoned": "laminas/laminas-i18n", + "time": "2019-09-30T12:04:37+00:00" + }, + { + "name": "zendframework/zend-json", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-json.git", + "reference": "e9ddb1192d93fe7fff846ac895249c39db75132b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/e9ddb1192d93fe7fff846ac895249c39db75132b", + "reference": "e9ddb1192d93fe7fff846ac895249c39db75132b", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "suggest": { + "zendframework/zend-json-server": "For implementing JSON-RPC servers", + "zendframework/zend-xml2json": "For converting XML documents to JSON" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev", + "dev-develop": "3.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Json\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "keywords": [ + "ZendFramework", + "json", + "zf" + ], + "abandoned": "laminas/laminas-json", + "time": "2019-10-09T13:56:13+00:00" + }, + { + "name": "zendframework/zend-serializer", + "version": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-serializer.git", + "reference": "6fb7ae016cfdf0cfcdfa2b989e6a65f351170e21" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/6fb7ae016cfdf0cfcdfa2b989e6a65f351170e21", + "reference": "6fb7ae016cfdf0cfcdfa2b989e6a65f351170e21", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-json": "^2.5 || ^3.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-math": "^2.6 || ^3.0", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-math": "(^2.6 || ^3.0) To support Python Pickle serialization", + "zendframework/zend-servicemanager": "(^2.7.5 || ^3.0.3) To support plugin manager support" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" + }, + "zf": { + "component": "Zend\\Serializer", + "config-provider": "Zend\\Serializer\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Serializer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Serialize and deserialize PHP structures to a variety of representations", + "keywords": [ + "ZendFramework", + "serializer", + "zf" + ], + "abandoned": "laminas/laminas-serializer", + "time": "2019-10-19T08:06:30+00:00" + }, + { + "name": "zendframework/zend-servicemanager", + "version": "2.7.11", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-servicemanager.git", + "reference": "99ec9ed5d0f15aed9876433c74c2709eb933d4c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/99ec9ed5d0f15aed9876433c74c2709eb933d4c7", + "reference": "99ec9ed5d0f15aed9876433c74c2709eb933d4c7", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "~1.0", + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "dev-master", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-di": "~2.5", + "zendframework/zend-mvc": "~2.5" + }, + "suggest": { + "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services", + "zendframework/zend-di": "Zend\\Di component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\ServiceManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-servicemanager", + "keywords": [ + "servicemanager", + "zf2" + ], + "abandoned": "laminas/laminas-servicemanager", + "time": "2018-06-22T14:49:54+00:00" + }, + { + "name": "zendframework/zend-stdlib", + "version": "2.7.7", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/0e44eb46788f65e09e077eb7f44d2659143bcc1f", + "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-hydrator": "~1.1" + }, + "require-dev": { + "athletic/athletic": "~0.1", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-config": "~2.5", + "zendframework/zend-eventmanager": "~2.5", + "zendframework/zend-filter": "~2.5", + "zendframework/zend-inputfilter": "~2.5", + "zendframework/zend-serializer": "~2.5", + "zendframework/zend-servicemanager": "~2.5" + }, + "suggest": { + "zendframework/zend-eventmanager": "To support aggregate hydrator usage", + "zendframework/zend-filter": "To support naming strategy hydrator usage", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-release-2.7": "2.7-dev", + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" + ], + "abandoned": "laminas/laminas-stdlib", + "time": "2016-04-12T21:17:31+00:00" + }, + { + "name": "zetacomponents/base", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/zetacomponents/Base.git", + "reference": "489e20235989ddc97fdd793af31ac803972454f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zetacomponents/Base/zipball/489e20235989ddc97fdd793af31ac803972454f1", + "reference": "489e20235989ddc97fdd793af31ac803972454f1", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "~5.7", + "zetacomponents/unit-test": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Sergey Alexeev" + }, + { + "name": "Sebastian Bergmann" + }, + { + "name": "Jan Borsodi" + }, + { + "name": "Raymond Bosman" + }, + { + "name": "Frederik Holljen" + }, + { + "name": "Kore Nordmann" + }, + { + "name": "Derick Rethans" + }, + { + "name": "Vadym Savchuk" + }, + { + "name": "Tobias Schlitt" + }, + { + "name": "Alexandru Stanoi" + } + ], + "description": "The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package.", + "homepage": "https://github.com/zetacomponents", + "time": "2017-11-28T11:30:00+00:00" + }, + { + "name": "zetacomponents/document", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/zetacomponents/Document.git", + "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zetacomponents/Document/zipball/688abfde573cf3fe0730f82538fbd7aa9fc95bc8", + "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8", + "shasum": "" + }, + "require": { + "zetacomponents/base": "*" + }, + "require-dev": { + "zetacomponents/unit-test": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "src" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Sebastian Bergmann" + }, + { + "name": "Kore Nordmann" + }, + { + "name": "Derick Rethans" + }, + { + "name": "Tobias Schlitt" + }, + { + "name": "Alexandru Stanoi" + } + ], + "description": "The Document components provides a general conversion framework for different semantic document markup languages like XHTML, Docbook, RST and similar.", + "homepage": "https://github.com/zetacomponents", + "time": "2013-12-19T11:40:00+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.0" + }, + "platform-dev": [], + "plugin-api-version": "1.1.0" +} diff --git a/docu/README b/docu/README index dc3ec47..7802509 100644 --- a/docu/README +++ b/docu/README @@ -1,4 +1,3 @@ -Run ../mkdoku.sh to generate the documentation of the PHP source. -You will need NaturalDocs[1] for that. +Run `composer install` to install phpdoc. -[1]: http://www.naturaldocs.org/ \ No newline at end of file +Run ../mkdoku.sh to generate the documentation of the PHP source using phpdoc. diff --git a/docu/index.html b/docu/index.html index 9780b44..fad93eb 100644 --- a/docu/index.html +++ b/docu/index.html @@ -30,7 +30,7 @@

This documentation is splitted in two parts:

  1. The definition of the STE template language, including the documentation of the builtin tags and the standard library
  2. -
  3. The documentation of the PHP implementation
  4. +
  5. The documentation of the PHP implementation

It could also be helpful to take a look at the example program (the "example" directory).

diff --git a/docu/language_definition.html b/docu/language_definition.html index a296395..c99a4b9 100644 --- a/docu/language_definition.html +++ b/docu/language_definition.html @@ -24,12 +24,12 @@ background: #eee; } - +

The STE Template Language

This is the documentation of the Template Language of the STE Template Engine.

- +

TOC

  1. @@ -84,10 +84,10 @@
- +

Basic Elements

The STE Template Language consists of four basic elements:

- +

Text

Everything that is not a Variable, a Tag or a Pseudotag is Text.

Also everything that is wrapped in the ste:rawtext pseudotag will be Text, whereby all Tags and Variables will not be parsed.

@@ -98,14 +98,14 @@
Foo <ste:bar>$baz[herpdederp]</ste:baz>
will result in one text-element and one tag-element containing one variable-element.

- +

Variable

Variables start with a $ or can be wrapped within ${ and }, so you can write this: ${foo}ish

Variable have names, these names can consist of letters (english alphabet; upper and lower case), numbers and underscores (_). As a regex: [a-zA-Z0-9_]+

A variable can also be an array. To access an array, wrap the desired fieldname within [ and ]. A fieldname can be constructed of Text and other Variables. So you can dynamically access fields: $foo[$bar]. These fieldnames can also be nested or concatenated: $foo[$bar[baz]][herp][$de[derp]]

If you want a literal $ char, you can escape it: \$

Variables in STE are typeless, everything is text. In a boolean context, empty text usually represents false, else true.

- +

Tag

A Tag can be compared to a function. A Tag can have parameters and children elements.

@@ -124,14 +124,14 @@ When using variables in parameter values, they will be "replaced" by their value. Because many tags need the variable and not its content, they expect only the variable's name. If you then write foo="$bar", the tag will not operate on the bar variable but on the Variable with the name stored in $bar! So read the instructions to the tag carefully!

Example: <ste:foo bar="baz" herp="literal quote sign: \"">de <ste:derp hehe="hoho$wtf[xd]" /></ste:foo>

- +

Pseudotag

Pseudotags look like normal tags, but they perform special tasks. There are currently two pseudotags:

ste:comment

With the ste:comment pseudotag you can comment your template/code. Everything between <ste:comment> and </ste:comment> will be ignored, before the real tokenization of the code starts.

ste:rawtext

The ste:rawtext pseudotag will output a Text element with its wrapped content. It will prevent parsing of the content. Useful if you are embedding another script language, which uses the $ char or also has a XML-Like syntax. No escape sequences will be translated! Can not be used in Tag parameter values!

- +

Escaping special chars

To get a literal $, " or other special chars, STE gives you the following escape sequences:

@@ -201,10 +201,10 @@

Escape sequences are not translated in Pseudotags

- +

Builtin Tags

STE has some builtin Tags, that makes programming in STE possible.

- +

ste:if

The ste:if Tag provides an if-clause to STE.

ste:if can have the subtags ste:then and ste:else. Everything between <ste:if> and </ste:if>, that is not an ste:then or ste:else tag, will be used as the condition.

@@ -223,7 +223,7 @@

<ste:if>condition<ste:then>then</ste:then><ste:else>else</ste:else></ste:if>

?, {, | and } can be escaped

In this variant, the else part is not optional!

- +

ste:cmp

With the ste:cmp tag you can compare two values.

ste:cmp is selfclosing, the compared values are passed by parameters.

@@ -285,7 +285,7 @@

This is equivalent to:

<ste:cmp text_a="a" op="operator" text_b="b" />

~, {, | and } can be escaped.

- +

ste:not

The ste:not Tag will logically invert its content. If it is an empty text (i.e. false), it will return a non-empty text (i.e. true) and vice versa.

@@ -293,10 +293,10 @@

<ste:if>
<ste:not>$foo</ste:not>
<ste:then>:-)</ste:then>
<ste:else>:-(</ste:else>
</ste:if>
If the variable foo is empty (i.e. false), :-) will be returned, :-( otherwise.

- +

ste:even

If the enclosed text is a number, and the number is even, this tag will return a non-empty text (i.e. true), an empty text (i.e. false) otherwise.

- +

ste:for

ste:for provides a counter loop.

@@ -338,7 +338,7 @@

<ste:for start="10" stop="0" step="-1" counter="i">
$i<br />
</ste:for>
Will count from 10 down to 0 and output the number followed by an HTML line break.

- +

ste:foreach

ste:foreach will loop through an array.

@@ -388,7 +388,7 @@

<ste:foreach array="foo" value="v">
<p>$v</p>
<ste:else>
Array \$foo is empty.
</ste:else>
</ste:foreach>
This code will list all array elements or will display Array $foo is empty if the array $foo is empty.

- +

ste:infloop

Creates an infinitive loop. You can get out of the loop using the ste:break tag. Can be used to emulate other loop constructs like while loops.

@@ -396,16 +396,16 @@

<ste:infloop>
<ste:if>
<ste:foo />
<ste:then><ste:break /></ste:then>
</ste:if>
...
<ste:infloop>
This code will return ... while <ste:foo /> returns an empty text (i.e. false).

- +

ste:break

When this self-closing tag is called, the current loop (ste:for, ste:foreach, ste:infloop) will be aborted.

- +

ste:continue

When this self-closing tag is called, the current loop(ste:for, ste:foreach, ste:infloop) will go to the next iteration, aborting the current iteration.

- +

ste:load

This self-closing tag loads and executes another template. The name parameter (mandatory) defines the template to load.

-

Because each template must be parseable and transcompilable by itself, this is not a inclusion of another template. So you can not do this:

+

Because each template must be parseable and compilable by itself, this is not a inclusion of another template. So you can not do this:

slave.tpl:

<ste:foo>
bla
@@ -419,7 +419,7 @@ master.tpl
<ste:baz>
<ste:load name="slave.tpl" />
</ste:baz>

- +

ste:block

ste:block provides an easy way for writing master templates. Every block has a name. When a block is defined twice, the second one will overwrite the first one.

The name can be set with the name parameter.

@@ -432,7 +432,7 @@ When executing slave.tpl, master.tpl will be loaded and its content block will be replaced with the new one (Much cooler content :-)) but leave the original sidebar block.

Blocks can not be nested.

- +

ste:set

ste:set will set a variable. The parameter var takes the name of the variable to set. The content of the Tag will be the new content of the variable.

@@ -444,10 +444,10 @@ Tag parameter values can not contain Tags. ste:set can be used to bypass this:

<ste:set var="temp"><ste:foo /></ste:set>
<ste:bar baz="$temp" />

- +

ste:set

ste:setlocal is used like ste:set, but only a local variable will be set (ste:set would overwrite a variable, if it was declared in a parent scope). - +

ste:get

ste:get will return the content of a variable. The parameter var takes the name of the variable to get. Useful, if you want to get a variable which name is stored in a variable.

@@ -455,30 +455,30 @@

<ste:get var="$foo" />
This will get the variable with the name that is stored in the variable foo.

- +

ste:calc

To perform mathematical calculations, you can use ste:calc. ste:calc calculates the mathematical formula it is wrapped around and returns the result. The formula is in the usual infix-notation [ext. Link] and has these operators: +, -, *, / and ^. Numbers are always decimal, the decimal mark is . and numbers can be prefixed with an - to indicate a negative number. It is a good idea to wrap a negative number in brackets to prevent wrong evaluation (because - is also an operator). Calculations can be grouped with brackets: ( and ).

Real numbers are supported, complex numbers not.

-

Formulas are evaluated at runtime, not during transcompilation.

+

Formulas are evaluated at runtime, not during compilation.

Example:
<ste:calc>(2+3+4) * (1.5 - (-0.5))</ste:calc> will return 18.

-

This Tag is pretty slow, because the formula is not transcompiled and only evaluated at runtime. For some simple increment and decrement operations it is better to use the ste:inc and ste:dec Tags from the standard library.

- +

This Tag is pretty slow, because the formula is not compiled and only evaluated at runtime. For some simple increment and decrement operations it is better to use the ste:inc and ste:dec Tags from the standard library.

+

ste:mktag

ste:mktag allows you to define own Tags using the STE Template Language.

The parameter name (mandatory) expects the name of the new tag. If your tag requires some parameters, you can specify them using the optional mandatory parameter. Names of the mandatory parameters are separated by |.

The Variable _tag_parameters (associative array) will hold all given parameters and their values.

With the ste:tagcontent tag you can execute the tags content.

-

ste:mktag will be transcompiled like any other code. So your custom tag will be almost as fast as a plugin coded in PHP.

+

ste:mktag will be compiled like any other code. So your custom tag will be almost as fast as a plugin coded in PHP.

Example:

<ste:mktag name="countdown" mandatory="from|counter">
<ste:for start="$_tag_parameters[from]" stop="0" step="-1" counter="$_tag_parameters[counter]">
<ste:tagcontent />
</ste:for>
</ste:mktag>
<ste:mktag name="double">
<ste:calc><ste:tagcontent /> * 2</ste:calc>
</ste:mktag>
<ste:countdown from="5" counter="i">
<ste:double>$i</ste:double><br />
</ste:countdown>
Will output:
10<br/>
8<br />
6<br />
4<br />
2<br />
0<br />

- +

Standard Library

The Standard Library contains some useful tags, which are not builtin but still always available.

ste:escape

@@ -492,19 +492,19 @@

If the optional parameter lines is true (i.e. not empty), then additionally line breaks are converted to <br />.

- +

ste:strlen

Returns the length of then content.

- +

ste:arraylen

Returns the number of elements in the array (variable name given by parameter array).

- +

ste:inc

Increments (i.e. add 1) a variable (variable name given by parameter var).

- +

ste:dec

Decrements (i.e. subtract 1) a variable (variable name given by parameter var).

- +

ste:date

Formats a time using PHPs strftime format [ext. Link]. The format is given in the tag's content. You can specify a time (unix timestamp) using the timestamp parameter (defaults to the current time).

@@ -513,21 +513,21 @@ Result:

18. Sep. 2011, 16:49:20

- +

ste:in_array

Check, if a value is in an array. The tag takes the variable name of the array by parameter array.The value to test with will be taken from the tags content.

Returns empty text, if the value is not in the array, otherwise a non-empty text.

- +

ste:join

Join parts of an array together. The array's variable name goes to the array parameter. The tag's content will be used as the glue, i.e. this will be between two elements.

Returns the joined array

- +

ste:split

Split a text and write the parts to an array. The array parameter takes the variable name of the resulting array, the delim parameter the text to split by. The tag's content will be the text to split.

- +

ste:array_add

Adding an element to an array. The array parameter takes the variable name of the array. The key parameter takes the array key to map the value to, if omitted, the value will be appended to the end of the array. The value is the tag's content.

- +

ste:array_filter

Filter out array elements by multiple criterias.

All the parameters are names of array variables.

diff --git a/example/index.php b/example/index.php index 4a96410..caf57eb 100644 --- a/example/index.php +++ b/example/index.php @@ -9,7 +9,7 @@ use \kch42\ste; $ste = new ste\STECore( new ste\FilesystemStorageAccess( # The STECore needs a StorageAccess implementation, we are using the FilesystemStorageAccess, which comes with STE. dirname(__FILE__) . "/templates/src", # FilesystemStorageAccess needs a directory, where the Templates are... - dirname(__FILE__) . "/templates/transc" # ...and a directory for the transcompiled templates (write permissions needed). + dirname(__FILE__) . "/templates/transc" # ...and a directory for the compiled templates (write permissions needed). ) ); diff --git a/mkdocu.sh b/mkdocu.sh index 7f64e18..48b25b0 100755 --- a/mkdocu.sh +++ b/mkdocu.sh @@ -1,12 +1,4 @@ #!/bin/sh -if ! ndpath=`which NaturalDocs 2>/dev/null`; then -if ! ndpath=`which naturaldocs 2>/dev/null`; then -echo "NaturalDocs could not be found!" >/dev/stderr -exit 1 -fi; fi - - -test -d docu/nd || mkdir docu/nd -test -d docu/nd_project_dir || mkdir docu/nd_project_dir -$ndpath -i src/ste -o html docu/nd -p docu/nd_project_dir +[ -d docu/phpdoc ] || mkdir docu/phpdoc +./vendor/bin/phpdoc -d src -t docu/phpdoc diff --git a/src/ste/ASTNode.php b/src/ste/ASTNode.php index 2163161..3e74635 100644 --- a/src/ste/ASTNode.php +++ b/src/ste/ASTNode.php @@ -4,8 +4,16 @@ namespace kch42\ste; abstract class ASTNode { + /** @var string */ public $tpl; + + /** @var int */ public $offset; + + /** + * @param string $tpl + * @param int $off + */ public function __construct($tpl, $off) { $this->tpl = $tpl; diff --git a/src/ste/Calc.php b/src/ste/Calc.php index 64d2b7a..2f2d09d 100644 --- a/src/ste/Calc.php +++ b/src/ste/Calc.php @@ -2,15 +2,25 @@ namespace kch42\ste; -/* Class Calc contains static methods needed by */ +/** + * Class Calc contains static methods needed by + */ class Calc { private function __construct() { } - /* We could also just eval() the $infix_math code, but this is much cooler :-D (Parser inception) */ - public static function shunting_yard($infix_math) + /** + * Parse a mathematical expression with the shunting yard algorithm (https://en.wikipedia.org/wiki/Shunting-yard_algorithm) + * + * We could also just eval() the $infix_math code, but this is much cooler :-D (Parser inception) + + * @param string $infix_math + * @return array + * @throws RuntimeError + */ + private static function shunting_yard($infix_math) { $operators = array( "+" => array("l", 2), @@ -68,11 +78,17 @@ class Calc } else { $priority = $operators[$token][1]; if ($operators[$token][0] == "l") { - while ((!empty($op_stack)) and ($priority <= $operators[$op_stack[count($op_stack)-1]][1])) { + while ( + !empty($op_stack) + && $priority <= $operators[$op_stack[count($op_stack)-1]][1] + ) { $output_queue[] = array_pop($op_stack); } } else { - while ((!empty($op_stack)) and ($priority < $operators[$op_stack[count($op_stack)-1]][1])) { + while ( + !empty($op_stack) + && $priority < $operators[$op_stack[count($op_stack)-1]][1] + ) { $output_queue[] = array_pop($op_stack); } } @@ -91,7 +107,12 @@ class Calc return $output_queue; } - public static function pop2(&$array) + /** + * @param array $array + * @return array + * @throws RuntimeError + */ + private static function pop2(&$array) { $rv = array(array_pop($array), array_pop($array)); if (array_search(null, $rv, true) !== false) { @@ -100,7 +121,12 @@ class Calc return $rv; } - public static function calc_rpn($rpn) + /** + * @param array $rpn A mathematical expression in reverse polish notation + * @return int|float + * @throws RuntimeError + */ + private static function calc_rpn($rpn) { $stack = array(); foreach ($rpn as $token) { @@ -140,6 +166,14 @@ class Calc return array_pop($stack); } + /** + * Calculate a simple mathematical expression. Supported operators are +, -, *, /, ^. + * You can use ( and ) to group expressions together. + * + * @param string $expr + * @return float|int + * @throws RuntimeError + */ public static function calc($expr) { return self::calc_rpn(self::shunting_yard($expr)); diff --git a/src/ste/CantLoadTemplate.php b/src/ste/CantLoadTemplate.php index 20200d6..92604cc 100644 --- a/src/ste/CantLoadTemplate.php +++ b/src/ste/CantLoadTemplate.php @@ -1,13 +1,9 @@ implementation can throw, if it is unable to load a template. +/** + * An exception that a {@see StorageAccess} implementation can throw, if it is unable to load a template. */ class CantLoadTemplate extends StorageAccessFailure { diff --git a/src/ste/CantSaveTemplate.php b/src/ste/CantSaveTemplate.php index edbb93e..92cdfe7 100644 --- a/src/ste/CantSaveTemplate.php +++ b/src/ste/CantSaveTemplate.php @@ -1,13 +1,9 @@ implementation can throw, if it is unable to save a template. +/** + * An exception that a {@see StorageAccess} implementation can throw, if it is unable to save a template. */ class CantSaveTemplate extends StorageAccessFailure { diff --git a/src/ste/FatalRuntimeError.php b/src/ste/FatalRuntimeError.php index ab40af5..3f5183f 100644 --- a/src/ste/FatalRuntimeError.php +++ b/src/ste/FatalRuntimeError.php @@ -1,12 +1,8 @@ implementation for loading / saving templates into a directory structure. +/** + * The default {@see StorageAccess} implementation for loading / saving templates into a directory structure. */ class FilesystemStorageAccess implements StorageAccess { + /** @var string */ protected $sourcedir; + + /** @var string */ protected $transcompileddir; - /* - * Constructor: __construct - * - * Parameters: - * $src - The directory with the sources (Writing permissions are not mandatory, because STE does not save template sources). - * $transc - The directory with the transcompiled templates (the PHP instance / the HTTP Server needs writing permissions to this directory). + /** + * @param string $src - The directory with the sources (Writing permissions are not mandatory, because STE does not save template sources). + * @param string $transc - The directory with the compiled templates (the PHP instance / the HTTP Server needs writing permissions to this directory). */ public function __construct($src, $transc) { @@ -43,13 +39,16 @@ class FilesystemStorageAccess implements StorageAccess $src_stat = @stat($src_fn); $transc_stat = @stat($transc_fn); - if (($src_stat === false) and ($transc_stat === false)) { + if ($src_stat === false && $transc_stat === false) { throw new CantLoadTemplate("Template not found."); } elseif ($transc_stat === false) { $mode = StorageAccess::MODE_SOURCE; return file_get_contents($src_fn); } elseif ($src_stat === false) { include($transc_fn); + if (!isset($transcompile_fx)) { + throw new CantLoadTemplate("Compiled template file $transc_fn does not set \$transcompile_fx"); + } return $transcompile_fx; } else { if ($src_stat["mtime"] > $transc_stat["mtime"]) { @@ -57,6 +56,9 @@ class FilesystemStorageAccess implements StorageAccess return file_get_contents($src_fn); } else { include($transc_fn); + if (!isset($transcompile_fx)) { + throw new CantLoadTemplate("Compiled template file $transc_fn does not set \$transcompile_fx"); + } return $transcompile_fx; } } diff --git a/src/ste/Misc.php b/src/ste/Misc.php index d017ee3..330b3d2 100644 --- a/src/ste/Misc.php +++ b/src/ste/Misc.php @@ -4,6 +4,10 @@ namespace kch42\ste; class Misc { + /** + * @param string $text + * @return string + */ public static function escape_text($text) { return addcslashes($text, "\r\n\t\$\0..\x1f\\\"\x7f..\xff"); diff --git a/src/ste/ParseCompileError.php b/src/ste/ParseCompileError.php index f5f0272..29590da 100644 --- a/src/ste/ParseCompileError.php +++ b/src/ste/ParseCompileError.php @@ -2,6 +2,9 @@ namespace kch42\ste; +/** + * An exception thrown by the parser or compiler + */ class ParseCompileError extends \Exception { public $msg; @@ -16,10 +19,13 @@ class ParseCompileError extends \Exception $this->message = "$msg (Template $tpl, Offset $offset)"; } + /** + * Update the message to include a human readable offset. + * @param string $code + */ public function rewrite($code) { $line = substr_count(str_replace("\r\n", "\n", substr($code, 0, $this->off)), "\n") + 1; $this->message = "{$this->msg} (Template {$this->tpl}, Line $line)"; - $this->is_rewritten = true; } } diff --git a/src/ste/Parser.php b/src/ste/Parser.php index 40f5f20..0280f6d 100644 --- a/src/ste/Parser.php +++ b/src/ste/Parser.php @@ -1,20 +1,25 @@ text = $text; @@ -30,6 +39,10 @@ class Parser $this->len = mb_strlen($text); } + /** + * @param int $n + * @return string + */ private function next($n = 1) { if ($n <= 0) { @@ -40,11 +53,17 @@ class Parser return $c; } + /** + * @return bool + */ private function eof() { return ($this->off == $this->len); } + /** + * @param int $n + */ private function back($n = 1) { if ($n <= 0) { @@ -53,11 +72,19 @@ class Parser $this->off = max($this->off - $n, 0); } + /** + * @param string $needle + * @return false|int + */ private function search_off($needle) { return mb_strpos($this->text, $needle, $this->off); } + /** + * @param string[] $needles + * @return array 4-tuple of found key, offset, text preceding offset, old offset + */ private function search_multi($needles) { $oldoff = $this->off; @@ -81,6 +108,10 @@ class Parser return array($which, $minoff, mb_substr($this->text, $oldoff, $minoff - $oldoff), $oldoff); } + /** + * @param string $needle + * @return array 3-tuple of offset (or false), text preceding offset, old offset + */ private function search($needle) { $oldoff = $this->off; @@ -95,7 +126,11 @@ class Parser return array($off, mb_substr($this->text, $oldoff, $off - $oldoff), $oldoff); } - private function take_while($cb) + /** + * @param callable $cb + * @return string + */ + private function take_while(callable $cb) { $s = ""; while (($c = $this->next()) !== "") { @@ -113,6 +148,10 @@ class Parser $this->take_while("ctype_space"); } + /** + * @return string + * @throws ParseCompileError + */ private function get_name() { $off = $this->off; @@ -125,21 +164,16 @@ class Parser return $name; } - /* - * Function: parse + /** * Parses the input into an AST. * - * You only need this function, if you want to manually trnascompile a template. + * You only need this function, if you want to manually compile a template. * - * Parameters: - * $text - The input code. - * $name - The name of the template. + * @param string $text The input code. + * @param string $name The name of the template. * - * Returns: - * An array of objects. - * - * Throws: - * + * @return ASTNode[] + * @throws ParseCompileError */ public static function parse($text, $name) { @@ -151,10 +185,15 @@ class Parser return self::tidyup_ast($res[0]); } + /** + * @param ASTNode[] $ast + * @return ASTNode[] + */ private static function tidyup_ast($ast) { $out = array(); + /** @var TextNode|null $prevtext */ $prevtext = null; $first = true; @@ -206,6 +245,17 @@ class Parser return $out; } + /** + * @param string $escapes + * @param int $flags + * @param string|null $breakon + * @param string|null $separator + * @param null $nullaction + * @param string|null $opentag + * @param int $openedat + * @return ASTNode[][] + * @throws ParseCompileError + */ private function parse_text($escapes, $flags, $breakon = null, $separator = null, $nullaction = null, $opentag = null, $openedat = -1) { $elems = array(); @@ -250,14 +300,14 @@ class Parser } break; case "commentopen": - list($off, $before, $offbefore) = $this->search(""); + list($off, , $offbefore) = $this->search(""); if ($off === false) { throw new ParseCompileError("ste:comment was not closed", $this->name, $offbefore); } break; case "rawopen": $off_start = $off; - list($off, $before, $offbefore) = $this->search(""); + list($off, $before, ) = $this->search(""); if ($off === false) { throw new ParseCompileError("ste:rawtext was not closed", $this->name, $off_start); } @@ -352,6 +402,12 @@ class Parser return $elems; } + /** + * @param string $shortname + * @param int $openedat + * @return ASTNode[][] + * @throws ParseCompileError + */ private function parse_short($shortname, $openedat) { $tplname = $this->name; @@ -369,6 +425,12 @@ class Parser ); } + /** + * @param int $openedat + * @param bool $curly + * @return VariableNode + * @throws ParseCompileError + */ private function parse_var($openedat, $curly) { $varnode = new VariableNode($this->name, $openedat); @@ -377,12 +439,16 @@ class Parser $varnode->arrayfields = $this->parse_array(); } - if (($curly) && ($this->next() != "}")) { + if ($curly && ($this->next() != "}")) { throw new ParseCompileError("Unclosed '\${'", $this->name, $openedat); } return $varnode; } + /** + * @return ASTNode[] + * @throws ParseCompileError + */ private function parse_array() { $tplname = $this->name; @@ -409,6 +475,11 @@ class Parser return $arrayfields; } + /** + * @param int $openedat + * @return TagNode + * @throws ParseCompileError + */ private function parse_tag($openedat) { $tplname = $this->name; @@ -475,5 +546,8 @@ class Parser $tag->params[$param] = $paramval[0]; } } + + // Help PhpStorm detect that we shouldn't be here + throw new LogicException("Somehow we left the infinite loop?"); } } diff --git a/src/ste/RuntimeError.php b/src/ste/RuntimeError.php index dace1d4..51fd29d 100644 --- a/src/ste/RuntimeError.php +++ b/src/ste/RuntimeError.php @@ -1,14 +1,10 @@ is false, this will generate a error message instead of the tag's output. + * By default this will return in no output at all. But if {@see STECore::$mute_runtime_errors} is false, this will generate a error message instead of the tag's output. */ class RuntimeError extends \Exception { diff --git a/src/ste/STECore.php b/src/ste/STECore.php index 13fb2f6..40d680a 100644 --- a/src/ste/STECore.php +++ b/src/ste/STECore.php @@ -1,43 +1,64 @@ exception will result in no output from the tag, if false a error message will be written to output. - * $fatal_error_on_missing_tag - If true, STE will throw a if a tag was called that was not registered, otherwise (default) a regular will be thrown and automatically handled by STE (see <$mute_runtime_errors>). - * $vars - Variables in the top scope of the template. + /** + * @var array + * Associative array of blocks (see the language definition). */ public $blocks; + + /** + * @var array + * The order of the blocks (an array) + */ public $blockorder; + + /** + * @var bool + * If true (default) a {@see RuntimeError} exception will result in no + * output from the tag, if false a error message will be written to output. + */ public $mute_runtime_errors = true; + + /** + * @var bool + * If true, STE will throw a {@see FatalRuntimeError} if a tag was called + * that was not registered, otherwise (default) a regular + * {@see RuntimeError} will be thrown and automatically handled by STE + * (see {@see STECore::$mute_runtime_errors}). + */ public $fatal_error_on_missing_tag = false; + + /** + * @var array + * Variables in the top scope of the template. + */ public $vars; - /* - * Constructor: __construct - * - * Parameters: - * $storage_access - An Instance of a implementation. + /** + * @param StorageAccess $storage_access */ - public function __construct($storage_access) + public function __construct(StorageAccess $storage_access) { $this->storage_access = $storage_access; $this->cur_tpl_dir = "/"; @@ -50,42 +71,47 @@ class STECore $this->scope->vars =& $this->vars; } - /* - * Function: register_tag + /** * Register a custom tag. * * Parameters: - * $name - The name of the tag. - * $callback - A callable function (This must take three parameters: The instance, an associative array of parameters, and a function representing the tags content(This expects the instance as its only parameter and returns its text result, i.e to get the text, you neeed to call this function with the instance as a parameter)). + * @param string $name The name of the tag. + * @param callable $callback A callable function + * Must take three parameters: * - * Throws: - * An Exception if the tag could not be registered (if $callback is not callable or if $name is empty) + * The {@see STECore} instance, + * an associative array of parameters, + * and a function representing the tags content + * (This expects the {@see STECore} instance as + * its only parameter and returns its text result, + * i.e to get the text, you need to call this + * function with the {@see STECore} instance as a + * parameter). + * + * @throws Exception If the tag could not be registered (if $callback is not callable or if $name is empty) */ public function register_tag($name, $callback) { if (!is_callable($callback)) { - throw new \Exception("Can not register tag \"$name\", not callable."); + throw new Exception("Can not register tag \"$name\", not callable."); } if (empty($name)) { - throw new \Exception("Can not register tag, empty name."); + throw new Exception("Can not register tag, empty name."); } $this->tags[$name] = $callback; } - /* - * Function: call_tag + /** * Calling a custom tag (builtin ones can not be called) * - * Parameters: - * $name - The Tag's name - * $params - Associative array of parameters - * $sub - A callable function (expecting an instance as it's parameter) that represents the tag's content. + * @param string $name The Tag's name + * @param array $params Associative array of parameters + * @param callable $sub A callable function (expecting an {@see STECore} instance as it's parameter) that represents the tag's content. * - * Throws: - * Might throw a (see <$fatal_error_on_missing_tag>. + * @throws FatalRuntimeError see {@see STECore::$fatal_error_on_missing_tag}. * - * Returns: - * The output of the tag or, if a was thrown, the appropiate result (see <$mute_runtime_errors>). + * @return string The output of the tag or, if a {@see RuntimeError} was thrown, the appropriate result + * (see {@see STECore::$mute_runtime_errors}). */ public function call_tag($name, $params, $sub) { @@ -103,28 +129,37 @@ class STECore return "RuntimeError occurred on tag '$name': " . $e->getMessage(); } } + + return ""; } + /** + * {@see Calc::calc()} + * + * @param string $expression + * @return float|int + * @throws RuntimeError + */ public function calc($expression) { return Calc::calc($expression); } - /* - * Function: exectemplate - * Executes a template and returns the result. The huge difference to is that this function will also output all blocks. + /** + * Executes a template and returns the result. * - * Parameters: - * $tpl - The name of the template to execute. + * The huge difference to {@see STECore::load()} is that this function will also output all blocks. * - * Throws: - * * A exception if the template could not be loaded. - * * A if the template could not be parsed or transcompiled. - * * A if a tag threw it or if a tag was not found and <$fatal_error_on_missing_tag> is true. - * * Might also throw different exceptions, if a external tag threw it (but they should use or to make it possible for STE to handle them correctly). + * @param string $tpl The name of the template to execute. * - * Returns: - * The output of the template. + * @throws CantLoadTemplate If the template could not be loaded. + * @throws ParseCompileError If the template could not be parsed or compiled. + * @throws FatalRuntimeError If a tag threw it or if a tag was not found and <$fatal_error_on_missing_tag> is true. + * + * Might also throw different exceptions, if a external tag threw it + * (but they should use {@see RuntimeError} or {@see FatalRuntimeError} to make it possible for STE to handle them correctly). + * + * @return string The output of the template. */ public function exectemplate($tpl) { @@ -211,22 +246,21 @@ class STECore return $this->scope->get_var_by_name($name); } - /* - * Function: load - * Load a template and return its result (blocks not included, use for this). + /** + * Load a template and return its result (blocks not included, use {@see STECore::exectemplate} for this). * - * Parameters: - * $tpl - The name of the template to be loaded. - * $quiet - If true, do not output anything and do not modify the blocks. This can be useful to load custom tags that are programmed in the STE Template Language. Default: false. + * @param string $tpl The name of the template to be loaded. + * @param bool $quiet If true, do not output anything and do not modify the blocks. This can be useful to load custom tags that are programmed in the STE Template Language. Default: false. * - * Throws: - * * A exception if the template could not be loaded. - * * A if the template could not be parsed or transcompiled. - * * A if a tag threw it or if a tag was not found and <$fatal_error_on_missing_tag> is true. - * * Might also throw different exceptions, if a external tag threw it (but they should use or to make it possible for STE to handle them correctly). + * @throws CantLoadTemplate If the template could not be loaded. + * @throws CantSaveTemplate If the template could not be saved. + * @throws ParseCompileError If the template could not be parsed or compiled. + * @throws FatalRuntimeError If a tag threw it or if a tag was not found and {@see STECore::$fatal_error_on_missing_tag} is true. * - * Returns: - * The result of the template (if $quiet == false). + * Might also throw different exceptions, if a external tag threw it + * (but they should use {@see RuntimeError} or {@see FatalRuntimeError} to make it possible for STE to handle them correctly). + * + * @return string|null The result of the template (if $quiet == false). */ public function load($tpl, $quiet = false) { @@ -238,7 +272,7 @@ class STECore $tpl = $this->cur_tpl_dir . "/" . $tpl; } $pathex = array_filter(explode("/", $tpl), function ($s) { - return ($s != ".") and (!empty($s)); + return $s != "." && !empty($s); }); $pathex = array_merge($pathex); while (($i = array_search("..", $pathex)) !== false) { @@ -277,26 +311,31 @@ class STECore if ($quiet) { $this->blocks = $blocks_back; $this->blockorder = $blockorder_back; + + return null; } else { return $output; } } /* - * Function: evalbool * Test, if a text represents false (an empty / only whitespace text) or true (everything else). * - * Parameters: - * $txt - The text to test. + * @param string $txt The text to test. * - * Returns: - * true/false. + * @return bool */ public function evalbool($txt) { return trim(@(string)$txt) != ""; } + /** + * Internal function for implementing tag content and custom tags. + * + * @param callable $fx + * @return \Closure + */ public function make_closure($fx) { $bound_scope = $this->scope; @@ -312,7 +351,7 @@ class STECore $result = call_user_func_array($fx, $args); $ste->scope = $prev; return $result; - } catch (\Exception $e) { + } catch (Exception $e) { $ste->scope = $prev; throw $e; } diff --git a/src/ste/STEStandardLibrary.php b/src/ste/STEStandardLibrary.php index 9850afe..e39b7af 100644 --- a/src/ste/STEStandardLibrary.php +++ b/src/ste/STEStandardLibrary.php @@ -13,6 +13,12 @@ class STEStandardLibrary } } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + */ public static function escape($ste, $params, $sub) { if ($ste->evalbool(@$params["lines"])) { @@ -22,11 +28,24 @@ class STEStandardLibrary } } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + */ public static function strlen($ste, $params, $sub) { return strlen($sub($ste)); } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + * @throws RuntimeError + */ public static function arraylen($ste, $params, $sub) { if (empty($params["array"])) { @@ -36,6 +55,13 @@ class STEStandardLibrary return (is_array($a)) ? count($a) : ""; } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + * @throws RuntimeError + */ public static function inc($ste, $params, $sub) { if (empty($params["var"])) { @@ -45,6 +71,13 @@ class STEStandardLibrary $ref++; } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + * @throws RuntimeError + */ public static function dec($ste, $params, $sub) { if (empty($params["var"])) { @@ -54,11 +87,24 @@ class STEStandardLibrary $ref--; } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + */ public static function date($ste, $params, $sub) { return @strftime($sub($ste), empty($params["timestamp"]) ? @time() : (int) $params["timestamp"]); } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + * @throws RuntimeError + */ public static function in_array($ste, $params, $sub) { if (empty($params["array"])) { @@ -71,6 +117,13 @@ class STEStandardLibrary return in_array($sub($ste), $ar) ? "y" : ""; } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + * @throws RuntimeError + */ public static function join($ste, $params, $sub) { if (empty($params["array"])) { @@ -79,6 +132,13 @@ class STEStandardLibrary return implode($sub($ste), $ste->get_var_by_name($params["array"])); } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + * @throws RuntimeError + */ public static function split($ste, $params, $sub) { if (empty($params["array"])) { @@ -90,6 +150,13 @@ class STEStandardLibrary $ste->set_var_by_name($params["array"], explode($params["delim"], $sub($ste))); } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + * @throws RuntimeError + */ public static function array_add($ste, $params, $sub) { if (empty($params["array"])) { @@ -104,6 +171,13 @@ class STEStandardLibrary } } + /** + * @param STECore $ste + * @param array $params + * @param callable $sub + * @return string + * @throws RuntimeError + */ public static function array_filter($ste, $params, $sub) { if (empty($params["array"])) { diff --git a/src/ste/Scope.php b/src/ste/Scope.php index e312876..afb2bfc 100644 --- a/src/ste/Scope.php +++ b/src/ste/Scope.php @@ -4,9 +4,17 @@ namespace kch42\ste; class Scope implements \ArrayAccess { + /** @var self|null */ private $parent = null; + + /** @var array */ public $vars = array(); + /** + * @param string $name + * @return string[] + * @throws RuntimeError + */ private static function parse_name($name) { $remain = $name; @@ -44,6 +52,12 @@ class Scope implements \ArrayAccess return $fields; } + /** + * @param string $name + * @param bool $localonly + * @return mixed A reference to the resolved variable + * @throws VarNotInScope + */ private function &get_topvar_reference($name, $localonly) { if (array_key_exists($name, $this->vars)) { @@ -59,6 +73,13 @@ class Scope implements \ArrayAccess throw new VarNotInScope(); } + /** + * @param string $name + * @param bool $create_if_not_exist + * @param bool $localonly + * @return mixed A reference to the resolved variable + * @throws RuntimeError + */ public function &get_var_reference($name, $create_if_not_exist, $localonly=false) { $nullref = null; @@ -107,24 +128,42 @@ class Scope implements \ArrayAccess return $ref; } + /** + * @param string $name + * @param mixed $val + * @throws RuntimeError + */ public function set_var_by_name($name, $val) { $ref = &$this->get_var_reference($name, true); $ref = $val; } + /** + * @param string $name + * @param mixed $val + * @throws RuntimeError + */ public function set_local_var($name, $val) { $ref = &$this->get_var_reference($name, true, true); $ref = $val; } + /** + * @param string $name + * @return mixed Returns an empty string, if not found or unset + * @throws RuntimeError + */ public function get_var_by_name($name) { $ref = $this->get_var_reference($name, false); return $ref === null ? "" : $ref; } + /** + * @return self + */ public function new_subscope() { $o = new self(); diff --git a/src/ste/StorageAccess.php b/src/ste/StorageAccess.php index e2e8727..38dea7e 100644 --- a/src/ste/StorageAccess.php +++ b/src/ste/StorageAccess.php @@ -1,56 +1,45 @@ . - * If , the raw sourcecode is expected, if the transcompiled template *as a callable function* (expecting an instance as first parameter) is expected. - * If the transcompiled version is not available or older than the source, you can set this parameter to and return the source. + * @param string $tpl The name of the template. + * @param string &$mode Which mode is preferred? One of the MODE_* constants. + * If {@see StorageAccess::MODE_SOURCE}, the raw sourcecode is expected, + * if {@see StorageAccess::MODE_TRANSCOMPILED} the compiled template + * *as a callable function* (expecting an {@see STECore} instance as first parameter) is expected. + * + * If the compiled version is not available or older than the source, you can set this + * parameter to {@see StorageAccess::MODE_SOURCE} and return the source. * - * Throws: - * A exception if the template could not be loaded. + * @throws CantLoadTemplate If the template could not be loaded. * - * Returns: - * Either the sourcecode or a callable function (first, and only parameter: an instance). + * @return string|callable Either the sourcecode or a callable function (first, and only parameter: an {@see STECore} instance). */ public function load($tpl, &$mode); - /* - * Function: save + /** * Saves a template. * - * Throws: - * A exception if the template could not be saved. + * @param string $tpl -The name of the template. + * @param string $data - The data to be saved. + * @param int $mode - One of the MODE_* constants. * - * Parameters: - * $tpl -The name of the template. - * $data - The data to be saved. - * $mode - A