Skip to content

Commit

Permalink
Revert "replace E_USER_NOTICE with E_USER_DEPRECATED (#647)"
Browse files Browse the repository at this point in the history
This reverts commit 72816bb.
  • Loading branch information
brettmc authored Apr 3, 2022
1 parent 72816bb commit a7fb42c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true"
forceCoversAnnotation="true"
processIsolation="false"
stopOnError="false"
Expand Down
4 changes: 2 additions & 2 deletions src/SDK/Common/Dev/Compatibility/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static function triggerClassDeprecationNotice(string $className, string $
$notice .= sprintf('Please, use "%s" instead.', $alternativeClassName);
}

trigger_error($notice, \E_USER_DEPRECATED);
trigger_error($notice, E_USER_NOTICE);
}

public static function triggerMethodDeprecationNotice(
Expand All @@ -38,6 +38,6 @@ public static function triggerMethodDeprecationNotice(
$notice .= sprintf('Please, use "%s" instead.', $method);
}

trigger_error($notice, \E_USER_DEPRECATED);
trigger_error($notice, E_USER_NOTICE);
}
}
6 changes: 3 additions & 3 deletions tests/Unit/SDK/Common/Dev/Compatibility/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ class UtilTest extends TestCase
{
public function test_trigger_class_deprecation_notice(): void
{
$this->expectDeprecation();
$this->expectNotice();

Util::triggerClassDeprecationNotice(Util::class, self::class);
}

public function test_trigger_method_deprecation_notice_without_class(): void
{
$this->expectDeprecation();
$this->expectNotice();

Util::triggerMethodDeprecationNotice(Util::class, __METHOD__);
}

public function test_trigger_method_deprecation_notice_with_class(): void
{
$this->expectDeprecation();
$this->expectNotice();

Util::triggerMethodDeprecationNotice(Util::class, 'foo', self::class);
}
Expand Down

0 comments on commit a7fb42c

Please sign in to comment.