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

Enforce ::class notation #2574

Merged
merged 1 commit into from
Mar 27, 2022
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
2 changes: 1 addition & 1 deletion src/Carbon/CarbonPeriod.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public static function instance($period)
);
}

$class = \get_called_class();
$class = static::class;
$type = \gettype($period);

throw new NotAPeriodException(
Expand Down
2 changes: 1 addition & 1 deletion src/Carbon/Traits/Serialization.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function __sleep()
#[ReturnTypeWillChange]
public function __wakeup()
{
if (get_parent_class() && method_exists(parent::class, '__wakeup')) {
if (parent::class && method_exists(parent::class, '__wakeup')) {
// @codeCoverageIgnoreStart
try {
parent::__wakeup();
Expand Down
2 changes: 1 addition & 1 deletion tests/CarbonPeriod/MacroTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MacroTest extends AbstractTestCase
{
protected function tearDown(): void
{
$reflection = new ReflectionClass('Carbon\CarbonPeriod');
$reflection = new ReflectionClass(CarbonPeriod::class);

$macrosProperty = $reflection->getProperty('macros');

Expand Down