1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 00:17:31 +02:00

Use ::class syntax to fetch class name instead of get_class() function (#3910)

This commit is contained in:
Ngô Quốc Đạt
2023-10-29 20:43:58 +07:00
committed by GitHub
parent 2950290ad1
commit 015529ff1e
25 changed files with 37 additions and 37 deletions

View File

@@ -51,7 +51,7 @@ class FilesystemTest extends TestCase
/** @var FilesystemAdapter $uploadsDisk */
$uploadsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-uploads');
$this->assertEquals(get_class($uploadsDisk->getAdapter()), LocalFilesystemAdapter::class);
$this->assertEquals($uploadsDisk->getAdapter()::class, LocalFilesystemAdapter::class);
}
/**
@@ -64,7 +64,7 @@ class FilesystemTest extends TestCase
/** @var FilesystemAdapter $uploadsDisk */
$uploadsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-uploads');
$this->assertEquals(get_class($uploadsDisk->getAdapter()), LocalFilesystemAdapter::class);
$this->assertEquals($uploadsDisk->getAdapter()::class, LocalFilesystemAdapter::class);
}
/**
@@ -77,7 +77,7 @@ class FilesystemTest extends TestCase
/** @var FilesystemAdapter $assetsDisk */
$assetsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-assets');
$this->assertEquals(get_class($assetsDisk->getAdapter()), LocalFilesystemAdapter::class);
$this->assertEquals($assetsDisk->getAdapter()::class, LocalFilesystemAdapter::class);
}
/**
@@ -90,7 +90,7 @@ class FilesystemTest extends TestCase
/** @var FilesystemAdapter $assetsDisk */
$assetsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-assets');
$this->assertEquals(get_class($assetsDisk->getAdapter()), LocalFilesystemAdapter::class);
$this->assertEquals($assetsDisk->getAdapter()::class, LocalFilesystemAdapter::class);
}
/**
@@ -107,7 +107,7 @@ class FilesystemTest extends TestCase
/** @var FilesystemAdapter $assetsDisk */
$assetsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-assets');
$this->assertEquals(get_class($assetsDisk->getAdapter()), InMemoryFilesystemAdapter::class);
$this->assertEquals($assetsDisk->getAdapter()::class, InMemoryFilesystemAdapter::class);
}
/**
@@ -124,7 +124,7 @@ class FilesystemTest extends TestCase
/** @var FilesystemAdapter $assetsDisk */
$assetsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-assets');
$this->assertEquals(get_class($assetsDisk->getAdapter()), InMemoryFilesystemAdapter::class);
$this->assertEquals($assetsDisk->getAdapter()::class, InMemoryFilesystemAdapter::class);
}
}

View File

@@ -51,7 +51,7 @@ class SessionTest extends TestCase
$driver = $this->app()->getContainer()->make('session')->driver('flarum-acme');
$this->assertEquals(NullSessionHandler::class, get_class($driver->getHandler()));
$this->assertEquals(NullSessionHandler::class, $driver->getHandler()::class);
}
/**
@@ -63,7 +63,7 @@ class SessionTest extends TestCase
$driver = $this->app()->getContainer()->make('session')->driver('redis');
$this->assertEquals(NullSessionHandler::class, get_class($driver->getHandler()));
$this->assertEquals(NullSessionHandler::class, $driver->getHandler()::class);
}
/**
@@ -75,7 +75,7 @@ class SessionTest extends TestCase
$handler = $this->app()->getContainer()->make('session.handler');
$this->assertEquals(FileSessionHandler::class, get_class($handler));
$this->assertEquals(FileSessionHandler::class, $handler::class);
}
/**
@@ -87,7 +87,7 @@ class SessionTest extends TestCase
$handler = $this->app()->getContainer()->make('session.handler');
$this->assertEquals(FileSessionHandler::class, get_class($handler));
$this->assertEquals(FileSessionHandler::class, $handler::class);
}
/**
@@ -103,7 +103,7 @@ class SessionTest extends TestCase
$handler = $this->app()->getContainer()->make('session.handler');
$this->assertEquals(NullSessionHandler::class, get_class($handler));
$this->assertEquals(NullSessionHandler::class, $handler::class);
}
}