Skip to content

Commit 8fc5393

Browse files
committed
Log - add nullable type handling
1 parent 3b38bda commit 8fc5393

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Gitonomy/Git/Log.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Log implements \Countable, \IteratorAggregate
2626
protected $repository;
2727

2828
/**
29-
* @var array
29+
* @var null|RevisionList
3030
*/
3131
protected $revisions;
3232

@@ -221,7 +221,7 @@ public function getIterator()
221221
*/
222222
public function countCommits()
223223
{
224-
if (count($this->revisions)) {
224+
if (null !== $this->revisions && count($this->revisions)) {
225225
$output = $this->repository->run('rev-list', array_merge(array('--count'), $this->revisions->getAsTextArray(), array('--'), $this->paths));
226226
} else {
227227
$output = $this->repository->run('rev-list', array_merge(array('--count', '--all', '--'), $this->paths));

0 commit comments

Comments
 (0)