diff --git a/.kick.yml b/.kick.yml new file mode 100644 index 0000000..e754d7b --- /dev/null +++ b/.kick.yml @@ -0,0 +1,15 @@ +# Kickstart container config file - see https://gitub.com/c7lab/kickstart +# Run ./kickstart.sh to start a development-container for this project + +version: 1 + +## Use Gaia-flavor (apache2 php7.1) see: https://github.com/c7lab/kickstart-flavor-gaia +from: "continue/kickstart-flavor-gaia" + + +command: + init: + - "composer update" + + test: + - "./vendor/bin/tester -p /usr/bin/php -c test/php.ini --coverage ./build/logs/clover.xml --coverage-src ./src -s ./test/" diff --git a/README.md b/README.md index 3b684f2..aa94974 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,17 @@ a github issue. __Keeping the tests green__: Please see / provide unit-tests. This project uses `nette/tester` for unit-testing. +This Project uses [kickstart](https://github.com/c7lab/kickstart)'s ready to use development +containers based on docker. Just run `./kickstart.sh` to run this project. + +To start the development container + +```bash +./kickstart.sh +``` + +To execute the tests run `kick test` inside the container. (See `.kick.yml`) + ## About Text-Template was written by Matthias Leuffen diff --git a/composer.lock b/composer.lock index 7572d7a..96fc8c5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,38 +4,38 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "4b2f0b1d0958adad8d522948157f9b53", "content-hash": "0a22bd5b536ef5d18769369fb6ffbd21", "packages": [], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "870a62d7b0d63d4e0ffa8f2ce3ab7c8a53d1846d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/870a62d7b0d63d4e0ffa8f2ce3ab7c8a53d1846d", + "reference": "870a62d7b0d63d4e0ffa8f2ce3ab7c8a53d1846d", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^4.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-shim": "^0.9.2", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -60,20 +60,20 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2018-03-05T09:41:42+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/68d0ea14d5a3f42a20e87632a5f84931e2709c90", + "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90", "shasum": "" }, "require": { @@ -83,7 +83,7 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4", "psr/log": "^1.0" }, "suggest": { @@ -92,7 +92,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -125,7 +125,7 @@ "rest", "web service" ], - "time": "2017-06-22 18:50:49" + "time": "2018-03-26T16:33:04+00:00" }, { "name": "guzzlehttp/promises", @@ -133,19 +133,19 @@ "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "09e549f5534380c68761260a71f847644d8f65aa" + "reference": "136531aa4e42f9b1971a47fb0faf60da00d2fefa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/09e549f5534380c68761260a71f847644d8f65aa", - "reference": "09e549f5534380c68761260a71f847644d8f65aa", + "url": "https://api.github.com/repos/guzzle/promises/zipball/136531aa4e42f9b1971a47fb0faf60da00d2fefa", + "reference": "136531aa4e42f9b1971a47fb0faf60da00d2fefa", "shasum": "" }, "require": { "php": ">=5.5.0" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "phpunit/phpunit": "^4.8.36" }, "type": "library", "extra": { @@ -176,7 +176,7 @@ "keywords": [ "promise" ], - "time": "2017-05-20 23:14:18" + "time": "2018-03-25T01:26:01+00:00" }, { "name": "guzzlehttp/psr7", @@ -184,12 +184,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "811b676fbab9c99e359885032e5ebc70e442f5b8" + "reference": "99bfec281379c040f37dc3c3e9312476875a2f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/811b676fbab9c99e359885032e5ebc70e442f5b8", - "reference": "811b676fbab9c99e359885032e5ebc70e442f5b8", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/99bfec281379c040f37dc3c3e9312476875a2f62", + "reference": "99bfec281379c040f37dc3c3e9312476875a2f62", "shasum": "" }, "require": { @@ -241,7 +241,7 @@ "uri", "url" ], - "time": "2017-07-17 09:11:21" + "time": "2018-03-26T16:50:35+00:00" }, { "name": "nette/tester", @@ -249,12 +249,12 @@ "source": { "type": "git", "url": "https://github.com/nette/tester.git", - "reference": "c4f81338bfac6b4e8a3ae13c78516a29123d832a" + "reference": "00d2ea184af95a17aafedcc3468ea274350af53d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/tester/zipball/c4f81338bfac6b4e8a3ae13c78516a29123d832a", - "reference": "c4f81338bfac6b4e8a3ae13c78516a29123d832a", + "url": "https://api.github.com/repos/nette/tester/zipball/00d2ea184af95a17aafedcc3468ea274350af53d", + "reference": "00d2ea184af95a17aafedcc3468ea274350af53d", "shasum": "" }, "require": { @@ -303,7 +303,7 @@ "testing", "unit" ], - "time": "2017-09-10 15:52:48" + "time": "2018-03-23T16:56:51+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -311,24 +311,24 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "81339187a96c6fdb70cd876b129891f8ca501508" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/81339187a96c6fdb70cd876b129891f8ca501508", + "reference": "81339187a96c6fdb70cd876b129891f8ca501508", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "^6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -357,38 +357,40 @@ "reflection", "static analysis" ], - "time": "2017-09-11 18:02:19" + "time": "2018-02-14T18:58:54+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.1.1", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" + "reference": "182609736818dc750d42470c0be2a5ed74bad3bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/182609736818dc750d42470c0be2a5ed74bad3bd", + "reference": "182609736818dc750d42470c0be2a5ed74bad3bd", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" + "php": ">=7.1", + "phpdocumentor/type-resolver": "^0", + "webmozart/assert": "^1" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -402,41 +404,39 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30 18:51:59" + "time": "2018-02-14T19:00:58+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "69bf1b199584f2004365a150c2e6cfbe852b6d66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/69bf1b199584f2004365a150c2e6cfbe852b6d66", + "reference": "69bf1b199584f2004365a150c2e6cfbe852b6d66", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": ">=7.1", + "phpdocumentor/reflection-common": "^2" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "0.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -449,7 +449,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14 14:27:02" + "time": "2018-02-14T18:59:20+00:00" }, { "name": "phpspec/prophecy", @@ -457,12 +457,12 @@ "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", "shasum": "" }, "require": { @@ -474,7 +474,7 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" }, "type": "library", "extra": { @@ -512,7 +512,7 @@ "spy", "stub" ], - "time": "2017-09-04 11:05:03" + "time": "2018-02-19T10:16:54+00:00" }, { "name": "phpunit/php-code-coverage", @@ -574,20 +574,20 @@ "testing", "xunit" ], - "time": "2015-10-06 15:47:00" + "time": "2015-10-06T15:47:00+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "dev-master", + "version": "1.4.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -621,7 +621,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -662,7 +662,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -670,24 +670,24 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "d107f347d368dd8a384601398280c7c608390ab7" + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/d107f347d368dd8a384601398280c7c608390ab7", - "reference": "d107f347d368dd8a384601398280c7c608390ab7", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -702,7 +702,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -711,7 +711,7 @@ "keywords": [ "timer" ], - "time": "2017-03-07 15:42:04" + "time": "2018-02-01T13:07:23+00:00" }, { "name": "phpunit/php-token-stream", @@ -719,12 +719,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "958103f327daef5dd0bb328dec53e0a9e43cfaf7" + "reference": "58bd196ce8bc49389307b3787934a5117db80fea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/958103f327daef5dd0bb328dec53e0a9e43cfaf7", - "reference": "958103f327daef5dd0bb328dec53e0a9e43cfaf7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/58bd196ce8bc49389307b3787934a5117db80fea", + "reference": "58bd196ce8bc49389307b3787934a5117db80fea", "shasum": "" }, "require": { @@ -760,7 +760,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-03-07 08:21:50" + "time": "2017-12-04T15:11:28+00:00" }, { "name": "phpunit/phpcov", @@ -812,7 +812,7 @@ ], "description": "CLI frontend for PHP_CodeCoverage", "homepage": "https://github.com/sebastianbergmann/phpcov", - "time": "2015-10-05 09:24:23" + "time": "2015-10-05T09:24:23+00:00" }, { "name": "phpunit/phpunit", @@ -884,7 +884,7 @@ "testing", "xunit" ], - "time": "2017-06-23 12:44:27" + "time": "2017-06-23T12:44:27+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -940,7 +940,7 @@ "mock", "xunit" ], - "time": "2015-10-02 06:51:40" + "time": "2015-10-02T06:51:40+00:00" }, { "name": "psr/http-message", @@ -990,7 +990,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", @@ -1037,7 +1037,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "satooshi/php-coveralls", @@ -1120,7 +1120,7 @@ "github", "test" ], - "time": "2017-09-02 14:46:54" + "time": "2017-09-02T14:46:54+00:00" }, { "name": "sebastian/comparator", @@ -1184,7 +1184,7 @@ "compare", "equality" ], - "time": "2017-03-07 10:34:43" + "time": "2017-03-07T10:34:43+00:00" }, { "name": "sebastian/diff", @@ -1236,7 +1236,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22 07:24:03" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -1286,7 +1286,7 @@ "environment", "hhvm" ], - "time": "2017-02-28 08:18:59" + "time": "2017-02-28T08:18:59+00:00" }, { "name": "sebastian/exporter", @@ -1353,24 +1353,24 @@ "export", "exporter" ], - "time": "2017-02-26 13:09:30" + "time": "2017-02-26T13:09:30+00:00" }, { "name": "sebastian/finder-facade", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9" + "reference": "4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", - "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", + "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f", + "reference": "4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f", "shasum": "" }, "require": { - "symfony/finder": "~2.3|~3.0", + "symfony/finder": "~2.3|~3.0|~4.0", "theseer/fdomdocument": "~1.3" }, "type": "library", @@ -1392,7 +1392,7 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", - "time": "2016-02-17 07:02:23" + "time": "2017-11-18T17:31:49+00:00" }, { "name": "sebastian/global-state", @@ -1443,7 +1443,7 @@ "keywords": [ "global state" ], - "time": "2017-02-23 14:11:06" + "time": "2017-02-23T14:11:06+00:00" }, { "name": "sebastian/recursion-context", @@ -1496,7 +1496,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03 07:41:43" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/version", @@ -1531,7 +1531,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" + "time": "2015-06-21T13:59:46+00:00" }, { "name": "symfony/config", @@ -1539,12 +1539,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "870a0b252856a3c5923b8e18a3e5e4bf8b42cc54" + "reference": "7c2a9d44f4433863e9bca682e7f03609234657f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/870a0b252856a3c5923b8e18a3e5e4bf8b42cc54", - "reference": "870a0b252856a3c5923b8e18a3e5e4bf8b42cc54", + "url": "https://api.github.com/repos/symfony/config/zipball/7c2a9d44f4433863e9bca682e7f03609234657f9", + "reference": "7c2a9d44f4433863e9bca682e7f03609234657f9", "shasum": "" }, "require": { @@ -1557,6 +1557,7 @@ }, "require-dev": { "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", "symfony/finder": "~3.3|~4.0", "symfony/yaml": "~3.0|~4.0" }, @@ -1593,7 +1594,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-09-15 10:12:22" + "time": "2018-03-19T22:32:39+00:00" }, { "name": "symfony/console", @@ -1601,12 +1602,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f928b89f9166f8d8458f728ba54ff1639a44c717" + "reference": "390fa4899dbcc47bd41935d87c4572ea4305d3ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f928b89f9166f8d8458f728ba54ff1639a44c717", - "reference": "f928b89f9166f8d8458f728ba54ff1639a44c717", + "url": "https://api.github.com/repos/symfony/console/zipball/390fa4899dbcc47bd41935d87c4572ea4305d3ce", + "reference": "390fa4899dbcc47bd41935d87c4572ea4305d3ce", "shasum": "" }, "require": { @@ -1654,7 +1655,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-09-15 09:59:38" + "time": "2018-03-19T21:13:58+00:00" }, { "name": "symfony/debug", @@ -1711,29 +1712,29 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-07-30 07:22:48" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/filesystem", - "version": "3.4.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "9cc3a81095fae8ec0654f7b568108e78ef893fc9" + "reference": "da8a42afd52b7652e626bafae09ed07c64ea3c30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/9cc3a81095fae8ec0654f7b568108e78ef893fc9", - "reference": "9cc3a81095fae8ec0654f7b568108e78ef893fc9", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/da8a42afd52b7652e626bafae09ed07c64ea3c30", + "reference": "da8a42afd52b7652e626bafae09ed07c64ea3c30", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1760,29 +1761,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-09-15 10:12:22" + "time": "2018-02-22T11:40:25+00:00" }, { "name": "symfony/finder", - "version": "3.4.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "985b4788f55362bb73e632c431221d5887bded12" + "reference": "6347bc280e751bb85b89cdbbda78ea25ffce2287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/985b4788f55362bb73e632c431221d5887bded12", - "reference": "985b4788f55362bb73e632c431221d5887bded12", + "url": "https://api.github.com/repos/symfony/finder/zipball/6347bc280e751bb85b89cdbbda78ea25ffce2287", + "reference": "6347bc280e751bb85b89cdbbda78ea25ffce2287", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1809,7 +1810,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-09-15 10:12:22" + "time": "2018-03-05T18:28:38+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1817,12 +1818,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", "shasum": "" }, "require": { @@ -1834,7 +1835,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -1868,7 +1869,7 @@ "portable", "shim" ], - "time": "2017-06-14 15:44:48" + "time": "2018-01-30T19:27:44+00:00" }, { "name": "symfony/stopwatch", @@ -1876,12 +1877,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "1f8ea2f7ed0c06537330757b285a3ddb15b76b66" + "reference": "eb17cfa072cab26537ac37e9c4ece6c0361369af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1f8ea2f7ed0c06537330757b285a3ddb15b76b66", - "reference": "1f8ea2f7ed0c06537330757b285a3ddb15b76b66", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/eb17cfa072cab26537ac37e9c4ece6c0361369af", + "reference": "eb17cfa072cab26537ac37e9c4ece6c0361369af", "shasum": "" }, "require": { @@ -1917,7 +1918,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-08-03 09:34:20" + "time": "2018-02-17T14:55:25+00:00" }, { "name": "symfony/yaml", @@ -1925,12 +1926,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "d0fc816f0c360daedbb761beb4be5fbbbb45b301" + "reference": "af615970e265543a26ee712c958404eb9b7ac93d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/d0fc816f0c360daedbb761beb4be5fbbbb45b301", - "reference": "d0fc816f0c360daedbb761beb4be5fbbbb45b301", + "url": "https://api.github.com/repos/symfony/yaml/zipball/af615970e265543a26ee712c958404eb9b7ac93d", + "reference": "af615970e265543a26ee712c958404eb9b7ac93d", "shasum": "" }, "require": { @@ -1972,7 +1973,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-09-15 10:08:59" + "time": "2018-01-20T15:04:53+00:00" }, { "name": "theseer/fdomdocument", @@ -2012,7 +2013,7 @@ ], "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", "homepage": "https://github.com/theseer/fDOMDocument", - "time": "2017-06-30 11:53:12" + "time": "2017-06-30T11:53:12+00:00" }, { "name": "webmozart/assert", @@ -2020,12 +2021,12 @@ "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "4a8bf11547e139e77b651365113fc12850c43d9a" + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/4a8bf11547e139e77b651365113fc12850c43d9a", - "reference": "4a8bf11547e139e77b651365113fc12850c43d9a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, "require": { @@ -2062,7 +2063,7 @@ "check", "validate" ], - "time": "2016-11-23 20:04:41" + "time": "2018-01-29T19:49:41+00:00" } ], "aliases": [], diff --git a/kickstart.sh b/kickstart.sh new file mode 100755 index 0000000..22b24de --- /dev/null +++ b/kickstart.sh @@ -0,0 +1,260 @@ +#!/bin/bash +# +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# DO NOT EDIT THIS FILE! CHANGES WILL BE OVERWRITTEN ON UPDATE +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# +# Ready to use development containers. Just run ./kickstart.sh to start +# a development environment for this project. +# +# Config-File: .kick.yml +# +# Kickstart home: https://github.com/c7lab/kickstart +# +# Author: Matthias Leuffen +# + + +# Error Handling. +trap 'on_error $LINENO' ERR; +PROGNAME=$(basename $0) +PROGPATH="$( cd "$(dirname "$0")" ; pwd -P )" # The absolute path to kickstart.sh + +function on_error () { + echo "Error: ${PROGNAME} on line $1" 1>&2 + exit 1 +} + + + +CONTAINER_NAME=${PWD##*/} + +export COLOR_NC='\e[0m' # No Color +export COLOR_WHITE='\e[1;37m' +export COLOR_BLACK='\e[0;30m' +export COLOR_BLUE='\e[0;34m' +export COLOR_LIGHT_BLUE='\e[1;34m' +export COLOR_GREEN='\e[0;32m' +export COLOR_LIGHT_GREEN='\e[1;32m' +export COLOR_CYAN='\e[0;36m' +export COLOR_LIGHT_CYAN='\e[1;36m' +export COLOR_RED='\e[0;31m' +export COLOR_LIGHT_RED='\e[1;31m' +export COLOR_PURPLE='\e[0;35m' +export COLOR_LIGHT_PURPLE='\e[1;35m' +export COLOR_BROWN='\e[0;33m' +export COLOR_YELLOW='\e[1;33m' +export COLOR_GRAY='\e[0;30m' +export COLOR_LIGHT_GRAY='\e[0;37m' + +command -v curl >/dev/null 2>&1 || { echo -e "$COLOR_LIGHT_RED I require curl but it's not installed (run: 'apt-get install curl'). Aborting.$COLOR_NC" >&2; exit 1; } +command -v docker >/dev/null 2>&1 || { echo -e "$COLOR_LIGHT_RED I require docker but it's not installed (see http://docker.io). Aborting.$COLOR_NC" >&2; exit 1; } + +KICKSTART_DOC_URL="https://github.com/c7lab/kickstart/" +KICKSTART_UPGRADE_URL="https://raw.githubusercontent.com/c7lab/kickstart/master/opt/kickstart.sh" +KICKSTART_RELEASE_NOTES_URL="https://raw.githubusercontent.com/c7lab/kickstart/master/opt/kickstart-release-notes.txt" +KICKSTART_VERSION_URL="https://raw.githubusercontent.com/c7lab/kickstart/master/opt/kickstart-release.txt" + +KICKSTART_CURRENT_VERSION="1.1.0" + + + + +_usage() { + echo -e $COLOR_NC "Usage: $0 [] + + COMMANDS: + + $0 [dev|] + Run kick and start bash inside container (development mode) + + $0 run + Execute kick and return (unit-testing) + + + EXAMPLES + + $0 Just start a shell inside the container (default development usage) + $0 run test Execute commands defined in section 'test' of .kick.yml + + ARGUMENTS + -t --tag= Run container with this tag (development) + -u --unflavored Run the container whithout running any scripts (develpment) + --upgrade Search / Install new kickstart version + + " + exit 1 +} + + +_print_header() { + echo -e $COLOR_WHITE " + + C7Lab's + ▄█ ▄█▄ ▄█ ▄████████ ▄█ ▄█▄ ▄████████ ███ ▄████████ ▄████████ ███ + ███ ▄███▀ ███ ███ ███ ███ ▄███▀ ███ ███ ▀█████████▄ ███ ███ ███ ███ ▀█████████▄ + ███▐██▀ ███▌ ███ █▀ ███▐██▀ ███ █▀ ▀███▀▀██ ███ ███ ███ ███ ▀███▀▀██ + ▄█████▀ ███▌ ███ ▄█████▀ ███ ███ ▀ ███ ███ ▄███▄▄▄▄██▀ ███ ▀ +▀▀█████▄ ███▌ ███ ▀▀█████▄ ▀███████████ ███ ▀███████████ ▀▀███▀▀▀▀▀ ███ + ███▐██▄ ███ ███ █▄ ███▐██▄ ███ ███ ███ ███ ▀███████████ ███ + ███ ▀███▄ ███ ███ ███ ███ ▀███▄ ▄█ ███ ███ ███ ███ ███ ███ ███ + ███ ▀█▀ █▀ ████████▀ ███ ▀█▀ ▄████████▀ ▄████▀ ███ █▀ ███ ███ ▄████▀ + ▀ ▀ ███ ███ + happy containers + " $COLOR_YELLOW " ++-------------------------------------------------------------------------------------------------------+ +| C7Lab Kickstart - DEVELOPER MODE | +| Version: $KICKSTART_CURRENT_VERSION +| Flavour: $USE_PIPF_VERSION (defined in 'from:'-section of .kick.yml)" + + + + KICKSTART_NEWEST_VERSION=`curl -s "$KICKSTART_VERSION_URL"` + if [ "$KICKSTART_NEWEST_VERSION" != "$KICKSTART_CURRENT_VERSION" ] + then + echo "| " + echo "| UPDATE AVAILABLE: Head Version: $KICKSTART_NEWEST_VERSION" + echo "| To Upgrade Version: Run ./kickstart.sh --upgrade " + echo "| " + fi; + + echo "| More information: https://github.com/continue/kickstart " + echo "| Or ./kickstart.sh help |" + echo "+-------------------------------------------------------------------------------------------------------+" + +} + + +run_shell() { + echo -e $COLOR_CYAN; + echo "[kickstart.sh] Container '$CONTAINER_NAME' already running" + echo "===> [kickstart.sh] Opening new shell: " + echo -e $COLOR_NC + + docker exec -it --user user -e "DEV_TTYID=[SUB]" $CONTAINER_NAME /bin/bash + + echo -e $COLOR_CYAN; + echo "<=== [kickstart.sh] Leaving container." + echo -e $COLOR_NC + exit +} + + +ask_user() { + echo ""; + read -r -p "$1 (y|N)" choice + case "$choice" in + n|N) + echo "Abort!"; + ;; + y|Y) + return 0; + ;; + + *) + echo 'Response not valid';; + esac + exit 1; +} + + +run_container() { + echo -e $COLOR_GREEN"Loading container '$USE_PIPF_VERSION'..." + docker pull "$USE_PIPF_VERSION" + + docker rm $CONTAINER_NAME + echo -e $COLOR_WHITE "==> [$0] STARTING CONTAINER (docker run): Running container in dev-mode..." $COLOR_NC + docker run -it \ + -v "$PROGPATH/:/opt/" \ + -e "DEV_CONTAINER_NAME=$CONTAINER_NAME" \ + -e "DEV_TTYID=[MAIN]" \ + -e "DEV_UID=$UID" \ + -e "DEV_MODE=1" \ + -p 80:4200 \ + --name $CONTAINER_NAME \ + $USE_PIPF_VERSION $ARGUMENT + + status=$? + if [[ $status -ne 0 ]] + then + echo -e $COLOR_RED + echo "[kickstart.sh][FAIL]: Container startup failed." + echo "[kickstart.sh][FAIL]: Make sure you have Port 80 free and docker installed correctly." + echo -e $COLOR_NC + exit $status + fi; + echo -e $COLOR_WHITE "<== [kickstart.sh] CONTAINER SHUTDOWN" + echo -e $COLOR_RED " Kickstart Exit - Goodbye" $COLOR_NC + exit 0; +} + + +if [ ! -f "$PROGPATH/.kick.yml" ] +then + echo -e $COLOR_RED "[ERR] Missing $PROGPATH/.kick.yml file." $COLOR_NC + ask_user "Do you want to create a new .kick.yml-file?" + echo "# Kickstart container config file - see https://gitub.com/c7lab/kickstart" > $PROGPATH/.kick.yml + echo "# Run ./kickstart.sh to start a development-container for this project" >> $PROGPATH/.kick.yml + echo "version: 1" >> $PROGPATH/.kick.yml + echo 'from: "continue/kickstart"' >> $PROGPATH/.kick.yml + echo "File created. See $KICKSTART_DOC_URL for more information"; + echo "" + sleep 2 +fi + + + +# Parse .kick.yml for line from: "docker/container:version" +USE_PIPF_VERSION=`cat $PROGPATH/.kick.yml | sed -n 's/from\: "\(.\+\)\"/\1/p'` + +if [ "$USE_PIPF_VERSION" == "" ] +then + echo -e $COLOR_RED "[ERR] .kick.yml file does not include 'from:' - directive." $COLOR_NC + exit 2 +fi; + + +# Parse the command parameters +ARGUMENT=""; +while [ "$#" -gt 0 ]; do + case "$1" in + -t) USE_PIPF_VERSION="-t $2"; shift 2;; + --tag=*) USE_PIPF_VERSION="-t ${1#*=}"; shift 1;; + + --upgrade) + echo "Checking for updates from $KICKSTART_UPGRADE_URL..." + curl "$KICKSTART_RELEASE_NOTES_URL" + + ask_user "Do you want to upgrade?" + + echo "Writing to $0..." + curl "$KICKSTART_UPGRADE_URL" -o "$0" + echo "Done" + echo "Calling on update trigger: $0 --on-after-update" + $0 --on-after-upgrade + echo -e "$COLOR_GREEN[kickstart.sh] Upgrade successful.$COLOR_NC" + exit 0;; + + --on-after-upgrade) + exit 0;; + + -h|--help) + _usage + exit 0;; + + --tag) echo "$1 requires an argument" >&2; exit 1;; + + -*) echo "unknown option: $1" >&2; exit 1;; + + *) break; + + esac +done + +ARGUMENT=$@; +_print_header +if [ `docker ps | grep "$CONTAINER_NAME" | wc -l` -gt 0 ] +then + run_shell +fi; +run_container \ No newline at end of file diff --git a/src/TextTemplate.php b/src/TextTemplate.php index 1dc5b16..98dd1cd 100644 --- a/src/TextTemplate.php +++ b/src/TextTemplate.php @@ -236,7 +236,7 @@ private function _removeWhitespace ($input) { // And ending with newline by single line // // Caution: Lookahead at the end required to strip multiple lines! - $input = preg_replace("/\\n\s*(\{(?!\=)[^\}]+?\})(?=[\\n\{])/m", '$1', $input); + $input = preg_replace("/\\n\s*(\{(?!\=)[^\\n}]+?\})(?=[\\n\{])/m", '$1', $input); return $input; } diff --git a/test/php.ini b/test/php.ini index d034c83..5815810 100644 --- a/test/php.ini +++ b/test/php.ini @@ -1,2 +1,3 @@ [PHP] +extension=json.so zend_extension=xdebug.so \ No newline at end of file diff --git a/test/unit/tpls/00_LineBreaks/_in.txt b/test/unit/tpls/00_LineBreaks/_in.txt index 7634586..604d906 100644 --- a/test/unit/tpls/00_LineBreaks/_in.txt +++ b/test/unit/tpls/00_LineBreaks/_in.txt @@ -19,4 +19,11 @@ 1:Line 2: True Value {if boolVal == false} Some Value{/if} -3: Line \ No newline at end of file +3: Line + + +1:Line +{ +2 NextLine +} +3 Third \ No newline at end of file diff --git a/test/unit/tpls/00_LineBreaks/out.txt b/test/unit/tpls/00_LineBreaks/out.txt index 5c24b18..8104010 100644 --- a/test/unit/tpls/00_LineBreaks/out.txt +++ b/test/unit/tpls/00_LineBreaks/out.txt @@ -14,4 +14,11 @@ 1:Line 2: True Value -3: Line \ No newline at end of file +3: Line + + +1:Line +{ +2 NextLine +} +3 Third \ No newline at end of file