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
diff --git a/composer.json b/composer.json
index 5aca14f..09325c9 100644
--- a/composer.json
+++ b/composer.json
@@ -15,11 +15,11 @@
}
],
"require": {
- "php": "^7.1",
- "ext-json": "*"
+ "php": "^5.6",
+ "ext-json": "^1.2"
},
"require-dev": {
- "phpunit/phpunit": "^7",
+ "phpunit/phpunit": "^5.7",
"php-coveralls/php-coveralls": "^2"
},
"suggest": {
diff --git a/composer.lock b/composer.lock
index e8f1335..ddae905 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,37 +4,37 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "c885cd3cce2d83e57036969840f27f13",
+ "content-hash": "b0750de64ab99716c36da22a9c888dda",
"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": {
@@ -59,7 +59,7 @@
"constructor",
"instantiate"
],
- "time": "2017-07-22T11:58:36+00:00"
+ "time": "2015-06-14T21:17:01+00:00"
},
{
"name": "guzzlehttp/guzzle",
@@ -246,28 +246,25 @@
},
{
"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": {
@@ -290,109 +287,7 @@
"object",
"object graph"
],
- "time": "2018-06-11T23:09:50+00:00"
- },
- {
- "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-08T19:23:20+00:00"
- },
- {
- "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-08T19:19:57+00:00"
+ "time": "2017-10-19T19:58:43+00:00"
},
{
"name": "php-coveralls/php-coveralls",
@@ -533,35 +428,29 @@
},
{
"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\\": [
@@ -580,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-30T07:14:17+00:00"
+ "time": "2017-11-10T14:09:06+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@@ -694,40 +583,40 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "6.1.4",
+ "version": "4.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d"
+ "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d",
- "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d",
+ "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 || ^4.0",
- "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.1-dev"
+ "dev-master": "4.0.x-dev"
}
},
"autoload": {
@@ -742,7 +631,7 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
+ "email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
@@ -753,32 +642,29 @@
"testing",
"xunit"
],
- "time": "2018-10-31T16:06:48+00:00"
+ "time": "2017-04-02T07:44:40+00:00"
},
{
"name": "phpunit/php-file-iterator",
- "version": "2.0.2",
+ "version": "1.4.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "050bedf145a257b1ff02746c31894800e5122946"
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946",
- "reference": "050bedf145a257b1ff02746c31894800e5122946",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
"shasum": ""
},
"require": {
- "php": "^7.1"
- },
- "require-dev": {
- "phpunit/phpunit": "^7.1"
+ "php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "1.4.x-dev"
}
},
"autoload": {
@@ -793,7 +679,7 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
+ "email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
@@ -803,7 +689,7 @@
"filesystem",
"iterator"
],
- "time": "2018-09-13T20:33:42+00:00"
+ "time": "2017-11-27T13:52:08+00:00"
},
{
"name": "phpunit/php-text-template",
@@ -848,28 +734,28 @@
},
{
"name": "phpunit/php-timer",
- "version": "2.1.1",
+ "version": "1.0.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059"
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b389aebe1b8b0578430bda0c7c95a829608e059",
- "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059",
+ "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.1-dev"
+ "dev-master": "1.0-dev"
}
},
"autoload": {
@@ -884,7 +770,7 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
+ "email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
@@ -893,33 +779,33 @@
"keywords": [
"timer"
],
- "time": "2019-02-20T10:12:59+00:00"
+ "time": "2017-02-26T11:10:40+00:00"
},
{
"name": "phpunit/php-token-stream",
- "version": "3.0.1",
+ "version": "1.4.12",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18"
+ "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c99e3be9d3e85f60646f152f9002d46ed7770d18",
- "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18",
+ "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": {
@@ -942,57 +828,55 @@
"keywords": [
"tokenizer"
],
- "time": "2018-10-30T05:52:18+00:00"
+ "time": "2017-12-04T08:55:13+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "7.5.6",
+ "version": "5.7.27",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9"
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9",
- "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9",
+ "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": "^4.0",
- "sebastian/exporter": "^3.1",
- "sebastian/global-state": "^2.0",
- "sebastian/object-enumerator": "^3.0.3",
- "sebastian/resource-operations": "^2.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"
@@ -1000,7 +884,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "7.5-dev"
+ "dev-master": "5.7.x-dev"
}
},
"autoload": {
@@ -1026,7 +910,67 @@
"testing",
"xunit"
],
- "time": "2019-02-18T09:24:50+00:00"
+ "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",
@@ -1212,30 +1156,30 @@
},
{
"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": {
@@ -1266,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-12T15:12:46+00:00"
+ "time": "2017-01-29T09:50:25+00:00"
},
{
"name": "sebastian/diff",
- "version": "3.0.2",
+ "version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29"
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29",
- "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29",
+ "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.5 || ^8.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": {
@@ -1323,40 +1266,34 @@
"description": "Diff implementation",
"homepage": "https://github.com/sebastianbergmann/diff",
"keywords": [
- "diff",
- "udiff",
- "unidiff",
- "unified diff"
+ "diff"
],
- "time": "2019-02-04T06:01:07+00:00"
+ "time": "2017-05-22T07:24:03+00:00"
},
{
"name": "sebastian/environment",
- "version": "4.1.0",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "6fda8ce1974b62b14935adc02a9ed38252eca656"
+ "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6fda8ce1974b62b14935adc02a9ed38252eca656",
- "reference": "6fda8ce1974b62b14935adc02a9ed38252eca656",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
+ "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
"shasum": ""
},
"require": {
- "php": "^7.1"
+ "php": "^5.6 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "^7.5"
- },
- "suggest": {
- "ext-posix": "*"
+ "phpunit/phpunit": "^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
@@ -1381,34 +1318,34 @@
"environment",
"hhvm"
],
- "time": "2019-02-01T05:27:49+00: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": {
@@ -1448,27 +1385,27 @@
"export",
"exporter"
],
- "time": "2017-04-03T13:19:02+00:00"
+ "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": "*"
@@ -1476,7 +1413,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "1.0-dev"
}
},
"autoload": {
@@ -1499,34 +1436,33 @@
"keywords": [
"global state"
],
- "time": "2017-04-27T15:39:26+00:00"
+ "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": {
@@ -1546,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-03T12:35:26+00:00"
- },
- {
- "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-29T09:07:27+00:00"
+ "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": {
@@ -1644,29 +1535,29 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "time": "2017-03-03T06:23:57+00:00"
+ "time": "2016-11-19T07:33:16+00:00"
},
{
"name": "sebastian/resource-operations",
- "version": "2.0.1",
+ "version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/resource-operations.git",
- "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9"
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9",
- "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
"shasum": ""
},
"require": {
- "php": "^7.1"
+ "php": ">=5.6.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "1.0.x-dev"
}
},
"autoload": {
@@ -1686,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": "2018-10-04T04:07:39+00:00"
+ "time": "2015-07-28T20:34:47+00:00"
},
{
"name": "sebastian/version",
@@ -1733,31 +1624,32 @@
},
{
"name": "symfony/config",
- "version": "v4.2.4",
+ "version": "v3.4.22",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "7f70d79c7a24a94f8e98abb988049403a53d7b31"
+ "reference": "c9bc510c217075d42d4a927e285917d0c2001cf4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/7f70d79c7a24a94f8e98abb988049403a53d7b31",
- "reference": "7f70d79c7a24a94f8e98abb988049403a53d7b31",
+ "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"
@@ -1765,7 +1657,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1792,25 +1684,25 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
- "time": "2019-02-23T15:17:42+00:00"
+ "time": "2019-01-30T11:33:42+00:00"
},
{
"name": "symfony/console",
- "version": "v4.2.4",
+ "version": "v3.4.22",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9"
+ "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/9dc2299a016497f9ee620be94524e6c0af0280a9",
- "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9",
+ "url": "https://api.github.com/repos/symfony/console/zipball/069bf3f0e8f871a2169a06e43d9f3f03f355e9be",
+ "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
- "symfony/contracts": "^1.0",
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/debug": "~2.8|~3.0|~4.0",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
@@ -1822,11 +1714,11 @@
},
"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": "For using the console logger",
@@ -1837,7 +1729,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1864,48 +1756,44 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2019-02-23T15:17:42+00:00"
+ "time": "2019-01-25T10:42:12+00:00"
},
{
- "name": "symfony/contracts",
- "version": "v1.0.2",
+ "name": "symfony/debug",
+ "version": "v3.4.22",
"source": {
"type": "git",
- "url": "https://github.com/symfony/contracts.git",
- "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf"
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf",
- "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8",
+ "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8",
"shasum": ""
},
"require": {
- "php": "^7.1.3"
+ "php": "^5.5.9|>=7.0.8",
+ "psr/log": "~1.0"
},
- "require-dev": {
- "psr/cache": "^1.0",
- "psr/container": "^1.0"
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
},
- "suggest": {
- "psr/cache": "When using the Cache contracts",
- "psr/container": "When using the Service contracts",
- "symfony/cache-contracts-implementation": "",
- "symfony/service-contracts-implementation": "",
- "symfony/translation-contracts-implementation": ""
+ "require-dev": {
+ "symfony/http-kernel": "~2.8|~3.0|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
- "Symfony\\Contracts\\": ""
+ "Symfony\\Component\\Debug\\": ""
},
"exclude-from-classmap": [
- "**/Tests/"
+ "/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -1914,48 +1802,40 @@
],
"authors": [
{
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "A set of abstractions extracted out of the Symfony components",
+ "description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "keywords": [
- "abstractions",
- "contracts",
- "decoupling",
- "interfaces",
- "interoperability",
- "standards"
- ],
- "time": "2018-12-05T08:06:11+00:00"
+ "time": "2019-01-25T10:19:25+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v4.2.4",
+ "version": "v3.4.22",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601"
+ "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/e16b9e471703b2c60b95f14d31c1239f68f11601",
- "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601",
+ "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.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1982,7 +1862,7 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2019-02-07T11:40:08+00:00"
+ "time": "2019-01-16T13:27:11+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -2103,26 +1983,25 @@
},
{
"name": "symfony/stopwatch",
- "version": "v4.2.4",
+ "version": "v3.4.22",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
- "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67"
+ "reference": "2a651c2645c10bbedd21170771f122d935e0dd58"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b1a5f646d56a3290230dbc8edf2a0d62cda23f67",
- "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2a651c2645c10bbedd21170771f122d935e0dd58",
+ "reference": "2a651c2645c10bbedd21170771f122d935e0dd58",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
- "symfony/contracts": "^1.0"
+ "php": "^5.5.9|>=7.0.8"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -2149,24 +2028,24 @@
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
- "time": "2019-01-16T20:31:39+00:00"
+ "time": "2019-01-16T09:39:14+00:00"
},
{
"name": "symfony/yaml",
- "version": "v4.2.4",
+ "version": "v3.4.22",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "761fa560a937fd7686e5274ff89dcfa87a5047df"
+ "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/761fa560a937fd7686e5274ff89dcfa87a5047df",
- "reference": "761fa560a937fd7686e5274ff89dcfa87a5047df",
+ "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": {
@@ -2181,7 +2060,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -2208,47 +2087,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2019-02-23T15:17:42+00:00"
- },
- {
- "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-07T12:08:54+00:00"
+ "time": "2019-01-16T10:59:17+00:00"
},
{
"name": "webmozart/assert",
@@ -2308,8 +2147,8 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": "^7.1",
- "ext-json": "*"
+ "php": "^5.6",
+ "ext-json": "^1.2"
},
"platform-dev": []
}
diff --git a/src/Delta/Delta.php b/src/Delta/Delta.php
index e3f8139..0fd43a7 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 hasAttributes(): bool
+ public function hasAttributes()
{
if (count($this->attributes) > 0) {
return true;
@@ -95,7 +93,7 @@ public function hasAttributes(): bool
*
* @return boolean
*/
- public function isChild(): bool
+ public function isChild()
{
return false;
}
@@ -105,7 +103,7 @@ public function isChild(): bool
*
* @return boolean
*/
- public function isFirstChild(): bool
+ public function isFirstChild()
{
return $this->is_first_child;
}
@@ -115,7 +113,7 @@ public function isFirstChild(): bool
*
* @return boolean
*/
- public function isLastChild(): bool
+ public function isLastChild()
{
return $this->is_last_child;
}
@@ -125,7 +123,7 @@ public function isLastChild(): bool
*
* @return array
*/
- public function getAttributes(): array
+ public function getAttributes()
{
return $this->attributes;
}
@@ -135,7 +133,7 @@ public function getAttributes(): array
*
* @return string
*/
- public function getInsert(): string
+ public function getInsert()
{
return $this->insert;
}
@@ -146,7 +144,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,
@@ -156,7 +154,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;
@@ -171,7 +169,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;
@@ -183,7 +181,7 @@ public function setLastChild(bool $value = true): Delta
*
* @param string $insert
*/
- public function setInsert(string $insert)
+ public function setInsert($insert)
{
$this->insert = $insert;
}
@@ -195,5 +193,5 @@ public function setInsert(string $insert)
*
* @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)}{$this->tag}>";
}
diff --git a/src/Delta/Html/Compound.php b/src/Delta/Html/Compound.php
index bc53ee4..98982cf 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 = '';
@@ -57,7 +54,7 @@ public function __construct(string $insert)
/**
* Tags
*/
- private function tags(): void
+ private function tags()
{
foreach ($this->attributes as $attribute => $value) {
switch ($attribute) {
@@ -96,7 +93,7 @@ private function tags(): void
*
* @return Compound
*/
- public function setAttribute($attribute, $value): Compound
+ public function setAttribute($attribute, $value)
{
if ($attribute !== 'link') {
$this->attributes[$attribute] = $value;
@@ -113,18 +110,17 @@ public function setAttribute($attribute, $value): Compound
*
* @return string
*/
- public function render(): string
+ public function render()
{
$this->tags();
-
if ($this->isLink === true) {
$this->html .= "link}\">";
}
-
$element_attributes = '';
+
foreach ($this->element_attributes as $attribute => $value) {
if ($attribute == "color") {
- $element_attributes .= "style=\"{$attribute}: $value\"";
+ $element_attributes .= "style=\"{$attribute}: {$value}\"";
} else {
$element_attributes .= "{$attribute}=\"{$value}\" ";
}
@@ -137,13 +133,11 @@ public function render(): string
$this->html .= "<{$tag}>";
}
}
-
$this->html .= $this->escape($this->insert);
foreach (array_reverse($this->tags) as $tag) {
$this->html .= "{$tag}>";
}
-
if ($this->isLink === true) {
$this->html .= '';
}
@@ -157,15 +151,12 @@ public function render(): string
*
* @return array
*/
- public function getAttributes(): array
+ public function getAttributes()
{
if ($this->isLink === false) {
return $this->attributes;
} else {
- return array_merge(
- ['link' => $this->link],
- $this->attributes
- );
+ return array_merge(['link' => $this->link], $this->attributes);
}
}
}
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..19e0d9f 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}{$tag}>" . ($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 63d3a9b..eb5ef7c 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,11 +41,10 @@ public function displayType(): 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/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)}{$this->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 fca3798..993edec 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,7 +31,7 @@ public function __construct(string $insert, array $attributes = [])
*
* @return string
*/
- public function displayType(): string
+ public function displayType()
{
return parent::DISPLAY_BLOCK;
}
@@ -44,11 +41,10 @@ public function displayType(): string
*
* @return string
*/
- public function render(): string
+ public function render()
{
$string = str_repeat('#', intval($this->attributes['header'])) . ' ';
if ($this->hasChildren() === true) {
-
foreach ($this->children() as $child) {
$string .= $child->render();
}
@@ -56,10 +52,7 @@ public function render(): string
$string .= "{$this->escape($this->insert)}";
return $string;
-
-
-
/*return str_repeat('#', intval($this->attributes['header'])) .
- " {$this->escape($this->insert)}";*/
+ " {$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 "})";
}
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 "})";
}
diff --git a/src/Interfaces/DeltaInterface.php b/src/Interfaces/DeltaInterface.php
index 5af7fcb..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 0b8c27a..f94aaee 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;
@@ -67,26 +65,17 @@ public function __construct()
*/
public function attributeList(array $quill)
{
- if (
- in_array(
- $quill['attributes'][OPTIONS::ATTRIBUTE_LIST],
- array('ordered', 'bullet')
- ) === true
- ) {
+ if (in_array($quill['attributes'][OPTIONS::ATTRIBUTE_LIST], array('ordered', 'bullet')) === true) {
$previous_index = count($this->deltas) - 1;
-
$insert = $this->deltas[$previous_index]->getInsert();
$attributes = $this->deltas[$previous_index]->getAttributes();
-
unset($this->deltas[$previous_index]);
-
if (count($attributes) === 0) {
$this->deltas[] = new ListItem($insert, $quill['attributes']);
} else {
$delta = new ListItem("", $quill['attributes']);
-
if (count($attributes) === 1) {
- switch(key($attributes)) {
+ switch (key($attributes)) {
case Options::ATTRIBUTE_BOLD:
$delta->addChild(new Bold($insert));
break;
@@ -125,38 +114,28 @@ public function attributeList(array $quill)
}
} else {
$childDelta = new Compound($insert);
+
foreach ($attributes as $attribute => $value) {
$childDelta->setAttribute($attribute, $value);
}
-
$delta->addChild($childDelta);
}
-
$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();
@@ -186,44 +165,25 @@ public function attributeList(array $quill)
*/
public function attributeHeader(array $quill)
{
- if (
- in_array(
- $quill['attributes'][OPTIONS::ATTRIBUTE_HEADER],
- array(1, 2, 3, 4, 5, 6, 7)
- ) === true
- ) {
+ if (in_array($quill['attributes'][OPTIONS::ATTRIBUTE_HEADER], array(1, 2, 3, 4, 5, 6, 7)) === true) {
$insert[] = $quill['insert'];
-
$this->deltas = array_values($this->deltas);
- $this->deltas[] = new $this->class_delta_header(
- '',
- $quill['attributes']
- );
+ $this->deltas[] = new $this->class_delta_header('', $quill['attributes']);
$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 if ($this_delta->hasAttributes() === true) {
- $this->deltas[$current_index]->addChild($this->deltas[$i]);
- unset($this->deltas[$i]);
} else {
- $this->deltas[$current_index]->addChild(
- new $this->class_delta_insert(
- $this->deltas[$i]->getInsert()
- )
- );
- unset($this->deltas[$i]);
+ if ($this_delta->hasAttributes() === true) {
+ $this->deltas[$current_index]->addChild($this->deltas[$i]);
+ unset($this->deltas[$i]);
+ } else {
+ $this->deltas[$current_index]->addChild(new $this->class_delta_insert($this->deltas[$i]->getInsert()));
+ unset($this->deltas[$i]);
+ }
}
}
-
$this->deltas = array_values($this->deltas);
}
}
@@ -290,10 +250,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;
}
}
@@ -308,12 +268,10 @@ public function compoundInsert(array $quill)
public function insert(array $quill)
{
$insert = $quill['insert'];
-
/**
* @var Delta
*/
- $delta = new $this->class_delta_insert($insert, (array_key_exists('attributes', $quill) ? $quill['attributes'] : []));
-
+ $delta = new $this->class_delta_insert($insert, array_key_exists('attributes', $quill) ? $quill['attributes'] : []);
if (preg_match("/[\n]{2,}/", $insert) !== 0) {
$delta->setClose();
} else {
@@ -321,7 +279,6 @@ public function insert(array $quill)
$delta->setNewLine();
}
}
-
$this->deltas[] = $delta;
}
}
diff --git a/src/Parser/Markdown.php b/src/Parser/Markdown.php
index f88512a..23dc225 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;
@@ -65,9 +62,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 {
@@ -93,11 +88,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) {
@@ -107,11 +99,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);
@@ -197,7 +187,6 @@ public function compoundInsert(array $quill)
foreach ($quill['attributes'] as $attribute => $value) {
$delta->setAttribute($attribute, $value);
}
-
$this->deltas[] = $delta;
}
}
@@ -216,9 +205,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);
@@ -228,9 +218,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 e5543a7..a4306e8 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');
@@ -102,20 +109,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');
@@ -130,38 +136,28 @@ public function loadMultiple(array $quill_json): Parse
*
* @return array
*/
- public function splitInsertsByNewline(array $inserts): array
+ public function splitInsertsByNewline(array $inserts)
{
$new_deltas = [];
foreach ($inserts as $insert) {
-
if ($insert['insert'] !== null) {
-
// Check to see if we are dealing with a media based insert
if (is_array($insert['insert']) === false) {
-
// We only want to split if there are no attributes
if (array_key_exists('attributes', $insert) === false) {
-
// First check for multiple newlines
if (preg_match("/[\n]{2,}/", $insert['insert']) !== 0) {
-
$multiple_matches = preg_split("/[\n]{2,}/", $insert['insert']);
foreach ($multiple_matches as $k => $match) {
-
$newlines = true;
if ($k === count($multiple_matches) - 1) {
$newlines = false;
}
-
// Now check for single new matches
if (preg_match("/[\n]{1}/", $match) !== 0) {
- $new_deltas = array_merge(
- $new_deltas,
- $this->splitOnSingleNewlineOccurrences($match, $newlines)
- );
+ $new_deltas = array_merge($new_deltas, $this->splitOnSingleNewlineOccurrences($match, $newlines));
} else {
$new_deltas[] = ['insert' => $match . ($newlines === true ? "\n\n" : null)];
}
@@ -169,10 +165,7 @@ public function splitInsertsByNewline(array $inserts): array
} else {
// No multiple newlines detected, check for single new line matches
if (preg_match("/[\n]{1}/", $insert['insert']) !== 0) {
- $new_deltas = array_merge(
- $new_deltas,
- $this->splitOnSingleNewlineOccurrences($insert['insert'])
- );
+ $new_deltas = array_merge($new_deltas, $this->splitOnSingleNewlineOccurrences($insert['insert']));
} else {
$new_deltas[] = $insert;
}
@@ -199,27 +192,21 @@ public function splitInsertsByNewline(array $inserts): array
*
* @return array
*/
- public function splitOnSingleNewlineOccurrences(string $insert, bool $newlines = false): array
+ public function splitOnSingleNewlineOccurrences($insert, $newlines = false)
{
$new_deltas = [];
-
$single_matches = preg_split("/[\n]{1,}/", $insert);
foreach ($single_matches as $k => $sub_match) {
-
$final_append = null;
if ($k === count($single_matches) - 1 && $newlines === true) {
$final_append = "\n\n";
}
-
$append = null;
if ($k !== count($single_matches) - 1) {
$append = "\n";
}
-
- $new_deltas[] = [
- 'insert' => $sub_match . ($final_append !== null ? $final_append : $append)
- ];
+ $new_deltas[] = ['insert' => $sub_match . ($final_append !== null ? $final_append : $append)];
}
return $new_deltas;
@@ -230,12 +217,9 @@ public function splitOnSingleNewlineOccurrences(string $insert, bool $newlines =
*
* @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) {
/**
* Before processing through the deltas, generate new deltas by splliting
* on all new lines, will make it much simpler to work out which
@@ -244,12 +228,8 @@ public function parse(): bool
$this->quill_json = $this->splitInsertsByNewline($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) {
@@ -304,14 +284,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;
@@ -324,9 +307,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 = [];
@@ -335,7 +319,6 @@ public function parseMultiple(): bool
$this->deltas_stack[$index] = $this->deltas();
}
}
-
if (in_array(false, $results) === false) {
return true;
} else {
@@ -348,7 +331,7 @@ public function parseMultiple(): bool
*
* @return array
*/
- public function deltas(): array
+ public function deltas()
{
return $this->deltas;
}
@@ -361,14 +344,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);
}
}
@@ -395,18 +376,10 @@ public function attributeBold(array $quill)
*/
public function attributeHeader(array $quill)
{
- if (
- in_array(
- $quill['attributes'][OPTIONS::ATTRIBUTE_HEADER],
- array(1, 2, 3, 4, 5, 6, 7)
- ) === true
- ) {
+ if (in_array($quill['attributes'][OPTIONS::ATTRIBUTE_HEADER], array(1, 2, 3, 4, 5, 6, 7)) === true) {
$insert = $this->deltas[count($this->deltas) - 1]->getInsert();
unset($this->deltas[count($this->deltas) - 1]);
- $this->deltas[] = new $this->class_delta_header(
- $insert,
- $quill['attributes']
- );
+ $this->deltas[] = new $this->class_delta_header($insert, $quill['attributes']);
// Reorder the array
$this->deltas = array_values($this->deltas);
}
@@ -436,10 +409,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']);
}
}
@@ -478,10 +448,7 @@ public function image(array $quill)
*/
public function insert(array $quill)
{
- $this->deltas[] = new $this->class_delta_insert(
- $quill['insert'],
- (array_key_exists('attributes', $quill) ? $quill['attributes'] : [])
- );
+ $this->deltas[] = new $this->class_delta_insert($quill['insert'], array_key_exists('attributes', $quill) ? $quill['attributes'] : []);
}
/**
diff --git a/src/Render.php b/src/Render.php
index 8ffe5ca..485814a 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) {
@@ -72,28 +66,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;
}
@@ -108,7 +99,7 @@ public function render(bool $trim = false): string
*
* @return array|null
*/
- public function deltas(): ?array
+ public function deltas()
{
return $this->parser->deltas();
}
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 a5801b1..e59f36d 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) {
- if (
- $delta->displayType() === Delta::DISPLAY_INLINE &&
- $block_open === false
- ) {
+ if ($delta->displayType() === Delta::DISPLAY_INLINE && $block_open === false) {
$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"; $block_open = false; } - $this->output .= '<' . $delta->parentTag() . ">\n"; } - - if ( - $delta->displayType() === Delta::DISPLAY_BLOCK && - $block_open === true - ) { + if ($delta->displayType() === Delta::DISPLAY_BLOCK && $block_open === true) { $block_open = false; $this->output .= "\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 .= '' . $delta->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 c747f29..b2f31f5 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); }