Skip to content

Commit 9a39199

Browse files
authored
Merge pull request #5250 from kenjis/global_namespace_import-true
style: global_namespace_import true
2 parents 9d23926 + 0b18ab8 commit 9a39199

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

tests/_support/Commands/AppInfo.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use CodeIgniter\CLI\BaseCommand;
1515
use CodeIgniter\CLI\CLI;
1616
use CodeIgniter\CodeIgniter;
17+
use RuntimeException;
1718

1819
class AppInfo extends BaseCommand
1920
{
@@ -31,7 +32,7 @@ public function bomb()
3132
{
3233
try {
3334
CLI::color('test', 'white', 'Background');
34-
} catch (\RuntimeException $oops) {
35+
} catch (RuntimeException $oops) {
3536
$this->showError($oops);
3637
}
3738
}

tests/_support/Commands/InvalidCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use CodeIgniter\CLI\BaseCommand;
1515
use CodeIgniter\CLI\CLI;
1616
use CodeIgniter\CodeIgniter;
17+
use ReflectionException;
1718

1819
class InvalidCommand extends BaseCommand
1920
{
@@ -23,7 +24,7 @@ class InvalidCommand extends BaseCommand
2324

2425
public function __construct()
2526
{
26-
throw new \ReflectionException();
27+
throw new ReflectionException();
2728
}
2829

2930
public function run(array $params)

tests/_support/Controllers/Popcorn.php

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

1414
use CodeIgniter\API\ResponseTrait;
1515
use CodeIgniter\Controller;
16+
use RuntimeException;
1617

1718
/**
1819
* This is a testing only controller, intended to blow up in multiple
@@ -34,7 +35,7 @@ public function pop()
3435

3536
public function popper()
3637
{
37-
throw new \RuntimeException('Surprise', 500);
38+
throw new RuntimeException('Surprise', 500);
3839
}
3940

4041
public function weasel()

tests/_support/Widgets/SomeWidget.php

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

1212
namespace Tests\Support\Widgets;
1313

14+
use stdClass;
15+
1416
// Extends a trivial class to test the instanceOf directive
15-
class SomeWidget extends \stdClass
17+
class SomeWidget extends stdClass
1618
{
1719
}

tests/system/I18n/TimeTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testTimeWithDateTimeZone()
9090
'yyyy-MM-dd HH:mm:ss'
9191
);
9292

93-
$time = new Time('now', new \DateTimeZone('Europe/London'), 'fr_FR');
93+
$time = new Time('now', new DateTimeZone('Europe/London'), 'fr_FR');
9494

9595
$this->assertSame($formatter->format($time), (string) $time);
9696
}
@@ -101,13 +101,13 @@ public function testToDateTime()
101101

102102
$obj = $time->toDateTime();
103103

104-
$this->assertInstanceOf(\DateTime::class, $obj);
104+
$this->assertInstanceOf(DateTime::class, $obj);
105105
}
106106

107107
public function testNow()
108108
{
109109
$time = Time::now();
110-
$time1 = new \DateTime();
110+
$time1 = new DateTime();
111111

112112
$this->assertInstanceOf(Time::class, $time);
113113
$this->assertSame($time->getTimestamp(), $time1->getTimestamp());
@@ -116,7 +116,7 @@ public function testNow()
116116
public function testParse()
117117
{
118118
$time = Time::parse('next Tuesday', 'America/Chicago');
119-
$time1 = new \DateTime('now', new \DateTimeZone('America/Chicago'));
119+
$time1 = new DateTime('now', new DateTimeZone('America/Chicago'));
120120
$time1->modify('next Tuesday');
121121

122122
$this->assertSame($time->getTimestamp(), $time1->getTimestamp());
@@ -134,7 +134,7 @@ public function testToDateTimeStringWithTimeZone()
134134
{
135135
$time = Time::parse('2017-01-12 00:00', 'Europe/London');
136136

137-
$expects = new \DateTime('2017-01-12', new \DateTimeZone('Europe/London'));
137+
$expects = new DateTime('2017-01-12', new DateTimeZone('Europe/London'));
138138

139139
$this->assertSame($expects->format('Y-m-d H:i:s'), $time->toDateTimeString());
140140
}
@@ -204,7 +204,7 @@ public function testCreateFromTimeLocalized()
204204

205205
public function testCreateFromFormat()
206206
{
207-
$now = new \DateTime('now');
207+
$now = new DateTime('now');
208208

209209
Time::setTestNow($now);
210210
$time = Time::createFromFormat('F j, Y', 'January 15, 2017', 'America/Chicago');
@@ -222,7 +222,7 @@ public function testCreateFromFormatWithTimezoneString()
222222

223223
public function testCreateFromFormatWithTimezoneObject()
224224
{
225-
$tz = new \DateTimeZone('Europe/London');
225+
$tz = new DateTimeZone('Europe/London');
226226

227227
$time = Time::createFromFormat('F j, Y', 'January 15, 2017', $tz);
228228

@@ -422,7 +422,7 @@ public function testGetTimezone()
422422
{
423423
$instance = Time::now()->getTimezone();
424424

425-
$this->assertInstanceOf(\DateTimeZone::class, $instance);
425+
$this->assertInstanceOf(DateTimeZone::class, $instance);
426426
}
427427

428428
public function testGetTimezonename()
@@ -776,15 +776,15 @@ public function testEqualWithSame()
776776
public function testEqualWithDateTime()
777777
{
778778
$time1 = Time::parse('January 10, 2017 21:50:00', 'America/Chicago');
779-
$time2 = new \DateTime('January 11, 2017 03:50:00', new \DateTimeZone('Europe/London'));
779+
$time2 = new DateTime('January 11, 2017 03:50:00', new DateTimeZone('Europe/London'));
780780

781781
$this->assertTrue($time1->equals($time2));
782782
}
783783

784784
public function testEqualWithSameDateTime()
785785
{
786786
$time1 = Time::parse('January 10, 2017 21:50:00', 'America/Chicago');
787-
$time2 = new \DateTime('January 10, 2017 21:50:00', new \DateTimeZone('America/Chicago'));
787+
$time2 = new DateTime('January 10, 2017 21:50:00', new DateTimeZone('America/Chicago'));
788788

789789
$this->assertTrue($time1->equals($time2));
790790
}

0 commit comments

Comments
 (0)