From e4cfbad59b0129c7cb56664718c5f975e5c83ae7 Mon Sep 17 00:00:00 2001 From: duali Date: Tue, 19 Feb 2019 14:55:43 +0100 Subject: [PATCH 1/4] updated composer to require php 5.6 and older version of phpuit --- composer.json | 4 +- composer.lock | 844 ++++++++++++++++++++++++-------------------------- 2 files changed, 404 insertions(+), 444 deletions(-) diff --git a/composer.json b/composer.json index aaebddc..13393cd 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,10 @@ } ], "require": { - "php": "^7.1" + "php": "^5.6" }, "require-dev": { - "phpunit/phpunit": "^7", + "phpunit/phpunit": "^5.7", "php-coveralls/php-coveralls": "^2" }, "suggest": { diff --git a/composer.lock b/composer.lock index 1ccedf7..3b24b79 100644 --- a/composer.lock +++ b/composer.lock @@ -1,41 +1,40 @@ { "_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#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "hash": "6a7c44c0d294e517bfc3f5cc1969b7ed", - "content-hash": "88fa0cd3f22dcdaf0472bfd239cf2168", + "content-hash": "a1dd7ec812ff92829b253da337569c4b", "packages": [], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -60,7 +59,7 @@ "constructor", "instantiate" ], - "time": "2017-07-22 11:58:36" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "guzzlehttp/guzzle", @@ -125,7 +124,7 @@ "rest", "web service" ], - "time": "2018-04-22 15:46:56" + "time": "2018-04-22T15:46:56+00:00" }, { "name": "guzzlehttp/promises", @@ -176,36 +175,37 @@ "keywords": [ "promise" ], - "time": "2016-12-20 10:07:11" + "time": "2016-12-20T10:07:11+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.4.2", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "reference": "9f83dded91781a01c63574e387eaa769be769115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -235,38 +235,36 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20 17:10:46" + "time": "2018-12-04T20:46:45+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.8.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", "shasum": "" }, "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^4.1" }, "type": "library", "autoload": { @@ -289,109 +287,7 @@ "object", "object graph" ], - "time": "2018-06-11 23:09:50" - }, - { - "name": "phar-io/manifest", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08 19:23:20" - }, - { - "name": "phar-io/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2018-07-08 19:19:57" + "time": "2017-10-19T19:58:43+00:00" }, { "name": "php-coveralls/php-coveralls", @@ -474,7 +370,7 @@ "github", "test" ], - "time": "2018-05-22 23:11:08" + "time": "2018-05-22T23:11:08+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -528,39 +424,33 @@ "reflection", "static analysis" ], - "time": "2017-09-11 18:02:19" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", "shasum": "" }, "require": { - "php": "^7.0", + "php": "^5.6 || ^7.0", "phpdocumentor/reflection-common": "^1.0.0", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -579,7 +469,7 @@ } ], "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-11-30 07:14:17" + "time": "2017-11-10T14:09:06+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -626,7 +516,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14 14:27:02" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", @@ -689,44 +579,44 @@ "spy", "stub" ], - "time": "2018-08-05 17:53:17" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "6.0.7", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", - "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -741,7 +631,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -752,29 +642,29 @@ "testing", "xunit" ], - "time": "2018-06-01 07:51:50" + "time": "2017-04-02T07:44:40+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.1", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cecbc684605bb0cc288828eb5d65d93d5c676d3c", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -789,7 +679,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -799,7 +689,7 @@ "filesystem", "iterator" ], - "time": "2018-06-11 11:44:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -840,32 +730,32 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", - "version": "2.0.0", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", - "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -880,7 +770,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -889,33 +779,33 @@ "keywords": [ "timer" ], - "time": "2018-02-01 13:07:23" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "3.0.0", + "version": "1.4.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.1" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "~4.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -938,57 +828,55 @@ "keywords": [ "tokenizer" ], - "time": "2018-02-01 13:16:43" + "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", - "version": "7.3.5", + "version": "5.7.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7b331efabbb628c518c408fdfcaf571156775de2" + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b331efabbb628c518c408fdfcaf571156775de2", - "reference": "7b331efabbb628c518c408fdfcaf571156775de2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.0", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0.1" + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" }, "conflict": { - "phpunit/phpunit-mock-objects": "*" + "phpdocumentor/reflection-docblock": "3.0.2" }, "require-dev": { "ext-pdo": "*" }, "suggest": { - "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "phpunit/php-invoker": "~1.1" }, "bin": [ "phpunit" @@ -996,7 +884,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.3-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -1022,7 +910,67 @@ "testing", "xunit" ], - "time": "2018-09-08 15:14:29" + "time": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2017-06-30T09:13:00+00:00" }, { "name": "psr/http-message", @@ -1072,20 +1020,20 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -1119,7 +1067,47 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1164,34 +1152,34 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04 06:30:41" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "3.0.2", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1222,39 +1210,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "homepage": "http://www.github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2018-07-12 15:12:46" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", - "version": "3.0.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "366541b989927187c4ca70490a35615d3fef2dce" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", - "reference": "366541b989927187c4ca70490a35615d3fef2dce", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -1279,37 +1266,34 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "diff" ], - "time": "2018-06-10 07:54:39" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1334,34 +1318,34 @@ "environment", "hhvm" ], - "time": "2017-07-01 08:51:00" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1401,27 +1385,27 @@ "export", "exporter" ], - "time": "2017-04-03 13:19:02" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.2" }, "suggest": { "ext-uopz": "*" @@ -1429,7 +1413,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1452,34 +1436,33 @@ "keywords": [ "global state" ], - "time": "2017-04-27 15:39:26" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1499,77 +1482,32 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03 12:35:26" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29 09:07:27" + "time": "2017-02-18T15:18:39+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1597,7 +1535,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03 06:23:57" + "time": "2016-11-19T07:33:16+00:00" }, { "name": "sebastian/resource-operations", @@ -1639,7 +1577,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", @@ -1682,35 +1620,36 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "symfony/config", - "version": "v4.1.4", + "version": "v3.4.22", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "76015a3cc372b14d00040ff58e18e29f69eba717" + "reference": "c9bc510c217075d42d4a927e285917d0c2001cf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/76015a3cc372b14d00040ff58e18e29f69eba717", - "reference": "76015a3cc372b14d00040ff58e18e29f69eba717", + "url": "https://api.github.com/repos/symfony/config/zipball/c9bc510c217075d42d4a927e285917d0c2001cf4", + "reference": "c9bc510c217075d42d4a927e285917d0c2001cf4", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/filesystem": "~3.4|~4.0", + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<3.4" + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" }, "require-dev": { - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/finder": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "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" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -1718,7 +1657,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1745,40 +1684,44 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-08-08 06:37:38" + "time": "2019-01-30T11:33:42+00:00" }, { "name": "symfony/console", - "version": "v4.1.4", + "version": "v3.4.22", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f" + "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ca80b8ced97cf07390078b29773dc384c39eee1f", - "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f", + "url": "https://api.github.com/repos/symfony/console/zipball/069bf3f0e8f871a2169a06e43d9f3f03f355e9be", + "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { "symfony/dependency-injection": "<3.4", "symfony/process": "<3.3" }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", + "symfony/config": "~3.3|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0" + "symfony/process": "~3.3|~4.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -1786,7 +1729,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1813,30 +1756,86 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-26 11:24:31" + "time": "2019-01-25T10:42:12+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", + "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "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/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-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": "2019-01-25T10:19:25+00:00" }, { "name": "symfony/filesystem", - "version": "v4.1.4", + "version": "v3.4.22", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e" + "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e", - "reference": "c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b52454ec66fe5082b7a66a491339d1f1da9a5a0d", + "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1863,11 +1862,11 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-08-18 16:52:46" + "time": "2019-01-16T13:27:11+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -1921,20 +1920,20 @@ "polyfill", "portable" ], - "time": "2018-08-06 14:22:27" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -1980,29 +1979,29 @@ "portable", "shim" ], - "time": "2018-08-06 14:22:27" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.1.4", + "version": "v3.4.22", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "966c982df3cca41324253dc0c7ffe76b6076b705" + "reference": "2a651c2645c10bbedd21170771f122d935e0dd58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/966c982df3cca41324253dc0c7ffe76b6076b705", - "reference": "966c982df3cca41324253dc0c7ffe76b6076b705", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2a651c2645c10bbedd21170771f122d935e0dd58", + "reference": "2a651c2645c10bbedd21170771f122d935e0dd58", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2029,24 +2028,24 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-07-26 11:00:49" + "time": "2019-01-16T09:39:14+00:00" }, { "name": "symfony/yaml", - "version": "v4.1.4", + "version": "v3.4.22", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "b832cc289608b6d305f62149df91529a2ab3c314" + "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b832cc289608b6d305f62149df91529a2ab3c314", - "reference": "b832cc289608b6d305f62149df91529a2ab3c314", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -2061,7 +2060,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2088,64 +2087,25 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-08-18 16:52:46" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07 12:08:54" + "time": "2019-01-16T10:59:17+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -2178,7 +2138,7 @@ "check", "validate" ], - "time": "2018-01-29 19:49:41" + "time": "2018-12-25T11:19:39+00:00" } ], "aliases": [], @@ -2187,7 +2147,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.1" + "php": "^5.6" }, "platform-dev": [] } From 3d8bfa3cb8622d232103b3258a755170a2b41c11 Mon Sep 17 00:00:00 2001 From: "Francois L.A. Knoppel" Date: Wed, 20 Feb 2019 11:03:38 +0100 Subject: [PATCH 2/4] Transpilation process and PHP-CS-Fixer rules --- .php_cs | 18 ++++++++++++++++++ PHP5_TRANSPILATION.md | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .php_cs create mode 100644 PHP5_TRANSPILATION.md diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..c7e4265 --- /dev/null +++ b/.php_cs @@ -0,0 +1,18 @@ +notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php') + ->in(__DIR__.DIRECTORY_SEPARATOR."src") +; + +return PhpCsFixer\Config::create() + ->setRules([ + 'line_ending' => true, + 'single_blank_line_at_eof' => true, + 'class_attributes_separation' => true, + 'single_line_after_imports' => true, + 'blank_line_before_statement' => ['statements' => ['return', 'case', 'default', 'foreach']], + ]) + ->setLineEnding("\n") + ->setFinder($finder) +; \ No newline at end of file diff --git a/PHP5_TRANSPILATION.md b/PHP5_TRANSPILATION.md new file mode 100644 index 0000000..86cdc34 --- /dev/null +++ b/PHP5_TRANSPILATION.md @@ -0,0 +1,20 @@ +# Transpilation from PHP7 code to PHP5.6 + +To allow this library to run on PHP5.6 the following process was used: + +## 1. Install transpilation library and run transpilation +The library used is: https://packagist.org/packages/janpiet/php-version-transpiler +Note that it requires PHP7 to run. +- `composer global require janpiet/php-version-transpiler:dev-master` +- `php-version-transpiler src src` + +## 2. Additional replaces +The following seems to have been skipped by the transpiler library +`find ./src/ -type f -print0 | xargs -0 sed -i -r 's/public const/const/g'` + +## 3. Code reformatting +The PHP transpiler uses the Nikic PHP parser and thus does not retain the original formatting of the file. +To reduce unnecessary diffs, we run the code through PHP-CS-Fixer. +Be aware that this is not perfect and will still result in whitespace changes. +- `composer global require friendsofphp/php-cs-fixer` +- `php-cs-fixer fix` \ No newline at end of file From 442a0aa8d46e2418f9b7557974622f829c559c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20L=2EA=2E=20Knoppel?= Date: Tue, 26 Feb 2019 15:46:17 +0100 Subject: [PATCH 3/4] Executed backporting commands --- src/Delta/Delta.php | 26 ++++---- src/Delta/GithubMarkdown/Delta.php | 6 +- src/Delta/GithubMarkdown/Strike.php | 7 +- src/Delta/Html/Bold.php | 7 +- src/Delta/Html/Color.php | 7 +- src/Delta/Html/Compound.php | 14 ++-- src/Delta/Html/CompoundImage.php | 10 +-- src/Delta/Html/Delta.php | 25 ++++--- src/Delta/Html/Header.php | 9 +-- src/Delta/Html/Image.php | 7 +- src/Delta/Html/Insert.php | 14 ++-- src/Delta/Html/Italic.php | 7 +- src/Delta/Html/Link.php | 7 +- src/Delta/Html/ListItem.php | 15 ++--- src/Delta/Html/Strike.php | 7 +- src/Delta/Html/SubScript.php | 7 +- src/Delta/Html/SuperScript.php | 7 +- src/Delta/Html/Underline.php | 7 +- src/Delta/Html/Video.php | 7 +- src/Delta/Markdown/Bold.php | 7 +- src/Delta/Markdown/Compound.php | 13 ++-- src/Delta/Markdown/Delta.php | 10 ++- src/Delta/Markdown/Header.php | 10 +-- src/Delta/Markdown/Image.php | 6 +- src/Delta/Markdown/Insert.php | 7 +- src/Delta/Markdown/Italic.php | 7 +- src/Delta/Markdown/Link.php | 6 +- src/Delta/Markdown/ListItem.php | 15 ++--- src/Delta/Markdown/Video.php | 6 +- src/Interfaces/DeltaInterface.php | 24 +++---- src/Interfaces/ParserAttributeInterface.php | 1 - src/Interfaces/ParserInterface.php | 13 ++-- src/Interfaces/ParserSplitInterface.php | 5 +- src/Interfaces/RendererInterface.php | 5 +- src/Options.php | 29 +++++++- src/Parser/GithubMarkdown.php | 2 - src/Parser/Html.php | 74 +++++---------------- src/Parser/Markdown.php | 19 ++---- src/Parser/Parse.php | 55 ++++++++------- src/Render.php | 29 +++----- src/RenderMultiple.php | 23 ++----- src/Renderer/GithubMarkdown.php | 1 - src/Renderer/Html.php | 27 ++------ src/Renderer/Markdown.php | 4 +- src/Renderer/Render.php | 5 +- 45 files changed, 216 insertions(+), 383 deletions(-) diff --git a/src/Delta/Delta.php b/src/Delta/Delta.php index 55b1397..16fb59d 100644 --- a/src/Delta/Delta.php +++ b/src/Delta/Delta.php @@ -1,7 +1,5 @@ children[] = $delta; } @@ -57,7 +55,7 @@ public function addChild(Delta $delta): void * * @return Delta[] */ - public function children(): array + public function children() { return array_reverse($this->children); } @@ -67,7 +65,7 @@ public function children(): array * * @return boolean */ - public function hasChildren(): bool + public function hasChildren() { if (count($this->children) > 0) { return true; @@ -81,7 +79,7 @@ public function hasChildren(): bool * * @return boolean */ - public function isChild(): bool + public function isChild() { return false; } @@ -91,7 +89,7 @@ public function isChild(): bool * * @return boolean */ - public function isFirstChild(): bool + public function isFirstChild() { return $this->is_first_child; } @@ -101,7 +99,7 @@ public function isFirstChild(): bool * * @return boolean */ - public function isLastChild(): bool + public function isLastChild() { return $this->is_last_child; } @@ -111,7 +109,7 @@ public function isLastChild(): bool * * @return array */ - public function getAttributes(): array + public function getAttributes() { return $this->attributes; } @@ -121,7 +119,7 @@ public function getAttributes(): array * * @return string */ - public function getInsert(): string + public function getInsert() { return $this->insert; } @@ -132,7 +130,7 @@ public function getInsert(): string * * @return string */ - abstract public function render(): string; + public abstract function render(); /** * Set the current delta to be the first child, alternatively, @@ -142,7 +140,7 @@ abstract public function render(): string; * * @return Delta */ - public function setFirstChild(bool $value = true): Delta + public function setFirstChild($value = true) { $this->is_first_child = $value; @@ -157,7 +155,7 @@ public function setFirstChild(bool $value = true): Delta * * @return Delta */ - public function setLastChild(bool $value = true): Delta + public function setLastChild($value = true) { $this->is_last_child = $value; @@ -171,5 +169,5 @@ public function setLastChild(bool $value = true): Delta * * @return string */ - abstract protected function escape(string $insert): string; + protected abstract function escape($insert); } diff --git a/src/Delta/GithubMarkdown/Delta.php b/src/Delta/GithubMarkdown/Delta.php index 914c406..46aad58 100644 --- a/src/Delta/GithubMarkdown/Delta.php +++ b/src/Delta/GithubMarkdown/Delta.php @@ -1,7 +1,5 @@ token = Options::GITHUB_MARKDOWN_TOKEN_STRIKE; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->token . $this->escape($this->insert) . $this->token; } diff --git a/src/Delta/Html/Bold.php b/src/Delta/Html/Bold.php index 5425af8..fd86e38 100644 --- a/src/Delta/Html/Bold.php +++ b/src/Delta/Html/Bold.php @@ -1,7 +1,5 @@ tag = Options::HTML_TAG_BOLD; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->renderSimpleTag($this->tag, $this->escape($this->insert)); } diff --git a/src/Delta/Html/Color.php b/src/Delta/Html/Color.php index e9d1e5f..7a78eda 100644 --- a/src/Delta/Html/Color.php +++ b/src/Delta/Html/Color.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; - $this->tag = 'span'; } @@ -28,7 +25,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return "<{$this->tag} style=\"color: {$this->attributes['color']};\">{$this->escape($this->insert)}tag}>"; } diff --git a/src/Delta/Html/Compound.php b/src/Delta/Html/Compound.php index fe368a6..f9d5958 100644 --- a/src/Delta/Html/Compound.php +++ b/src/Delta/Html/Compound.php @@ -1,7 +1,5 @@ insert = $insert; - $this->tags = []; $this->element_attributes = []; $this->html = ''; @@ -47,7 +44,7 @@ public function __construct(string $insert) /** * Tags */ - private function tags(): void + private function tags() { foreach ($this->attributes as $attribute => $value) { switch ($attribute) { @@ -86,7 +83,7 @@ private function tags(): void * * @return Compound */ - public function setAttribute($attribute, $value): Compound + public function setAttribute($attribute, $value) { $this->attributes[$attribute] = $value; @@ -98,11 +95,11 @@ public function setAttribute($attribute, $value): Compound * * @return string */ - public function render(): string + public function render() { $this->tags(); - $element_attributes = ''; + foreach ($this->element_attributes as $attribute => $value) { $element_attributes .= "{$attribute}=\"{$value}\" "; } @@ -114,7 +111,6 @@ public function render(): string $this->html .= "<{$tag}>"; } } - $this->html .= $this->escape($this->insert); foreach (array_reverse($this->tags) as $tag) { diff --git a/src/Delta/Html/CompoundImage.php b/src/Delta/Html/CompoundImage.php index 149e0cb..28678dd 100644 --- a/src/Delta/Html/CompoundImage.php +++ b/src/Delta/Html/CompoundImage.php @@ -1,7 +1,5 @@ insert = $insert; } @@ -31,7 +29,7 @@ public function __construct(string $insert) * * @return CompoundImage */ - public function setAttribute($attribute, $value): CompoundImage + public function setAttribute($attribute, $value) { $this->attributes[$attribute] = $value; @@ -43,12 +41,14 @@ public function setAttribute($attribute, $value): CompoundImage * * @return string */ - public function render(): string + public function render() { $image_attributes = ''; + foreach ($this->attributes as $attribute => $value) { $image_attributes .= "{$attribute}=\"{$value}\" "; } + return "insert}\" {$image_attributes}/>"; } } diff --git a/src/Delta/Html/Delta.php b/src/Delta/Html/Delta.php index 66d552b..f50a9b4 100644 --- a/src/Delta/Html/Delta.php +++ b/src/Delta/Html/Delta.php @@ -1,7 +1,5 @@ close; } @@ -51,7 +50,7 @@ public function close(): bool * * @return string */ - public function displayType(): string + public function displayType() { return self::DISPLAY_INLINE; } @@ -61,7 +60,7 @@ public function displayType(): string * * @return boolean */ - public function newLine(): bool + public function newLine() { return $this->new_line; } @@ -71,7 +70,7 @@ public function newLine(): bool * * @return string|null */ - public function parentTag(): ?string + public function parentTag() { return null; } @@ -81,7 +80,7 @@ public function parentTag(): ?string * * @return boolean */ - public function preNewLine(): bool + public function preNewLine() { return $this->pre_new_line; } @@ -103,7 +102,7 @@ public function setClose() * * @return Delta */ - public function setNewLine(bool $value = true): Delta + public function setNewLine($value = true) { $this->new_line = $value; @@ -117,7 +116,7 @@ public function setNewLine(bool $value = true): Delta * * @return Delta */ - public function setPreNewLine(bool $value = true): Delta + public function setPreNewLine($value = true) { $this->pre_new_line = $value; @@ -133,7 +132,7 @@ public function setPreNewLine(bool $value = true): Delta * * @return string */ - protected function renderSimpleTag($tag, $insert, $new_line = false): string + protected function renderSimpleTag($tag, $insert, $new_line = false) { return "<{$tag}>{$insert}" . ($new_line === true ? "\n" : null); } @@ -145,7 +144,7 @@ protected function renderSimpleTag($tag, $insert, $new_line = false): string * * @return string */ - protected function escape(string $insert): string + protected function escape($insert) { return htmlspecialchars($insert, ENT_COMPAT, 'UTF-8'); } diff --git a/src/Delta/Html/Header.php b/src/Delta/Html/Header.php index e471133..ad673d8 100644 --- a/src/Delta/Html/Header.php +++ b/src/Delta/Html/Header.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; - $this->tag = Options::HTML_TAG_HEADER . $this->attributes['header']; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function displayType(): string + public function displayType() { return parent::DISPLAY_BLOCK; } @@ -44,7 +41,7 @@ public function displayType(): string * * @return string */ - public function render(): string + public function render() { return $this->renderSimpleTag($this->tag, $this->escape($this->insert), true); } diff --git a/src/Delta/Html/Image.php b/src/Delta/Html/Image.php index 7b16bf7..79010ea 100644 --- a/src/Delta/Html/Image.php +++ b/src/Delta/Html/Image.php @@ -1,7 +1,5 @@ tag = null; - $this->insert = $insert; $this->attributes = $attributes; } @@ -32,7 +29,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return "escape($this->insert)}\" />"; } diff --git a/src/Delta/Html/Insert.php b/src/Delta/Html/Insert.php index 0c48840..2f16fcd 100644 --- a/src/Delta/Html/Insert.php +++ b/src/Delta/Html/Insert.php @@ -1,7 +1,5 @@ tag = null; - $this->insert = $insert; $this->attributes = $attributes; } @@ -32,29 +29,26 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { $html = ''; - $add_span = false; if (count($this->attributes) > 0) { $add_span = true; } - if ($this->preNewLine() === true) { $html .= "
\n"; } - if ($add_span === false) { $html .= $this->escape($this->insert); } else { $html .= 'attributes as $attribute => $value) { + + foreach ($this->attributes as $attribute => $value) { $html .= " {$attribute}=\"{$value}\""; } $html .= ">{$this->escape($this->insert)}"; } - if ($this->newLine() === true) { $html .= "
\n"; } diff --git a/src/Delta/Html/Italic.php b/src/Delta/Html/Italic.php index 66ae42c..50d814d 100644 --- a/src/Delta/Html/Italic.php +++ b/src/Delta/Html/Italic.php @@ -1,7 +1,5 @@ tag = Options::HTML_TAG_ITALIC; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->renderSimpleTag($this->tag, $this->escape($this->insert)); } diff --git a/src/Delta/Html/Link.php b/src/Delta/Html/Link.php index a04b602..c378284 100644 --- a/src/Delta/Html/Link.php +++ b/src/Delta/Html/Link.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; - $this->tag = 'a'; } @@ -32,7 +29,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return "<{$this->tag} href=\"{$this->attributes['link']}\">{$this->escape($this->insert)}tag}>"; } diff --git a/src/Delta/Html/ListItem.php b/src/Delta/Html/ListItem.php index c74d9d3..226f9ec 100644 --- a/src/Delta/Html/ListItem.php +++ b/src/Delta/Html/ListItem.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; - $this->tag = Options::HTML_TAG_LIST_ITEM; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function displayType(): string + public function displayType() { return parent::DISPLAY_BLOCK; } @@ -44,7 +41,7 @@ public function displayType(): string * * @return boolean */ - public function isChild(): bool + public function isChild() { return true; } @@ -54,12 +51,13 @@ public function isChild(): bool * * @return string|null */ - public function parentTag(): ?string + public function parentTag() { switch ($this->attributes['list']) { case Options::ATTRIBUTE_LIST_ORDERED: return Options::HTML_TAG_LIST_ORDERED; break; + case Options::ATTRIBUTE_LIST_BULLET: return Options::HTML_TAG_LIST_UNORDERED; break; @@ -75,11 +73,10 @@ public function parentTag(): ?string * * @return string */ - public function render(): string + public function render() { $html = "<{$this->tag}>"; if ($this->hasChildren() === true) { - foreach ($this->children() as $child) { $html .= $child->render(); } diff --git a/src/Delta/Html/Strike.php b/src/Delta/Html/Strike.php index 4a59ffb..24b8b9c 100644 --- a/src/Delta/Html/Strike.php +++ b/src/Delta/Html/Strike.php @@ -1,7 +1,5 @@ tag = Options::HTML_TAG_STRIKE; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->renderSimpleTag($this->tag, $this->escape($this->insert)); } diff --git a/src/Delta/Html/SubScript.php b/src/Delta/Html/SubScript.php index ae86881..88b1d3a 100644 --- a/src/Delta/Html/SubScript.php +++ b/src/Delta/Html/SubScript.php @@ -1,7 +1,5 @@ tag = Options::HTML_TAG_SUB_SCRIPT; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->renderSimpleTag($this->tag, $this->escape($this->insert)); } diff --git a/src/Delta/Html/SuperScript.php b/src/Delta/Html/SuperScript.php index 9f1e01d..e30391f 100644 --- a/src/Delta/Html/SuperScript.php +++ b/src/Delta/Html/SuperScript.php @@ -1,7 +1,5 @@ tag = Options::HTML_TAG_SUPER_SCRIPT; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->renderSimpleTag($this->tag, $this->escape($this->insert)); } diff --git a/src/Delta/Html/Underline.php b/src/Delta/Html/Underline.php index cdfe796..c5c5e1b 100644 --- a/src/Delta/Html/Underline.php +++ b/src/Delta/Html/Underline.php @@ -1,7 +1,5 @@ tag = Options::HTML_TAG_UNDERLINE; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->renderSimpleTag($this->tag, $this->escape($this->insert)); } diff --git a/src/Delta/Html/Video.php b/src/Delta/Html/Video.php index 02beae8..0c7379d 100644 --- a/src/Delta/Html/Video.php +++ b/src/Delta/Html/Video.php @@ -1,7 +1,5 @@ tag = null; - $this->insert = $insert; $this->attributes = $attributes; } @@ -32,7 +29,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return ''; } diff --git a/src/Delta/Markdown/Bold.php b/src/Delta/Markdown/Bold.php index 2de81b6..9fd11a8 100644 --- a/src/Delta/Markdown/Bold.php +++ b/src/Delta/Markdown/Bold.php @@ -1,7 +1,5 @@ token = Options::MARKDOWN_TOKEN_BOLD; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->token . $this->escape($this->insert) . $this->token; } diff --git a/src/Delta/Markdown/Compound.php b/src/Delta/Markdown/Compound.php index cf1e492..d588b3e 100644 --- a/src/Delta/Markdown/Compound.php +++ b/src/Delta/Markdown/Compound.php @@ -1,7 +1,5 @@ insert = $insert; - $this->tokens = []; } @@ -44,7 +41,7 @@ public function __construct(string $insert) * * @return Compound */ - public function setAttribute($attribute, $value): Compound + public function setAttribute($attribute, $value) { $this->attributes[$attribute] = $value; @@ -54,7 +51,7 @@ public function setAttribute($attribute, $value): Compound /** * Convert attributes to tokens */ - private function tokens(): void + private function tokens() { foreach ($this->attributes as $attribute => $value) { switch ($attribute) { @@ -77,16 +74,14 @@ private function tokens(): void * * @return string */ - public function render(): string + public function render() { $return = ''; - $this->tokens(); foreach ($this->tokens as $token) { $return .= $token; } - $return .= $this->escape($this->insert); foreach (array_reverse($this->tokens) as $token) { diff --git a/src/Delta/Markdown/Delta.php b/src/Delta/Markdown/Delta.php index 8c1cd37..cb29bf9 100644 --- a/src/Delta/Markdown/Delta.php +++ b/src/Delta/Markdown/Delta.php @@ -1,7 +1,5 @@ new_line; } @@ -37,7 +35,7 @@ public function newLine(): bool * * @return Delta */ - public function setNewLine(): Delta + public function setNewLine() { if (preg_match("/[\n]{1}/", $this->insert) !== 0) { $this->new_line = true; @@ -53,8 +51,8 @@ public function setNewLine(): Delta * * @return string */ - protected function escape(string $insert): string + protected function escape($insert) { - return str_replace(['*', '#'], ['\*', '\#'], $insert); + return str_replace(['*', '#'], ['\\*', '\\#'], $insert); } } diff --git a/src/Delta/Markdown/Header.php b/src/Delta/Markdown/Header.php index dd55f13..cfefaf0 100644 --- a/src/Delta/Markdown/Header.php +++ b/src/Delta/Markdown/Header.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; - $this->token = Options::MARKDOWN_TOKEN_HEADER; } @@ -34,9 +31,8 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { - return str_repeat('#', intval($this->attributes['header'])) . - " {$this->escape($this->insert)}"; + return str_repeat('#', intval($this->attributes['header'])) . " {$this->escape($this->insert)}"; } } diff --git a/src/Delta/Markdown/Image.php b/src/Delta/Markdown/Image.php index 0dd9a39..94e493c 100644 --- a/src/Delta/Markdown/Image.php +++ b/src/Delta/Markdown/Image.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; @@ -30,7 +28,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return "![Image]({$this->escape($this->insert)})"; } diff --git a/src/Delta/Markdown/Insert.php b/src/Delta/Markdown/Insert.php index ea53de2..cc42513 100644 --- a/src/Delta/Markdown/Insert.php +++ b/src/Delta/Markdown/Insert.php @@ -1,7 +1,5 @@ token = null; - $this->insert = $insert; $this->attributes = $attributes; } @@ -32,7 +29,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->escape($this->insert); } diff --git a/src/Delta/Markdown/Italic.php b/src/Delta/Markdown/Italic.php index 7455aee..39044d0 100644 --- a/src/Delta/Markdown/Italic.php +++ b/src/Delta/Markdown/Italic.php @@ -1,7 +1,5 @@ token = Options::MARKDOWN_TOKEN_ITALIC; - $this->insert = $insert; $this->attributes = $attributes; } @@ -34,7 +31,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return $this->token . $this->escape($this->insert) . $this->token; } diff --git a/src/Delta/Markdown/Link.php b/src/Delta/Markdown/Link.php index 78fa96f..11e005e 100644 --- a/src/Delta/Markdown/Link.php +++ b/src/Delta/Markdown/Link.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; @@ -30,7 +28,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { $append = str_replace(trim($this->insert), '', $this->insert); diff --git a/src/Delta/Markdown/ListItem.php b/src/Delta/Markdown/ListItem.php index 4d2ab4a..ffc9f19 100644 --- a/src/Delta/Markdown/ListItem.php +++ b/src/Delta/Markdown/ListItem.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; - $this->token = null; - if ($this->attributes['list'] === 'bullet') { $this->token = Options::MARKDOWN_TOKEN_LIST_ITEM_UNORDERED; } @@ -42,7 +38,7 @@ public function __construct(string $insert, array $attributes = []) * * @return Delta */ - public function setCounter(int $counter): Delta + public function setCounter($counter) { $this->counter = $counter; @@ -54,7 +50,7 @@ public function setCounter(int $counter): Delta * * @return boolean */ - public function isChild(): bool + public function isChild() { return true; } @@ -64,22 +60,19 @@ public function isChild(): bool * * @return string */ - public function render(): string + public function render() { $output = ''; - if ($this->token === null) { $output .= $this->counter . ". "; } else { $output .= $this->token; } - if ($this->hasChildren() === true) { foreach ($this->children() as $child) { $output .= $child->render(); } } - $output .= $this->escape($this->insert); return $output; diff --git a/src/Delta/Markdown/Video.php b/src/Delta/Markdown/Video.php index 91bb433..7447ef2 100644 --- a/src/Delta/Markdown/Video.php +++ b/src/Delta/Markdown/Video.php @@ -1,7 +1,5 @@ insert = $insert; $this->attributes = $attributes; @@ -31,7 +29,7 @@ public function __construct(string $insert, array $attributes = []) * * @return string */ - public function render(): string + public function render() { return "![Video]({$this->escape($this->insert)})"; } diff --git a/src/Interfaces/DeltaInterface.php b/src/Interfaces/DeltaInterface.php index 6dd7761..20c5bfb 100644 --- a/src/Interfaces/DeltaInterface.php +++ b/src/Interfaces/DeltaInterface.php @@ -1,7 +1,5 @@ class_delta_strike = Strike::class; } diff --git a/src/Parser/Html.php b/src/Parser/Html.php index f5ae32c..1ad0ca4 100644 --- a/src/Parser/Html.php +++ b/src/Parser/Html.php @@ -1,5 +1,4 @@ class_delta_bold = Bold::class; $this->class_delta_color = Color::class; $this->class_delta_header = Header::class; @@ -66,57 +64,39 @@ public function __construct() * * @return array array of inserts, two indexes, insert and close */ - public function splitInsertsOnNewLines($insert): array + public function splitInsertsOnNewLines($insert) { $inserts = []; - if (preg_match("/[\n]{2,}/", $insert) !== 0) { - $splits = (preg_split("/[\n]{2,}/", $insert)); + $splits = preg_split("/[\n]{2,}/", $insert); $i = 0; - foreach (preg_split("/[\n]{2,}/", $insert) as $match) { + foreach (preg_split("/[\n]{2,}/", $insert) as $match) { $close = false; - $sub_inserts = $this->splitInsertsOnNewLine($match); - if (count($sub_inserts) > 0) { if (count($sub_inserts) === 1) { if ($i === 0 || $i !== count($splits) - 1) { $close = true; } - - $inserts[] = [ - 'insert' => $sub_inserts[0]['insert'], - 'close' => $close, - 'new_line' => false, - 'pre_new_line' => false - ]; + $inserts[] = ['insert' => $sub_inserts[0]['insert'], 'close' => $close, 'new_line' => false, 'pre_new_line' => false]; } else { $count = count($sub_inserts); $i = 0; + foreach ($sub_inserts as $sub_insert) { - $inserts[] = [ - 'insert' => $sub_insert['insert'], - 'close' => (($count - 1) === $i ? true : $sub_insert['close']), - 'new_line' => $sub_insert['new_line'], - 'pre_new_line' => $sub_insert['pre_new_line'] - ]; + $inserts[] = ['insert' => $sub_insert['insert'], 'close' => $count - 1 === $i ? true : $sub_insert['close'], 'new_line' => $sub_insert['new_line'], 'pre_new_line' => $sub_insert['pre_new_line']]; $i++; } } } - $i++; } } else { $sub_inserts = $this->splitInsertsOnNewLine($insert); + foreach ($sub_inserts as $sub_insert) { - $inserts[] = [ - 'insert' => $sub_insert['insert'], - 'close' => $sub_insert['close'], - 'new_line' => $sub_insert['new_line'], - 'pre_new_line' => $sub_insert['pre_new_line'] - ]; + $inserts[] = ['insert' => $sub_insert['insert'], 'close' => $sub_insert['close'], 'new_line' => $sub_insert['new_line'], 'pre_new_line' => $sub_insert['pre_new_line']]; } } @@ -131,10 +111,9 @@ public function splitInsertsOnNewLines($insert): array * * @return array array of inserts, three indexes, insert, close and new_line */ - public function splitInsertsOnNewLine($insert): array + public function splitInsertsOnNewLine($insert) { $inserts = []; - if (preg_match("/[\n]{1}/", rtrim($insert, "\n")) !== 0) { $matches = preg_split("/[\n]{1}/", rtrim($insert, "\n")); $i = 0; @@ -144,18 +123,13 @@ public function splitInsertsOnNewLine($insert): array $sub_insert = str_replace("\n", '', $match); $new_line = true; $pre_new_line = false; - if ($i === (count($matches) - 1)) { + if ($i === count($matches) - 1) { $new_line = false; } if ($i === 1 && count($inserts) === 0) { $pre_new_line = true; } - $inserts[] = [ - 'insert' => $sub_insert, - 'close' => false, - 'new_line' => $new_line, - 'pre_new_line' => $pre_new_line - ]; + $inserts[] = ['insert' => $sub_insert, 'close' => false, 'new_line' => $new_line, 'pre_new_line' => $pre_new_line]; } $i++; } @@ -164,13 +138,7 @@ public function splitInsertsOnNewLine($insert): array if (strpos($insert, "\n") !== FALSE) { $new_line = true; } - - $inserts[] = [ - 'insert' => str_replace("\n", '', $insert), - 'close' => false, - 'new_line' => $new_line, - 'pre_new_line' => false - ]; + $inserts[] = ['insert' => str_replace("\n", '', $insert), 'close' => false, 'new_line' => $new_line, 'pre_new_line' => false]; } return $inserts; @@ -189,9 +157,7 @@ public function attributeList(array $quill) if (in_array($quill['attributes'][OPTIONS::ATTRIBUTE_LIST], array('ordered', 'bullet')) === true) { $insert = $this->deltas[count($this->deltas) - 1]->getInsert(); $attributes = $this->deltas[count($this->deltas) - 1]->getAttributes(); - unset($this->deltas[count($this->deltas) - 1]); - if (count($attributes) === 0) { $this->deltas[] = new ListItem($insert, $quill['attributes']); } else { @@ -238,29 +204,20 @@ public function attributeList(array $quill) } $this->deltas[] = $delta; } - $this->deltas = array_values($this->deltas); - $current_index = count($this->deltas) - 1; - for ($i = $current_index - 1; $i >= 0; $i--) { $this_delta = $this->deltas[$i]; - if ( - $this_delta->displayType() === Delta::DISPLAY_BLOCK || - $this_delta->newLine() === true || - $this_delta->close() === true - ) { + if ($this_delta->displayType() === Delta::DISPLAY_BLOCK || $this_delta->newLine() === true || $this_delta->close() === true) { break; } else { $this->deltas[$current_index]->addChild($this->deltas[$i]); unset($this->deltas[$i]); } } - $this->deltas = array_values($this->deltas); $current_index = count($this->deltas) - 1; - $previous_index = $current_index -1; - + $previous_index = $current_index - 1; if ($previous_index < 0) { $this->deltas[$current_index]->setFirstChild(); $this->deltas[$current_index]->setLastChild(); @@ -338,10 +295,10 @@ public function compoundInsert(array $quill) } else { $delta = new CompoundImage($quill['insert']['image']); } + foreach ($quill['attributes'] as $attribute => $value) { $delta->setAttribute($attribute, $value); } - $this->deltas[] = $delta; } } @@ -369,7 +326,6 @@ public function extendedInsert(array $quill) if (array_key_exists('pre_new_line', $insert) === true && $insert['pre_new_line'] === true) { $delta->setPreNewLine(); } - $this->deltas[] = $delta; } } diff --git a/src/Parser/Markdown.php b/src/Parser/Markdown.php index 483f14c..c564ba4 100644 --- a/src/Parser/Markdown.php +++ b/src/Parser/Markdown.php @@ -1,5 +1,4 @@ counter = 1; - $this->class_delta_bold = Bold::class; $this->class_delta_header = Header::class; $this->class_delta_image = Image::class; @@ -66,9 +63,7 @@ public function attributeList(array $quill) if (in_array($quill['attributes'][OPTIONS::ATTRIBUTE_LIST], array('ordered', 'bullet')) === true) { $insert = $this->deltas[count($this->deltas) - 1]->getInsert(); $attributes = $this->deltas[count($this->deltas) - 1]->getAttributes(); - unset($this->deltas[count($this->deltas) - 1]); - if (count($attributes) === 0) { $this->deltas[] = new ListItem($insert . "\n", $quill['attributes']); } else { @@ -94,11 +89,8 @@ public function attributeList(array $quill) } $this->deltas[] = $delta; } - $this->deltas = array_values($this->deltas); - $current_index = count($this->deltas) - 1; - for ($i = $current_index - 1; $i >= 0; $i--) { $this_delta = $this->deltas[$i]->setNewLine(); if ($this_delta->newLine() === true) { @@ -108,11 +100,9 @@ public function attributeList(array $quill) unset($this->deltas[$i]); } } - $this->deltas = array_values($this->deltas); $current_index = count($this->deltas) - 1; - $previous_index = $current_index -1; - + $previous_index = $current_index - 1; if ($previous_index < 0) { $this->counter = 1; $this->deltas[$current_index]->setFirstChild()->setCounter($this->counter); @@ -198,7 +188,6 @@ public function compoundInsert(array $quill) foreach ($quill['attributes'] as $attribute => $value) { $delta->setAttribute($attribute, $value); } - $this->deltas[] = $delta; } } @@ -217,9 +206,10 @@ public function extendedInsert(array $quill) if (preg_match("/[\n]{2,}/", $quill['insert']) !== 0) { $sub_inserts = preg_split("/[\n]{2,}/", $quill['insert']); $i = 0; + foreach ($sub_inserts as $match) { $append = "\n\n"; - if ($i === (count($sub_inserts)-1)) { + if ($i === count($sub_inserts) - 1) { $append = null; } $this->deltas[] = new Insert($match . $append); @@ -229,9 +219,10 @@ public function extendedInsert(array $quill) if (preg_match("/[\n]{1}/", $quill['insert']) !== 0) { $sub_inserts = preg_split("/[\n]{1}/", $quill['insert']); $i = 0; + foreach ($sub_inserts as $match) { $append = "\n"; - if ($i === (count($sub_inserts)-1)) { + if ($i === count($sub_inserts) - 1) { $append = null; } $this->deltas[] = new Insert($match . $append); diff --git a/src/Parser/Parse.php b/src/Parser/Parse.php index 6405e96..e3946f6 100644 --- a/src/Parser/Parse.php +++ b/src/Parser/Parse.php @@ -1,5 +1,4 @@ quill_json = json_decode($quill_json, true); - if (is_array($this->quill_json) === true && count($this->quill_json) > 0) { $this->valid = true; $this->deltas = []; + return $this; } else { throw new \InvalidArgumentException('Unable to decode the json'); @@ -101,20 +108,19 @@ public function load(string $quill_json): Parse * @return Parse * @throws \InvalidArgumentException Throws an exception if there was an error decoding the json */ - public function loadMultiple(array $quill_json): Parse + public function loadMultiple(array $quill_json) { $this->deltas_stack = []; foreach ($quill_json as $index => $json) { $json_stack_value = json_decode($json, true); - if (is_array($json_stack_value) === true && count($json_stack_value) > 0) { $this->quill_json_stack[$index] = $json_stack_value; } } - if (count($quill_json) === count($this->quill_json_stack)) { $this->valid = true; + return $this; } else { throw new \InvalidArgumentException('Unable to decode all the json and assign to the stack'); @@ -126,21 +132,14 @@ public function loadMultiple(array $quill_json): Parse * * @return boolean */ - public function parse(): bool + public function parse() { - if ( - $this->valid === true && - array_key_exists('ops', $this->quill_json) === true - ) { + if ($this->valid === true && array_key_exists('ops', $this->quill_json) === true) { $this->quill_json = $this->quill_json['ops']; foreach ($this->quill_json as $quill) { - if ($quill['insert'] !== null) { - if ( - array_key_exists('attributes', $quill) === true && - is_array($quill['attributes']) === true - ) { + if (array_key_exists('attributes', $quill) === true && is_array($quill['attributes']) === true) { if (count($quill['attributes']) === 1) { foreach ($quill['attributes'] as $attribute => $value) { switch ($attribute) { @@ -195,14 +194,17 @@ public function parse(): bool if (is_array($quill['insert']) === true) { if (array_key_exists('image', $quill['insert']) === true) { $this->image($quill); - } else if (array_key_exists('video', $quill['insert']) === true) { - $this->video($quill); + } else { + if (array_key_exists('video', $quill['insert']) === true) { + $this->video($quill); + } } } } } } } + return true; } else { return false; @@ -215,9 +217,10 @@ public function parse(): bool * * @return boolean */ - public function parseMultiple(): bool + public function parseMultiple() { $results = []; + foreach ($this->quill_json_stack as $index => $quill_json) { $this->quill_json = $quill_json; $this->deltas = []; @@ -226,7 +229,6 @@ public function parseMultiple(): bool $this->deltas_stack[$index] = $this->deltas(); } } - if (in_array(false, $results) === false) { return true; } else { @@ -239,7 +241,7 @@ public function parseMultiple(): bool * * @return array */ - public function deltas(): array + public function deltas() { return $this->deltas; } @@ -252,14 +254,12 @@ public function deltas(): array * @return array * @throws \OutOfRangeException */ - public function deltasByIndex(string $index): array + public function deltasByIndex($index) { if (array_key_exists($index, $this->deltas_stack) === true) { return $this->deltas_stack[$index]; } else { - throw new \OutOfRangeException( - 'Deltas array does not exist for the given index: ' . $index - ); + throw new \OutOfRangeException('Deltas array does not exist for the given index: ' . $index); } } @@ -319,10 +319,7 @@ public function attributeItalic(array $quill) public function attributeLink(array $quill) { if (strlen($quill['attributes'][OPTIONS::ATTRIBUTE_LINK]) > 0) { - $this->deltas[] = new $this->class_delta_link( - $quill['insert'], - $quill['attributes'] - ); + $this->deltas[] = new $this->class_delta_link($quill['insert'], $quill['attributes']); } } diff --git a/src/Render.php b/src/Render.php index 2f765ee..09ce45c 100644 --- a/src/Render.php +++ b/src/Render.php @@ -1,5 +1,4 @@ parser = new Parser\GithubMarkdown(); break; + case Options::FORMAT_HTML: $this->parser = new Parser\Html(); break; + case Options::FORMAT_MARKDOWN: $this->parser = new Parser\Markdown(); break; + default: - throw new \InvalidArgumentException( - 'Requested $format not supported, formats supported, ' . - implode( - ', ', - [Options::FORMAT_HTML, OPTIONS::FORMAT_MARKDOWN] - ) - ); + throw new \InvalidArgumentException('Requested $format not supported, formats supported, ' . implode(', ', [Options::FORMAT_HTML, OPTIONS::FORMAT_MARKDOWN])); break; } - $this->format = $format; - try { $this->parser->load($quill_json); } catch (\InvalidArgumentException $e) { @@ -71,28 +65,25 @@ public function __construct(string $quill_json, string $format = Options::FORMAT * @throws \InvalidArgumentException * @throws \Exception */ - public function render(bool $trim = false): string + public function render($trim = false) { if ($this->parser->parse() === true) { switch ($this->format) { case Options::FORMAT_GITHUB_MARKDOWN: $renderer = new Renderer\GithubMarkdown(); break; + case Options::FORMAT_HTML: $renderer = new Renderer\Html(); break; + case Options::FORMAT_MARKDOWN: $renderer = new Renderer\Markdown(); break; + default: // Shouldn't be possible to get here - throw new \InvalidArgumentException( - 'Requested $format not supported, formats supported, ' . - implode( - ', ', - [Options::FORMAT_HTML, OPTIONS::FORMAT_MARKDOWN] - ) - ); + throw new \InvalidArgumentException('Requested $format not supported, formats supported, ' . implode(', ', [Options::FORMAT_HTML, OPTIONS::FORMAT_MARKDOWN])); break; } diff --git a/src/RenderMultiple.php b/src/RenderMultiple.php index d341a74..0fdb659 100644 --- a/src/RenderMultiple.php +++ b/src/RenderMultiple.php @@ -1,5 +1,4 @@ parser = new Parser\Html(); break; + default: - throw new \InvalidArgumentException( - 'Requested $format not supported, formats supported, ' . - Options::FORMAT_HTML - ); + throw new \InvalidArgumentException('Requested $format not supported, formats supported, ' . Options::FORMAT_HTML); break; } - $this->format = $format; - try { $this->parser->loadMultiple($quill_json); - } catch (\InvalidArgumentException $e){ + } catch (\InvalidArgumentException $e) { throw new \InvalidArgumentException($e->getMessage()); } } @@ -65,23 +60,19 @@ public function __construct(array $quill_json, string $format = Options::FORMAT_ * @throws \BadMethodCallException * @throws \OutOfRangeException */ - public function render(string $index, bool $trim = false): string + public function render($index, $trim = false) { if ($this->parser->parseMultiple() !== true) { throw new \Exception('Failed to parse the supplied $quill_json arrays'); } - $deltas = $this->parser->deltasByIndex($index); - switch ($this->format) { case Options::FORMAT_HTML: $renderer = new Renderer\Html(); break; + default: - throw new \InvalidArgumentException( - 'Requested $format not supported, formats supported, ' . - Options::FORMAT_HTML - ); + throw new \InvalidArgumentException('Requested $format not supported, formats supported, ' . Options::FORMAT_HTML); break; } diff --git a/src/Renderer/GithubMarkdown.php b/src/Renderer/GithubMarkdown.php index 6b638f3..82ebb9d 100644 --- a/src/Renderer/GithubMarkdown.php +++ b/src/Renderer/GithubMarkdown.php @@ -1,5 +1,4 @@ output = ''; - $block_open = false; foreach ($this->deltas as $i => $delta) { @@ -47,41 +45,24 @@ public function render(bool $trim = false): string $block_open = true; $this->output .= '

'; } - if ($delta->isChild() === true && $delta->isFirstChild() === true) { - - if ( - $block_open === true && - $this->deltas[$i - 1]->displayType() === Delta::DISPLAY_INLINE - ) { + if ($block_open === true && $this->deltas[$i - 1]->displayType() === Delta::DISPLAY_INLINE) { $this->output .= "

\n"; } - $this->output .= '<' . $delta->parentTag() . ">\n"; } - $this->output .= $delta->render(); - - if ( - $delta->displayType() === Delta::DISPLAY_INLINE && - $block_open === true && $delta->close() === true - ) { + if ($delta->displayType() === Delta::DISPLAY_INLINE && $block_open === true && $delta->close() === true) { $this->output .= "

\n"; $block_open = false; } - if ($delta->isChild() === true && $delta->isLastChild() === true) { $this->output .= 'parentTag() . ">\n"; } - - if ( - $i === count($this->deltas) - 1 && - $delta->displayType() === Delta::DISPLAY_INLINE && $block_open === true - ) { + if ($i === count($this->deltas) - 1 && $delta->displayType() === Delta::DISPLAY_INLINE && $block_open === true) { $this->output .= "

\n"; } } - if ($trim === false) { return $this->output; } else { diff --git a/src/Renderer/Markdown.php b/src/Renderer/Markdown.php index 091a2b8..1de6179 100644 --- a/src/Renderer/Markdown.php +++ b/src/Renderer/Markdown.php @@ -1,5 +1,4 @@ output = ''; foreach ($this->deltas as $i => $delta) { $this->output .= $delta->render(); } - if ($trim === false) { return $this->output; } else { diff --git a/src/Renderer/Render.php b/src/Renderer/Render.php index 635c8cd..e7dfd1e 100644 --- a/src/Renderer/Render.php +++ b/src/Renderer/Render.php @@ -1,5 +1,4 @@ deltas = $deltas; @@ -59,5 +58,5 @@ public function load(array $deltas) : Render * * @return string */ - abstract public function render(bool $trim = false): string; + public abstract function render($trim = false); } From 687d08986042a68f7ff5478709d8066e9856f6ae Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 2 Apr 2019 15:51:26 +0200 Subject: [PATCH 4/4] disallow soft enter for HTML rendering --- src/Parser/Html.php | 25 +++++++++++++++++++++---- src/Render.php | 7 ++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/Parser/Html.php b/src/Parser/Html.php index 1ad0ca4..8b129a3 100644 --- a/src/Parser/Html.php +++ b/src/Parser/Html.php @@ -38,13 +38,21 @@ class Html extends Parse implements ParserSplitInterface, ParserAttributeInterfa * @var Delta[] */ protected $deltas; + + /** @var bool */ + private $allow_soft_enter; /** * Constructor. + * + * @param bool $allow_soft_enter Optional, default true */ - public function __construct() + public function __construct($allow_soft_enter = true) { parent::__construct(); + + $this->allow_soft_enter = $allow_soft_enter; + $this->class_delta_bold = Bold::class; $this->class_delta_color = Color::class; $this->class_delta_header = Header::class; @@ -67,11 +75,20 @@ public function __construct() public function splitInsertsOnNewLines($insert) { $inserts = []; - if (preg_match("/[\n]{2,}/", $insert) !== 0) { - $splits = preg_split("/[\n]{2,}/", $insert); + + $doubleEndOfLinePattern = "/[\n]{2,}/"; + $singleEndOfLinePattern = "/[\n]+/"; + + $end_of_line_pattern = $doubleEndOfLinePattern; + if ($this->allow_soft_enter === false) { + $end_of_line_pattern = $singleEndOfLinePattern; + } + + if (preg_match($end_of_line_pattern, $insert) !== 0) { + $splits = preg_split($end_of_line_pattern, $insert); $i = 0; - foreach (preg_split("/[\n]{2,}/", $insert) as $match) { + foreach (preg_split($end_of_line_pattern, $insert) as $match) { $close = false; $sub_inserts = $this->splitInsertsOnNewLine($match); if (count($sub_inserts) > 0) { diff --git a/src/Render.php b/src/Render.php index 09ce45c..fdab616 100644 --- a/src/Render.php +++ b/src/Render.php @@ -25,11 +25,12 @@ class Render * Renderer constructor, pass in the $quill_json string and set the requested output format * * @param string $quill_json - * @param string $format Requested output format + * @param string $format Requested output format + * @param bool $allow_soft_enter Optional, default true * * @throws \InvalidArgumentException */ - public function __construct($quill_json, $format = Options::FORMAT_HTML) + public function __construct($quill_json, $format = Options::FORMAT_HTML, $allow_soft_enter = true) { switch ($format) { case Options::FORMAT_GITHUB_MARKDOWN: @@ -37,7 +38,7 @@ public function __construct($quill_json, $format = Options::FORMAT_HTML) break; case Options::FORMAT_HTML: - $this->parser = new Parser\Html(); + $this->parser = new Parser\Html($allow_soft_enter); break; case Options::FORMAT_MARKDOWN: