Skip to content

Commit

Permalink
Merge pull request #13792 from cakephp/4.x-class-magic-constant
Browse files Browse the repository at this point in the history
Use ::class magic constant instead of string.
  • Loading branch information
ADmad committed Oct 22, 2019
2 parents 29fe42b + 6af2d17 commit c42e94b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -472,4 +472,9 @@ parameters:
count: 1
path: src/View/Widget/DateTimeWidget.php

-
message: "#^Class Psy\\\\Shell not found\\.$#"
count: 1
path: src/basics.php


2 changes: 1 addition & 1 deletion src/Cache/Engine/ApcuEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function delete($key): bool
*/
public function clear(): bool
{
if (class_exists('APCuIterator', false)) {
if (class_exists(APCuIterator::class, false)) {
$iterator = new APCuIterator(
'/^' . preg_quote($this->_config['prefix'], '/') . '/',
APC_ITER_NONE
Expand Down
3 changes: 2 additions & 1 deletion src/basics.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use Cake\Core\Configure;
use Cake\Error\Debugger;
use Psy\Shell as PsyShell;

define('SECOND', 1);
define('MINUTE', 60);
Expand Down Expand Up @@ -105,7 +106,7 @@ function stackTrace(array $options = []): void
*/
function breakpoint(): ?string
{
if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && class_exists('\Psy\Shell')) {
if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && class_exists(PsyShell::class)) {
return 'extract(\Psy\Shell::debug(get_defined_vars(), isset($this) ? $this : null));';
}
trigger_error(
Expand Down

0 comments on commit c42e94b

Please sign in to comment.