Merge pull request #22 from kategray/update-phpunit
Update travis configuration and PHPUnit version
diff --git a/.gitignore b/.gitignore
index 8e63c67..a593136 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,13 @@
target
temp
-# Composer files
-vendor
-composer.lock
-
# Eclipse project files
.buildpath
.settings
.project
# PhpStorm project files
-.idea
+.idea/
+
+# Composer Files
+vendor/
diff --git a/.travis.yml b/.travis.yml
index b4db4bd..d6073ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,12 @@
language: php
php:
- - 5.3
- - 5.4
- - 5.5
+ - 7.1
+ - 7.2
+ - 7.3
-services: mongodb
\ No newline at end of file
+script: vendor/bin/phpunit
+
+install: composer install
+
+services: mongodb
diff --git a/composer.json b/composer.json
index c00f6bd..03812c9 100644
--- a/composer.json
+++ b/composer.json
@@ -15,5 +15,8 @@
},
"require": {
"php": ">=5.2.7"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5"
}
}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 0000000..ebda8ea
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,1408 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "51bd61dc3b14b351c5cfebad555dd59f",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "doctrine/instantiator",
+ "version": "1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "a2c590166b2133a4633738648b6b064edae0814a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a",
+ "reference": "a2c590166b2133a4633738648b6b064edae0814a",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1"
+ },
+ "require-dev": {
+ "doctrine/coding-standard": "^6.0",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpbench/phpbench": "^0.13",
+ "phpstan/phpstan-phpunit": "^0.11",
+ "phpstan/phpstan-shim": "^0.11",
+ "phpunit/phpunit": "^7.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
+ "keywords": [
+ "constructor",
+ "instantiate"
+ ],
+ "time": "2019-03-17T17:37:11+00:00"
+ },
+ {
+ "name": "myclabs/deep-copy",
+ "version": "1.9.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea",
+ "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1"
+ },
+ "replace": {
+ "myclabs/deep-copy": "self.version"
+ },
+ "require-dev": {
+ "doctrine/collections": "^1.0",
+ "doctrine/common": "^2.6",
+ "phpunit/phpunit": "^7.1"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ },
+ "files": [
+ "src/DeepCopy/deep_copy.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Create deep copies (clones) of your objects",
+ "keywords": [
+ "clone",
+ "copy",
+ "duplicate",
+ "object",
+ "object graph"
+ ],
+ "time": "2019-08-09T12:45:53+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-common",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+ "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a",
+ "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jaap van Otterdijk",
+ "email": "opensource@ijaap.nl"
+ }
+ ],
+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+ "homepage": "http://www.phpdoc.org",
+ "keywords": [
+ "FQSEN",
+ "phpDocumentor",
+ "phpdoc",
+ "reflection",
+ "static analysis"
+ ],
+ "time": "2018-08-07T13:53:10+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-docblock",
+ "version": "4.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+ "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e",
+ "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0",
+ "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0",
+ "phpdocumentor/type-resolver": "~0.4 || ^1.0.0",
+ "webmozart/assert": "^1.0"
+ },
+ "require-dev": {
+ "doctrine/instantiator": "^1.0.5",
+ "mockery/mockery": "^1.0",
+ "phpunit/phpunit": "^6.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
+ "time": "2019-09-12T14:27:41+00:00"
+ },
+ {
+ "name": "phpdocumentor/type-resolver",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/TypeResolver.git",
+ "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9",
+ "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1",
+ "phpdocumentor/reflection-common": "^2.0"
+ },
+ "require-dev": {
+ "ext-tokenizer": "^7.1",
+ "mockery/mockery": "~1",
+ "phpunit/phpunit": "^7.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
+ "time": "2019-08-22T18:11:29+00:00"
+ },
+ {
+ "name": "phpspec/prophecy",
+ "version": "1.9.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpspec/prophecy.git",
+ "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203",
+ "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.0.2",
+ "php": "^5.3|^7.0",
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
+ "sebastian/comparator": "^1.1|^2.0|^3.0",
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0"
+ },
+ "require-dev": {
+ "phpspec/phpspec": "^2.5|^3.2",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.8.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Prophecy\\": "src/Prophecy"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ },
+ {
+ "name": "Marcello Duarte",
+ "email": "marcello.duarte@gmail.com"
+ }
+ ],
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
+ "homepage": "https://github.com/phpspec/prophecy",
+ "keywords": [
+ "Double",
+ "Dummy",
+ "fake",
+ "mock",
+ "spy",
+ "stub"
+ ],
+ "time": "2019-10-03T11:07:50+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "4.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
+ "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-xmlwriter": "*",
+ "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": {
+ "ext-xdebug": "^2.1.4",
+ "phpunit/phpunit": "^5.7"
+ },
+ "suggest": {
+ "ext-xdebug": "^2.5.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0.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": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "time": "2017-04-02T07:44:40+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "1.4.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.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": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "time": "2017-11-27T13:52:08+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "time": "2015-06-21T13:50:34+00:00"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "1.0.9",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-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": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "time": "2017-02-26T11:10:40+00:00"
+ },
+ {
+ "name": "phpunit/php-token-stream",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+ "reference": "791198a2c6254db10131eecfe8c06670700904db"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
+ "reference": "791198a2c6254db10131eecfe8c06670700904db",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": "^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6.2.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Wrapper around PHP's tokenizer extension.",
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+ "keywords": [
+ "tokenizer"
+ ],
+ "time": "2017-11-27T05:48:46+00:00"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "5.7.27",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-xml": "*",
+ "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": {
+ "phpdocumentor/reflection-docblock": "3.0.2"
+ },
+ "require-dev": {
+ "ext-pdo": "*"
+ },
+ "suggest": {
+ "ext-xdebug": "*",
+ "phpunit/php-invoker": "~1.1"
+ },
+ "bin": [
+ "phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.7.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "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": "sebastian/code-unit-reverse-lookup",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+ "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
+ "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5.7 || ^6.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": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "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-04T06:30:41+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "1.2.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/diff": "~1.2",
+ "sebastian/exporter": "~1.2 || ~2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "time": "2017-01-29T09:50:25+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "1.4.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff"
+ ],
+ "time": "2017-05-22T07:24:03+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
+ "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "time": "2016-11-26T07:53:53+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
+ "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/recursion-context": "~2.0"
+ },
+ "require-dev": {
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "time": "2016-11-19T08:54:04+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "suggest": {
+ "ext-uopz": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "time": "2015-10-12T03:26:01+00:00"
+ },
+ {
+ "name": "sebastian/object-enumerator",
+ "version": "2.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+ "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
+ "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.6",
+ "sebastian/recursion-context": "~2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+ "time": "2017-02-18T15:18:39+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
+ "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+ "time": "2016-11-19T07:33:16+00:00"
+ },
+ {
+ "name": "sebastian/resource-operations",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/resource-operations.git",
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.6.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": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides a list of PHP built-in functions that operate on resources",
+ "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
+ "time": "2015-07-28T20:34:47+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "2.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
+ "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "time": "2016-10-03T07:35:21+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.12.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "550ebaac289296ce228a706d0867afc34687e3f4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
+ "reference": "550ebaac289296ce228a706d0867afc34687e3f4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.12-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "time": "2019-08-06T08:03:45+00:00"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v4.3.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/41e16350a2a1c7383c4735aa2f9fce74cf3d1178",
+ "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "conflict": {
+ "symfony/console": "<3.4"
+ },
+ "require-dev": {
+ "symfony/console": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/console": "For validating YAML files using the lint command"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "https://symfony.com",
+ "time": "2019-09-11T15:41:19+00:00"
+ },
+ {
+ "name": "webmozart/assert",
+ "version": "1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/webmozart/assert.git",
+ "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
+ "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0",
+ "symfony/polyfill-ctype": "^1.8"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.36 || ^7.5.13"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Webmozart\\Assert\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Assertions to validate method input/output with nice error messages.",
+ "keywords": [
+ "assert",
+ "check",
+ "validate"
+ ],
+ "time": "2019-08-24T08:43:50+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=5.2.7"
+ },
+ "platform-dev": []
+}
diff --git a/src/main/php/LoggerLevel.php b/src/main/php/LoggerLevel.php
index 6227bcf..27ac304 100644
--- a/src/main/php/LoggerLevel.php
+++ b/src/main/php/LoggerLevel.php
@@ -72,7 +72,7 @@
/**
* Compares two logger levels.
*
- * @param LoggerLevels $other
+ * @param LoggerLevel $other
* @return boolean
*/
public function equals($other) {
diff --git a/src/main/php/LoggerLoggingEvent.php b/src/main/php/LoggerLoggingEvent.php
index e826b9c..4dafdfd 100644
--- a/src/main/php/LoggerLoggingEvent.php
+++ b/src/main/php/LoggerLoggingEvent.php
@@ -132,7 +132,7 @@
$this->timeStamp = microtime(true);
}
- if ($throwable !== null && $throwable instanceof Exception) {
+ if ($throwable !== null && $throwable instanceof Throwable) {
$this->throwableInfo = new LoggerThrowableInformation($throwable);
}
}
diff --git a/src/main/php/LoggerReflectionUtils.php b/src/main/php/LoggerReflectionUtils.php
index e046185..ef39f9e 100644
--- a/src/main/php/LoggerReflectionUtils.php
+++ b/src/main/php/LoggerReflectionUtils.php
@@ -35,45 +35,47 @@
public function __construct($obj) {
$this->obj = $obj;
}
-
- /**
- * Set the properties of an object passed as a parameter in one
- * go. The <code>properties</code> are parsed relative to a
- * <code>prefix</code>.
- *
- * @param object $obj The object to configure.
- * @param array $properties An array containing keys and values.
- * @param string $prefix Only keys having the specified prefix will be set.
- */
+
+ /**
+ * Set the properties of an object passed as a parameter in one
+ * go. The <code>properties</code> are parsed relative to a
+ * <code>prefix</code>.
+ *
+ * @param object $obj The object to configure.
+ * @param array $properties An array containing keys and values.
+ * @param string $prefix Only keys having the specified prefix will be set.
+ * @throws Exception
+ */
// TODO: check, if this is really useful
public static function setPropertiesByObject($obj, $properties, $prefix) {
$pSetter = new LoggerReflectionUtils($obj);
return $pSetter->setProperties($properties, $prefix);
}
-
-
- /**
- * Set the properites for the object that match the
- * <code>prefix</code> passed as parameter.
- *
- * Example:
- *
- * $arr['xxxname'] = 'Joe';
- * $arr['xxxmale'] = true;
- * and prefix xxx causes setName and setMale.
- *
- * @param array $properties An array containing keys and values.
- * @param string $prefix Only keys having the specified prefix will be set.
- */
+
+
+ /**
+ * Set the properties for the object that match the
+ * <code>prefix</code> passed as parameter.
+ *
+ * Example:
+ *
+ * $arr['xxxname'] = 'Joe';
+ * $arr['xxxmale'] = true;
+ * and prefix xxx causes setName and setMale.
+ *
+ * @param array $properties An array containing keys and values.
+ * @param string $prefix Only keys having the specified prefix will be set.
+ * @throws Exception
+ */
public function setProperties($properties, $prefix) {
$len = strlen($prefix);
reset($properties);
- while(list($key,) = each($properties)) {
+ foreach ($properties as $key => $value) {
if(strpos($key, $prefix) === 0) {
if(strpos($key, '.', ($len + 1)) > 0) {
continue;
}
- $value = $properties[$key];
+
$key = substr($key, $len);
if($key == 'layout' and ($this->obj instanceof LoggerAppender)) {
continue;
@@ -83,22 +85,23 @@
}
$this->activate();
}
-
- /**
- * Set a property on this PropertySetter's Object. If successful, this
- * method will invoke a setter method on the underlying Object. The
- * setter is the one for the specified property name and the value is
- * determined partly from the setter argument type and partly from the
- * value specified in the call to this method.
- *
- * <p>If the setter expects a String no conversion is necessary.
- * If it expects an int, then an attempt is made to convert 'value'
- * to an int using new Integer(value). If the setter expects a boolean,
- * the conversion is by new Boolean(value).
- *
- * @param string $name name of the property
- * @param string $value String value of the property
- */
+
+ /**
+ * Set a property on this PropertySetter's Object. If successful, this
+ * method will invoke a setter method on the underlying Object. The
+ * setter is the one for the specified property name and the value is
+ * determined partly from the setter argument type and partly from the
+ * value specified in the call to this method.
+ *
+ * <p>If the setter expects a String no conversion is necessary.
+ * If it expects an int, then an attempt is made to convert 'value'
+ * to an int using new Integer(value). If the setter expects a boolean,
+ * the conversion is by new Boolean(value).
+ *
+ * @param string $name name of the property
+ * @param string $value String value of the property
+ * @return mixed|void
+ */
public function setProperty($name, $value) {
if($value === null) {
return;
@@ -131,12 +134,13 @@
}
return null;
}
-
- /**
- * @param object $object
- * @param string $name
- * @param mixed $value
- */
+
+ /**
+ * @param object $object
+ * @param string $name
+ * @param mixed $value
+ * @return bool|mixed
+ */
public static function setter($object, $name, $value) {
if (empty($name)) {
return false;
diff --git a/src/main/php/LoggerThrowableInformation.php b/src/main/php/LoggerThrowableInformation.php
index 20bf758..0015210 100644
--- a/src/main/php/LoggerThrowableInformation.php
+++ b/src/main/php/LoggerThrowableInformation.php
@@ -26,26 +26,25 @@
*/
class LoggerThrowableInformation {
- /** @var Exception Throwable to log */
+ /** @var Throwable Throwable to log */
private $throwable;
/** @var array Array of throwable messages */
private $throwableArray;
-
- /**
- * Create a new instance
- *
- * @param $throwable - a throwable as a exception
- * @param $logger - Logger reference
- */
- public function __construct(Exception $throwable) {
+
+ /**
+ * Create a new instance
+ *
+ * @param Throwable $throwable - a throwable as a exception
+ */
+ public function __construct(Throwable $throwable) {
$this->throwable = $throwable;
}
/**
* Return source exception
*
- * @return Exception
+ * @return Throwable
*/
public function getThrowable() {
return $this->throwable;
diff --git a/src/main/php/appenders/LoggerAppenderRollingFile.php b/src/main/php/appenders/LoggerAppenderRollingFile.php
index b8b5557..5835779 100644
--- a/src/main/php/appenders/LoggerAppenderRollingFile.php
+++ b/src/main/php/appenders/LoggerAppenderRollingFile.php
@@ -219,7 +219,7 @@
}
// Rollover if needed
- if (filesize(realpath($this->file)) > $this->maxFileSize) {
+ if (file_exists (realpath($this->file)) && filesize(realpath($this->file)) > $this->maxFileSize) {
try {
$this->rollOver();
} catch (LoggerException $ex) {
diff --git a/src/main/php/configurators/LoggerConfigurationAdapterPHP.php b/src/main/php/configurators/LoggerConfigurationAdapterPHP.php
index b07f383..99769b1 100644
--- a/src/main/php/configurators/LoggerConfigurationAdapterPHP.php
+++ b/src/main/php/configurators/LoggerConfigurationAdapterPHP.php
@@ -56,19 +56,17 @@
}
// Load the config file
- $data = @file_get_contents($url);
- if ($data === false) {
+ if (!file_exists($url)) {
$error = error_get_last();
throw new LoggerException("Error loading config file: {$error['message']}");
}
-
- $config = @eval('?>' . $data);
-
- if ($config === false) {
- $error = error_get_last();
- throw new LoggerException("Error parsing configuration: " . $error['message']);
- }
-
+
+ try {
+ $config = require_once($url);
+ } catch (ParseError $exception) {
+ throw new LoggerException("Error parsing configuration: " . $exception->getMessage());
+ }
+
if (empty($config)) {
throw new LoggerException("Invalid configuration: empty configuration array.");
}
diff --git a/src/site/xdoc/install.xml b/src/site/xdoc/install.xml
index f0b5b52..82572c2 100644
--- a/src/site/xdoc/install.xml
+++ b/src/site/xdoc/install.xml
@@ -60,6 +60,30 @@
</pre>
</subsection>
+
+ <subsection name="From Composer">
+
+ <p>Apache log4php is available from <a href="https://packagist.org/packages/apache/log4php">Packagist</a> via <a href="http://getcomposer.org/">Composer</a>. Please note: this channel is not an official Apache Software Foundation channel,
+ but maintained from Apache log4php committers.</p>
+
+ <p>To with compoers, add the following lines to composer.json:</p>
+
+<pre>
+"require": {
+ "apache/log4php": "2.3.0"
+}
+</pre>
+ <p>Then run:</p>
+
+<pre>
+php composer.phar install
+</pre>
+ <p>Or, if you have composer installed as binary:</p>
+
+<pre>
+composer install
+</pre>
+ </subsection>
</section>
</body>
</document>
diff --git a/src/test/php/LoggerAppenderPoolTest.php b/src/test/php/LoggerAppenderPoolTest.php
index e34e823..25f6c5f 100644
--- a/src/test/php/LoggerAppenderPoolTest.php
+++ b/src/test/php/LoggerAppenderPoolTest.php
@@ -22,15 +22,17 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group filters
*/
-class LoggerAppenderPoolTest extends PHPUnit_Framework_TestCase {
+class LoggerAppenderPoolTest extends TestCase {
private $appenderMock;
public function setUp() {
- $this->appenderMock = $this->getMock('LoggerAppenderConsole', array(), array(), '', false);
+ $this->appenderMock = $this->createMock('LoggerAppenderConsole', array(), array(), '', false);
}
/**
diff --git a/src/test/php/LoggerAppenderTest.php b/src/test/php/LoggerAppenderTest.php
index 24288d4..ede23e4 100644
--- a/src/test/php/LoggerAppenderTest.php
+++ b/src/test/php/LoggerAppenderTest.php
@@ -22,10 +22,12 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group appenders
*/
-class LoggerAppenderTest extends PHPUnit_Framework_TestCase {
+class LoggerAppenderTest extends TestCase {
public function testThreshold() {
$appender = new LoggerAppenderEcho("LoggerAppenderTest");
diff --git a/src/test/php/LoggerConfiguratorTest.php b/src/test/php/LoggerConfiguratorTest.php
index 74ea63c..2cbad44 100644
--- a/src/test/php/LoggerConfiguratorTest.php
+++ b/src/test/php/LoggerConfiguratorTest.php
@@ -1,5 +1,7 @@
<?php
+use PHPUnit\Framework\TestCase;
+
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -34,7 +36,7 @@
* @group configurators
*
*/
- class LoggerConfiguratorTest extends PHPUnit_Framework_TestCase
+ class LoggerConfiguratorTest extends TestCase
{
/** Reset configuration after each test. */
public function setUp() {
@@ -98,7 +100,7 @@
* @expectedExceptionMessage Invalid configuration provided for appender
*/
public function testAppenderConfigNotArray() {
- $hierachyMock = $this->getMock('LoggerHierarchy', array(), array(), '', false);
+ $hierachyMock = $this->createMock('LoggerHierarchy', array(), array(), '', false);
$config = array(
'appenders' => array(
diff --git a/src/test/php/LoggerExceptionTest.php b/src/test/php/LoggerExceptionTest.php
index 2419500..6f2d3de 100644
--- a/src/test/php/LoggerExceptionTest.php
+++ b/src/test/php/LoggerExceptionTest.php
@@ -1,4 +1,7 @@
<?php
+
+use PHPUnit\Framework\TestCase;
+
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -25,7 +28,7 @@
/**
* @group main
*/
-class LoggerExceptionTest extends PHPUnit_Framework_TestCase {
+class LoggerExceptionTest extends TestCase {
/**
* @expectedException LoggerException
*/
diff --git a/src/test/php/LoggerFilterTest.php b/src/test/php/LoggerFilterTest.php
index 5b0d873..7caaf1d 100644
--- a/src/test/php/LoggerFilterTest.php
+++ b/src/test/php/LoggerFilterTest.php
@@ -1,4 +1,7 @@
<?php
+
+use PHPUnit\Framework\TestCase;
+
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +29,7 @@
/**
* @group filters
*/
-class LoggerFilterTest extends PHPUnit_Framework_TestCase {
+class LoggerFilterTest extends TestCase {
public function testDecide() {
$filter = new MyFilter();
diff --git a/src/test/php/LoggerHierarchyTest.php b/src/test/php/LoggerHierarchyTest.php
index 316423b..07b97c3 100644
--- a/src/test/php/LoggerHierarchyTest.php
+++ b/src/test/php/LoggerHierarchyTest.php
@@ -21,10 +21,12 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group main
*/
-class LoggerHierarchyTest extends PHPUnit_Framework_TestCase {
+class LoggerHierarchyTest extends TestCase {
private $hierarchy;
diff --git a/src/test/php/LoggerLevelTest.php b/src/test/php/LoggerLevelTest.php
index 7a78316..37248bf 100644
--- a/src/test/php/LoggerLevelTest.php
+++ b/src/test/php/LoggerLevelTest.php
@@ -21,10 +21,12 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group main
*/
-class LoggerLevelTest extends PHPUnit_Framework_TestCase {
+class LoggerLevelTest extends TestCase {
protected function doTestLevel($level, $code, $str, $syslog) {
self::assertTrue($level instanceof LoggerLevel);
diff --git a/src/test/php/LoggerLoggingEventTest.php b/src/test/php/LoggerLoggingEventTest.php
index 2833fee..3ae9cac 100644
--- a/src/test/php/LoggerLoggingEventTest.php
+++ b/src/test/php/LoggerLoggingEventTest.php
@@ -1,5 +1,7 @@
<?php
+use PHPUnit\Framework\TestCase;
+
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -32,7 +34,7 @@
}
-class LoggerLoggingEventTestCaseLayout extends LoggerLayout {
+class LoggerLoggingEventTestCaseLayout extends TestCase {
public function activateOptions() {
return;
diff --git a/src/test/php/LoggerMDCTest.php b/src/test/php/LoggerMDCTest.php
index c4add61..003a08b 100644
--- a/src/test/php/LoggerMDCTest.php
+++ b/src/test/php/LoggerMDCTest.php
@@ -22,10 +22,12 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group main
*/
-class LoggerMDCTest extends PHPUnit_Framework_TestCase {
+class LoggerMDCTest extends TestCase {
/** A pattern with 1 key. */
private $pattern1 = "%-5p %c: %X{key1} %m";
diff --git a/src/test/php/LoggerNDCTest.php b/src/test/php/LoggerNDCTest.php
index 039ab1f..c1b5492 100644
--- a/src/test/php/LoggerNDCTest.php
+++ b/src/test/php/LoggerNDCTest.php
@@ -22,10 +22,12 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group main
*/
-class LoggerNDCTest extends PHPUnit_Framework_TestCase {
+class LoggerNDCTest extends TestCase {
public function testItemHandling()
{
diff --git a/src/test/php/LoggerReflectionUtilsTest.php b/src/test/php/LoggerReflectionUtilsTest.php
index c4e34b9..04e866e 100644
--- a/src/test/php/LoggerReflectionUtilsTest.php
+++ b/src/test/php/LoggerReflectionUtilsTest.php
@@ -1,4 +1,7 @@
<?php
+
+use PHPUnit\Framework\TestCase;
+
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -46,7 +49,7 @@
/**
* @group main
*/
-class LoggerReflectionUtilsTest extends PHPUnit_Framework_TestCase {
+class LoggerReflectionUtilsTest extends TestCase {
public function testSimpleSet() {
$s = new Simple();
diff --git a/src/test/php/LoggerRootTest.php b/src/test/php/LoggerRootTest.php
index 9a07cb2..38336e1 100644
--- a/src/test/php/LoggerRootTest.php
+++ b/src/test/php/LoggerRootTest.php
@@ -21,10 +21,12 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group main
*/
-class LoggerRootTest extends PHPUnit_Framework_TestCase {
+class LoggerRootTest extends TestCase {
public function testInitialSetup() {
$root = new LoggerRoot();
diff --git a/src/test/php/LoggerTest.php b/src/test/php/LoggerTest.php
index f08eb29..2e35fc5 100644
--- a/src/test/php/LoggerTest.php
+++ b/src/test/php/LoggerTest.php
@@ -21,10 +21,12 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group main
*/
-class LoggerTest extends PHPUnit_Framework_TestCase {
+class LoggerTest extends TestCase {
private $testConfig1 = array (
'rootLogger' => array (
diff --git a/src/test/php/LoggerThrowableInformationTest.php b/src/test/php/LoggerThrowableInformationTest.php
index a4ed60a..33c639d 100644
--- a/src/test/php/LoggerThrowableInformationTest.php
+++ b/src/test/php/LoggerThrowableInformationTest.php
@@ -21,10 +21,12 @@
* @link http://logging.apache.org/log4php
*/
+use PHPUnit\Framework\TestCase;
+
/**
* @group main
*/
-class LoggerThrowableInformationTest extends PHPUnit_Framework_TestCase {
+class LoggerThrowableInformationTest extends TestCase {
public function testConstructor() {
$ex = new Exception();
diff --git a/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php b/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php
index 0505671..95ba0c4 100644
--- a/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php
+++ b/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php
@@ -93,6 +93,4 @@
$adapter = new LoggerConfigurationAdapterPHP();
$adapter->convert($url);
}
-}
-
-?>
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/src/test/resources/configs/adapters/php/config_empty.php b/src/test/resources/configs/adapters/php/config_empty.php
index 6c447e2..433d633 100644
--- a/src/test/resources/configs/adapters/php/config_empty.php
+++ b/src/test/resources/configs/adapters/php/config_empty.php
@@ -23,5 +23,4 @@
*/
// Empty config
-
-?>
\ No newline at end of file
+return array();
\ No newline at end of file
diff --git a/src/test/resources/configs/adapters/php/config_invalid_syntax.php b/src/test/resources/configs/adapters/php/config_invalid_syntax.php
index 1fca14e..84a2802 100644
--- a/src/test/resources/configs/adapters/php/config_invalid_syntax.php
+++ b/src/test/resources/configs/adapters/php/config_invalid_syntax.php
@@ -34,8 +34,4 @@
'class' => 'LoggerLayoutSimple'
)
)
- )
-
-// Invalid file - no closing brace.
-
-?>
\ No newline at end of file
+ )
\ No newline at end of file
diff --git a/src/test/resources/configs/adapters/php/config_not_an_array.php b/src/test/resources/configs/adapters/php/config_not_an_array.php
index 4838468..e79f80f 100644
--- a/src/test/resources/configs/adapters/php/config_not_an_array.php
+++ b/src/test/resources/configs/adapters/php/config_not_an_array.php
@@ -23,6 +23,4 @@
*/
// Not an array
-return new Exception();
-
-?>
\ No newline at end of file
+return new Exception ();
\ No newline at end of file
diff --git a/src/test/resources/configs/adapters/php/config_valid.php b/src/test/resources/configs/adapters/php/config_valid.php
index cbb0828..c813246 100644
--- a/src/test/resources/configs/adapters/php/config_valid.php
+++ b/src/test/resources/configs/adapters/php/config_valid.php
@@ -36,6 +36,4 @@
)
)
)
-;
-
-?>
\ No newline at end of file
+;
\ No newline at end of file