Skip to content

Commit 90e8363

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Use ::class keyword when possible
2 parents 201a307 + 27da557 commit 90e8363

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
class CollatorTest extends AbstractCollatorTest
@@ -57,19 +58,19 @@ public function testGetLocale()
5758
public function testConstructWithoutLocale()
5859
{
5960
$collator = $this->getCollator(null);
60-
$this->assertInstanceOf('\Symfony\Component\Intl\Collator\Collator', $collator);
61+
$this->assertInstanceOf(Collator::class, $collator);
6162
}
6263

6364
public function testGetSortKey()
6465
{
65-
$this->expectException('Symfony\Component\Intl\Exception\MethodNotImplementedException');
66+
$this->expectException(MethodNotImplementedException::class);
6667
$collator = $this->getCollator('en');
6768
$collator->getSortKey('Hello');
6869
}
6970

7071
public function testGetStrength()
7172
{
72-
$this->expectException('Symfony\Component\Intl\Exception\MethodNotImplementedException');
73+
$this->expectException(MethodNotImplementedException::class);
7374
$collator = $this->getCollator('en');
7475
$collator->getStrength();
7576
}
@@ -92,7 +93,7 @@ public function testStaticCreate()
9293
{
9394
$collator = $this->getCollator('en');
9495
$collator = $collator::create('en');
95-
$this->assertInstanceOf('\Symfony\Component\Intl\Collator\Collator', $collator);
96+
$this->assertInstanceOf(Collator::class, $collator);
9697
}
9798

9899
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
@@ -44,7 +44,7 @@ public function testStaticCreate()
4444
{
4545
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);
4646
$formatter = $formatter::create('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);
47-
$this->assertInstanceOf('\Symfony\Component\Intl\DateFormatter\IntlDateFormatter', $formatter);
47+
$this->assertInstanceOf(IntlDateFormatter::class, $formatter);
4848
}
4949

5050
public function testFormatWithUnsupportedTimestampArgument()

Tests/NumberFormatter/NumberFormatterTest.php

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

5555
public function testConstructWithoutLocale()
5656
{
57-
$this->assertInstanceOf(
58-
'\Symfony\Component\Intl\NumberFormatter\NumberFormatter',
59-
$this->getNumberFormatter(null, NumberFormatter::DECIMAL)
60-
);
57+
$this->assertInstanceOf(NumberFormatter::class, $this->getNumberFormatter(null, NumberFormatter::DECIMAL));
6158
}
6259

6360
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)