Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: global_namespace_import true #5250

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/_support/Commands/AppInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;
use CodeIgniter\CodeIgniter;
use RuntimeException;

class AppInfo extends BaseCommand
{
Expand All @@ -31,7 +32,7 @@ public function bomb()
{
try {
CLI::color('test', 'white', 'Background');
} catch (\RuntimeException $oops) {
} catch (RuntimeException $oops) {
$this->showError($oops);
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/_support/Commands/InvalidCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;
use CodeIgniter\CodeIgniter;
use ReflectionException;

class InvalidCommand extends BaseCommand
{
Expand All @@ -23,7 +24,7 @@ class InvalidCommand extends BaseCommand

public function __construct()
{
throw new \ReflectionException();
throw new ReflectionException();
}

public function run(array $params)
Expand Down
3 changes: 2 additions & 1 deletion tests/_support/Controllers/Popcorn.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use CodeIgniter\API\ResponseTrait;
use CodeIgniter\Controller;
use RuntimeException;

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

public function popper()
{
throw new \RuntimeException('Surprise', 500);
throw new RuntimeException('Surprise', 500);
}

public function weasel()
Expand Down
4 changes: 3 additions & 1 deletion tests/_support/Widgets/SomeWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

namespace Tests\Support\Widgets;

use stdClass;

// Extends a trivial class to test the instanceOf directive
class SomeWidget extends \stdClass
class SomeWidget extends stdClass
{
}
20 changes: 10 additions & 10 deletions tests/system/I18n/TimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testTimeWithDateTimeZone()
'yyyy-MM-dd HH:mm:ss'
);

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

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

$obj = $time->toDateTime();

$this->assertInstanceOf(\DateTime::class, $obj);
$this->assertInstanceOf(DateTime::class, $obj);
}

public function testNow()
{
$time = Time::now();
$time1 = new \DateTime();
$time1 = new DateTime();

$this->assertInstanceOf(Time::class, $time);
$this->assertSame($time->getTimestamp(), $time1->getTimestamp());
Expand All @@ -116,7 +116,7 @@ public function testNow()
public function testParse()
{
$time = Time::parse('next Tuesday', 'America/Chicago');
$time1 = new \DateTime('now', new \DateTimeZone('America/Chicago'));
$time1 = new DateTime('now', new DateTimeZone('America/Chicago'));
$time1->modify('next Tuesday');

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

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

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

public function testCreateFromFormat()
{
$now = new \DateTime('now');
$now = new DateTime('now');

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

public function testCreateFromFormatWithTimezoneObject()
{
$tz = new \DateTimeZone('Europe/London');
$tz = new DateTimeZone('Europe/London');

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

Expand Down Expand Up @@ -422,7 +422,7 @@ public function testGetTimezone()
{
$instance = Time::now()->getTimezone();

$this->assertInstanceOf(\DateTimeZone::class, $instance);
$this->assertInstanceOf(DateTimeZone::class, $instance);
}

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

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

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

$this->assertTrue($time1->equals($time2));
}
Expand Down