Skip to content

Commit f320e94

Browse files
committed
fix use class keyword
1 parent 13c72e4 commit f320e94

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

test/CsvTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace League\Csv\Test;
44

5+
use DOMDocument;
6+
use IteratorAggregate;
7+
use JsonSerializable;
58
use League\Csv\Reader;
69
use SplTempFileObject;
710

@@ -34,8 +37,8 @@ public function tearDown()
3437

3538
public function testInterface()
3639
{
37-
$this->assertInstanceOf('IteratorAggregate', $this->csv);
38-
$this->assertInstanceOf('JsonSerializable', $this->csv);
40+
$this->assertInstanceOf(IteratorAggregate::class, $this->csv);
41+
$this->assertInstanceOf(JsonSerializable::class, $this->csv);
3942
}
4043

4144
public function testToHTML()
@@ -45,7 +48,7 @@ public function testToHTML()
4548

4649
public function testToXML()
4750
{
48-
$this->assertInstanceOf('DOMDocument', $this->csv->toXML());
51+
$this->assertInstanceOf(DOMDocument::class, $this->csv->toXML());
4952
}
5053

5154
public function testJsonSerialize()

test/FactoryTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,22 @@ public function testCreateFromString()
5555
$expected = 'john,doe,[email protected]'.PHP_EOL
5656
.'jane,doe,[email protected]'.PHP_EOL;
5757
$reader = Reader::createFromString($expected);
58-
$this->assertInstanceof('League\Csv\Reader', $reader);
58+
$this->assertInstanceof(Reader::class, $reader);
5959
}
6060

6161
public function testCreateFromFileObject()
6262
{
6363
$reader = Reader::createFromFileObject(new SplTempFileObject());
64-
$this->assertInstanceof('League\Csv\Reader', $reader);
65-
$this->assertInstanceof('SplTempFileObject', $reader->getIterator());
64+
$this->assertInstanceof(Reader::class, $reader);
65+
$this->assertInstanceof(SplTempFileObject::class, $reader->getIterator());
6666
}
6767

6868
public function testCreateFromFileObjectWithSplFileObject()
6969
{
7070
$path = __DIR__.'/data/foo.csv';
7171
$obj = new SplFileObject($path);
7272
$reader = Reader::createFromFileObject($obj);
73-
$this->assertInstanceof('League\Csv\Reader', $reader);
74-
$this->assertInstanceof('SplFileObject', $reader->getIterator());
73+
$this->assertInstanceof(Reader::class, $reader);
74+
$this->assertInstanceof(SplFileObject::class, $reader->getIterator());
7575
}
7676
}

test/ReaderTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace League\Csv\Test;
44

5+
use Iterator;
56
use League\Csv\Reader;
67
use League\Csv\Writer;
78
use SplTempFileObject;
@@ -526,11 +527,11 @@ public function testFetchPairsWithInvalidValue()
526527

527528
public function testReturnTypeResetBetweenCallToArrayWithFetch()
528529
{
529-
$this->assertInstanceof('\Iterator', $this->csv->fetch());
530+
$this->assertInstanceof(Iterator::class, $this->csv->fetch());
530531
$this->assertInternalType('array', $this->csv->fetchAll());
531532
$this->assertInternalType('array', $this->csv->fetchOne());
532-
$this->assertInstanceof('\Iterator', $this->csv->fetchAssoc());
533-
$this->assertInstanceof('\Iterator', $this->csv->fetchPairs());
533+
$this->assertInstanceof(Iterator::class, $this->csv->fetchAssoc());
534+
$this->assertInstanceof(Iterator::class, $this->csv->fetchPairs());
534535
$this->assertInternalType('array', $this->csv->fetchPairsWithoutDuplicates());
535536
}
536537

test/WriterTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use League\Csv\Writer;
77
use SplFileObject;
88
use SplTempFileObject;
9+
use stdClass;
910

1011
/**
1112
* @group writer
@@ -61,7 +62,7 @@ public function testInsertNormalFile()
6162
*/
6263
public function testFailedSaveWithWrongType()
6364
{
64-
$this->csv->insertAll(new \StdClass());
65+
$this->csv->insertAll(new stdClass());
6566
}
6667

6768
/**

0 commit comments

Comments
 (0)