Skip to content

Commit

Permalink
Merge pull request #2574 from lucasmichot/class-notation
Browse files Browse the repository at this point in the history
Enforce ::class notation
  • Loading branch information
kylekatarnls authored Mar 27, 2022
2 parents e894037 + 12569e2 commit cb890ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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

0 comments on commit cb890ce

Please sign in to comment.