Skip to content

Commit 6d3373d

Browse files
Maks3wweierophinney
authored andcommitted
Add type hints
1 parent 354dc4a commit 6d3373d

File tree

7 files changed

+34
-5
lines changed

7 files changed

+34
-5
lines changed

test/FastPriorityQueueTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,24 @@
99

1010
namespace ZendTest\Stdlib;
1111

12+
use Zend\Stdlib\Exception\InvalidArgumentException;
1213
use Zend\Stdlib\FastPriorityQueue;
1314

1415
/**
1516
* @group Zend_Stdlib
1617
*/
1718
class FastPriorityQueueTest extends \PHPUnit_Framework_TestCase
1819
{
20+
/**
21+
* @var FastPriorityQueue
22+
*/
23+
protected $queue;
24+
25+
/**
26+
* @var string[]
27+
*/
28+
protected $expected;
29+
1930
public function setUp()
2031
{
2132
$this->queue = new FastPriorityQueue();
@@ -42,7 +53,7 @@ protected function getDataPriorityQueue()
4253
];
4354
}
4455

45-
protected function insertDataQueue($queue)
56+
protected function insertDataQueue(FastPriorityQueue $queue)
4657
{
4758
foreach ($this->getDataPriorityQueue() as $value => $priority) {
4859
$queue->insert($value, $priority);
@@ -154,11 +165,9 @@ public function testSetExtractFlag()
154165
$this->assertEquals($expected, $this->queue->extract());
155166
}
156167

157-
/**
158-
* @expectedException Zend\Stdlib\Exception\InvalidArgumentException
159-
*/
160168
public function testSetInvalidExtractFlag()
161169
{
170+
$this->setExpectedException(InvalidArgumentException::class, 'The extract flag specified is not valid');
162171
$this->queue->setExtractFlags('foo');
163172
}
164173

test/PriorityListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function testPriorityOnly()
116116
$this->list->insert('bar', new \stdClass(), 0);
117117
$this->list->insert('baz', new \stdClass(), 2);
118118

119-
$order = [];
119+
$orders = [];
120120

121121
foreach ($this->list as $key => $value) {
122122
$orders[] = $key;

test/SplPriorityQueueTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
*/
1717
class SplPriorityQueueTest extends \PHPUnit_Framework_TestCase
1818
{
19+
/**
20+
* @var SplPriorityQueue
21+
*/
22+
protected $queue;
23+
1924
public function setUp()
2025
{
2126
$this->queue = new SplPriorityQueue();

test/SplQueueTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
*/
1717
class SplQueueTest extends \PHPUnit_Framework_TestCase
1818
{
19+
/**
20+
* @var SplQueue
21+
*/
22+
protected $queue;
23+
1924
public function setUp()
2025
{
2126
$this->queue = new SplQueue();

test/SplStackTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
*/
1717
class SplStackTest extends \PHPUnit_Framework_TestCase
1818
{
19+
/**
20+
* @var SplStack
21+
*/
22+
protected $stack;
23+
1924
public function setUp()
2025
{
2126
$this->stack = new SplStack();

test/StringUtilsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace ZendTest\Stdlib;
1111

12+
use Exception;
1213
use PHPUnit_Framework_TestCase as TestCase;
1314
use Zend\Stdlib\ErrorHandler;
1415
use Zend\Stdlib\StringUtils;

test/StringWrapper/CommonStringWrapperTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010
namespace ZendTest\Stdlib\StringWrapper;
1111

1212
use PHPUnit_Framework_TestCase as TestCase;
13+
use Zend\Stdlib\StringWrapper\StringWrapperInterface;
1314

1415
abstract class CommonStringWrapperTest extends TestCase
1516
{
17+
/**
18+
* @return StringWrapperInterface
19+
*/
1620
abstract protected function getWrapper($encoding = null, $convertEncoding = null);
1721

1822
public function strlenProvider()

0 commit comments

Comments
 (0)