Skip to content

Instantly share code, notes, and snippets.

@yann-eugone
Last active September 19, 2023 06:08
Show Gist options
  • Save yann-eugone/e975597df92ae45e4ee3c131d0bf0f35 to your computer and use it in GitHub Desktop.
Save yann-eugone/e975597df92ae45e4ee3c131d0bf0f35 to your computer and use it in GitHub Desktop.
PhpStorm Live Templates

tryc

try / catch

try {
    $TRY$
} catch(\Throwable $exception) {
    $CATCH$
}

dt

Dump backtrace

try {
    throw new \Exception();
} catch (\Throwable $exception) {
    dump($exception->getTraceAsString());
}

dl

Dump location

dump(__METHOD__.'::'.__LINE__);

stop

Stop at location

dd(__METHOD__.'::'.__LINE__);

log

Log to local file

file_put_contents(__DIR__.'/$FILE$', $LINE$.PHP_EOL, FILE_APPEND);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment