Skip to content

Commit a6b38b4

Browse files
minor symfony#58430 Remove a few unnecessary full qualifier (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- Remove a few unnecessary full qualifier | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Remove full qualifier in places there are not present usually in the code base: mocks, already imported classes, expected exceptions. Commits ------- 1543068 Remove a few unnecessary full qualifier
2 parents 0869295 + 1543068 commit a6b38b4

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function testKeyEncoding()
253253
$pool = $this->createCachePool(0, null, $namespace);
254254

255255
/**
256-
* Choose a key that is below {@see \Symfony\Component\Cache\Adapter\MemcachedAdapter::$maxIdLength} so that
256+
* Choose a key that is below {@see MemcachedAdapter::$maxIdLength} so that
257257
* {@see \Symfony\Component\Cache\Traits\AbstractTrait::getId()} does not shorten the key but choose special
258258
* characters that would be encoded and therefore increase the key length over the Memcached limit.
259259
*/

src/Symfony/Component/Console/Tests/Helper/TableCellStyleTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Console\Tests\Helper;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\Console\Exception\InvalidArgumentException;
1516
use Symfony\Component\Console\Helper\TableCellStyle;
1617

1718
class TableCellStyleTest extends TestCase
@@ -21,7 +22,8 @@ public function testCreateTableCellStyle()
2122
$tableCellStyle = new TableCellStyle(['fg' => 'red']);
2223
$this->assertEquals('red', $tableCellStyle->getOptions()['fg']);
2324

24-
$this->expectException(\Symfony\Component\Console\Exception\InvalidArgumentException::class);
25+
$this->expectException(InvalidArgumentException::class);
26+
2527
new TableCellStyle(['wrong_key' => null]);
2628
}
2729
}

src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ public function testAddObjectResource()
11221122

11231123
$this->assertCount(1, $resources);
11241124

1125-
/* @var $resource \Symfony\Component\Config\Resource\FileResource */
1125+
/* @var FileResource $resource */
11261126
$resource = end($resources);
11271127

11281128
$this->assertInstanceOf(FileResource::class, $resource);

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/ConnectionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
1313

14+
use Doctrine\DBAL\Configuration;
1415
use Doctrine\DBAL\Connection as DBALConnection;
1516
use Doctrine\DBAL\Exception as DBALException;
1617
use Doctrine\DBAL\Platforms\AbstractPlatform;
@@ -308,7 +309,7 @@ private function getDBALConnectionMock()
308309
$platform->method('getWriteLockSQL')->willReturn('FOR UPDATE SKIP LOCKED');
309310
}
310311

311-
$configuration = $this->createMock(\Doctrine\DBAL\Configuration::class);
312+
$configuration = $this->createMock(Configuration::class);
312313
$driverConnection->method('getDatabasePlatform')->willReturn($platform);
313314
$driverConnection->method('getConfiguration')->willReturn($configuration);
314315

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/PostgreSqlConnectionTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
1313

14+
use Doctrine\DBAL\Connection;
1415
use Doctrine\DBAL\Driver\Result as DriverResult;
1516
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1617
use Doctrine\DBAL\Query\QueryBuilder;
@@ -29,7 +30,7 @@ public function testSerialize()
2930
$this->expectException(\BadMethodCallException::class);
3031
$this->expectExceptionMessage('Cannot serialize '.PostgreSqlConnection::class);
3132

32-
$driverConnection = $this->createMock(\Doctrine\DBAL\Connection::class);
33+
$driverConnection = $this->createMock(Connection::class);
3334
$driverConnection->method('executeStatement')->willReturn(1);
3435

3536
$connection = new PostgreSqlConnection([], $driverConnection);
@@ -41,7 +42,7 @@ public function testUnserialize()
4142
$this->expectException(\BadMethodCallException::class);
4243
$this->expectExceptionMessage('Cannot unserialize '.PostgreSqlConnection::class);
4344

44-
$driverConnection = $this->createMock(\Doctrine\DBAL\Connection::class);
45+
$driverConnection = $this->createMock(Connection::class);
4546
$driverConnection->method('executeStatement')->willReturn(1);
4647

4748
$connection = new PostgreSqlConnection([], $driverConnection);
@@ -50,7 +51,7 @@ public function testUnserialize()
5051

5152
public function testListenOnConnection()
5253
{
53-
$driverConnection = $this->createMock(\Doctrine\DBAL\Connection::class);
54+
$driverConnection = $this->createMock(Connection::class);
5455
$driverConnection->method('executeStatement')->willReturn(1);
5556

5657
$driverConnection
@@ -103,7 +104,7 @@ public function countNotifyCalls()
103104

104105
public function testGetExtraSetupSql()
105106
{
106-
$driverConnection = $this->createMock(\Doctrine\DBAL\Connection::class);
107+
$driverConnection = $this->createMock(Connection::class);
107108
$driverConnection->method('executeStatement')->willReturn(1);
108109
$connection = new PostgreSqlConnection(['table_name' => 'queue_table'], $driverConnection);
109110

@@ -120,7 +121,7 @@ public function testGetExtraSetupSql()
120121

121122
public function testTransformTableNameWithSchemaToValidProcedureName()
122123
{
123-
$driverConnection = $this->createMock(\Doctrine\DBAL\Connection::class);
124+
$driverConnection = $this->createMock(Connection::class);
124125
$driverConnection->method('executeStatement')->willReturn(1);
125126
$connection = new PostgreSqlConnection(['table_name' => 'schema.queue_table'], $driverConnection);
126127

@@ -134,7 +135,7 @@ public function testTransformTableNameWithSchemaToValidProcedureName()
134135

135136
public function testGetExtraSetupSqlWrongTable()
136137
{
137-
$driverConnection = $this->createMock(\Doctrine\DBAL\Connection::class);
138+
$driverConnection = $this->createMock(Connection::class);
138139
$driverConnection->method('executeStatement')->willReturn(1);
139140
$connection = new PostgreSqlConnection(['table_name' => 'queue_table'], $driverConnection);
140141

src/Symfony/Component/PropertyInfo/Tests/Fixtures/ParentDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ParentDummy
6666
public $rootDummyItems;
6767

6868
/**
69-
* @var \Symfony\Component\PropertyInfo\Tests\Fixtures\RootDummy\RootDummyItem
69+
* @var RootDummyItem
7070
*/
7171
public $rootDummyItem;
7272

src/Symfony/Component/Validator/Mapping/Factory/MetadataFactoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\Validator\Mapping\MetadataInterface;
1616

1717
/**
18-
* Returns {@link \Symfony\Component\Validator\Mapping\MetadataInterface} instances for values.
18+
* Returns {@link MetadataInterface} instances for values.
1919
*
2020
* @author Bernhard Schussek <bschussek@gmail.com>
2121
*/

0 commit comments

Comments
 (0)