diff --git a/.travis.yml b/.travis.yml index f9d9d63..a16284c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,7 @@ language: php php: - - 7.1 - - 7.2 - - 7.3 + - 7.4 before_script: - curl -s http://getcomposer.org/installer | php diff --git a/composer.json b/composer.json index 357d410..7a10517 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,12 @@ ], "license": "MIT", "require": { - "php" : ">=7.1.3", - "illuminate/support": "5.8.*", - "illuminate/session": "5.8.*" + "illuminate/support": "5.8.*|^6.0|^7.0", + "illuminate/session": "5.8.*|^6.0|^7.0" }, "require-dev": { - "mockery/mockery": "~0.9", - "phpunit/phpunit": "~5.7" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^8.0" }, "autoload": { "psr-0": { diff --git a/phpunit.xml b/phpunit.xml index e46e625..6825d71 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" > diff --git a/src/Krucas/Notification/Collection.php b/src/Krucas/Notification/Collection.php index ec3908e..f159778 100644 --- a/src/Krucas/Notification/Collection.php +++ b/src/Krucas/Notification/Collection.php @@ -36,7 +36,13 @@ public function __construct($items = []) */ public function add($item) { - $this->queue->insert($item, is_null($item->getPosition()) ? null : -$item->getPosition()); + if (is_array($item)) { + $position = $item['position']; + } else { + $position = $item->getPosition(); + } + + $this->queue->insert($item, is_null($position) ? null : -$position); $this->copyQueue(clone $this->queue); diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php index 7e08c88..7060b7d 100644 --- a/tests/CollectionTest.php +++ b/tests/CollectionTest.php @@ -1,8 +1,8 @@