Skip to content

Commit 4d4c3c5

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Use ::class keyword when possible
2 parents 4623b07 + 90e8363 commit 4d4c3c5

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

Intl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ final class Intl
7171
*/
7272
public static function isExtensionLoaded(): bool
7373
{
74-
return class_exists('\ResourceBundle');
74+
return class_exists(\ResourceBundle::class);
7575
}
7676

7777
/**

Tests/Collator/CollatorTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Intl\Tests\Collator;
1313

1414
use Symfony\Component\Intl\Collator\Collator;
15+
use Symfony\Component\Intl\Exception\MethodNotImplementedException;
1516
use Symfony\Component\Intl\Globals\IntlGlobals;
1617

1718
/**
@@ -60,19 +61,19 @@ public function testGetLocale()
6061
public function testConstructWithoutLocale()
6162
{
6263
$collator = $this->getCollator(null);
63-
$this->assertInstanceOf('\Symfony\Component\Intl\Collator\Collator', $collator);
64+
$this->assertInstanceOf(Collator::class, $collator);
6465
}
6566

6667
public function testGetSortKey()
6768
{
68-
$this->expectException('Symfony\Component\Intl\Exception\MethodNotImplementedException');
69+
$this->expectException(MethodNotImplementedException::class);
6970
$collator = $this->getCollator('en');
7071
$collator->getSortKey('Hello');
7172
}
7273

7374
public function testGetStrength()
7475
{
75-
$this->expectException('Symfony\Component\Intl\Exception\MethodNotImplementedException');
76+
$this->expectException(MethodNotImplementedException::class);
7677
$collator = $this->getCollator('en');
7778
$collator->getStrength();
7879
}
@@ -95,7 +96,7 @@ public function testStaticCreate()
9596
{
9697
$collator = $this->getCollator('en');
9798
$collator = $collator::create('en');
98-
$this->assertInstanceOf('\Symfony\Component\Intl\Collator\Collator', $collator);
99+
$this->assertInstanceOf(Collator::class, $collator);
99100
}
100101

101102
protected function getCollator(?string $locale): Collator

Tests/Data/Bundle/Reader/IntlBundleReaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testReadReturnsArrayAccess()
3434
{
3535
$data = $this->reader->read(__DIR__.'/Fixtures/res', 'ro');
3636

37-
$this->assertInstanceOf('\ArrayAccess', $data);
37+
$this->assertInstanceOf(\ArrayAccess::class, $data);
3838
$this->assertSame('Bar', $data['Foo']);
3939
$this->assertArrayNotHasKey('ExistsNot', $data);
4040
}
@@ -44,7 +44,7 @@ public function testReadFollowsAlias()
4444
// "alias" = "ro"
4545
$data = $this->reader->read(__DIR__.'/Fixtures/res', 'alias');
4646

47-
$this->assertInstanceOf('\ArrayAccess', $data);
47+
$this->assertInstanceOf(\ArrayAccess::class, $data);
4848
$this->assertSame('Bar', $data['Foo']);
4949
$this->assertArrayNotHasKey('ExistsNot', $data);
5050
}
@@ -54,7 +54,7 @@ public function testReadDoesNotFollowFallback()
5454
// "ro_MD" -> "ro"
5555
$data = $this->reader->read(__DIR__.'/Fixtures/res', 'ro_MD');
5656

57-
$this->assertInstanceOf('\ArrayAccess', $data);
57+
$this->assertInstanceOf(\ArrayAccess::class, $data);
5858
$this->assertSame('Bam', $data['Baz']);
5959
$this->assertArrayNotHasKey('Foo', $data);
6060
$this->assertNull($data['Foo']);

Tests/DateFormatter/IntlDateFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testStaticCreate()
4747
{
4848
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);
4949
$formatter = $formatter::create('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);
50-
$this->assertInstanceOf('\Symfony\Component\Intl\DateFormatter\IntlDateFormatter', $formatter);
50+
$this->assertInstanceOf(IntlDateFormatter::class, $formatter);
5151
}
5252

5353
public function testFormatWithUnsupportedTimestampArgument()

Tests/NumberFormatter/NumberFormatterTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ public function testSetAttributeInvalidRoundingMode()
5656

5757
public function testConstructWithoutLocale()
5858
{
59-
$this->assertInstanceOf(
60-
'\Symfony\Component\Intl\NumberFormatter\NumberFormatter',
61-
$this->getNumberFormatter(null, NumberFormatter::DECIMAL)
62-
);
59+
$this->assertInstanceOf(NumberFormatter::class, $this->getNumberFormatter(null, NumberFormatter::DECIMAL));
6360
}
6461

6562
public function testCreate()

Tests/NumberFormatter/Verification/NumberFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function setUp(): void
2929

3030
public function testCreate()
3131
{
32-
$this->assertInstanceOf('\NumberFormatter', \NumberFormatter::create('en', \NumberFormatter::DECIMAL));
32+
$this->assertInstanceOf(\NumberFormatter::class, \NumberFormatter::create('en', \NumberFormatter::DECIMAL));
3333
}
3434

3535
public function testGetTextAttribute()

0 commit comments

Comments
 (0)