Skip to content

Commit

Permalink
fix: Add null key handling (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauliustHostinger authored Jul 18, 2023
1 parent 608405d commit e1f0fa6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
}
],
"require": {
"php": ">=5.6"
"php": "^7.3|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5"
"phpunit/phpunit": "^9"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Travers.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function shouldFail()
*/
protected function parseKeys($key)
{
return explode($this->delimiter, $key);
return explode($this->delimiter, $key ?? '');
}

/**
Expand Down
3 changes: 2 additions & 1 deletion tests/TraversTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace Luur;
namespace Luur\Tests;

use Luur\Exceptions\BranchNotFoundException;
use Luur\Travers;
use PHPUnit\Framework\TestCase;

class TraversTest extends TestCase
Expand Down

0 comments on commit e1f0fa6

Please sign in to comment.