Skip to content

Instantly share code, notes, and snippets.

@derpixler
Last active February 17, 2017 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derpixler/4817afee2310c73f7b6b04496380fb14 to your computer and use it in GitHub Desktop.
Save derpixler/4817afee2310c73f7b6b04496380fb14 to your computer and use it in GitHub Desktop.
PHPstorm better DebugSnipped
/**
* 1. Goto Preferences -> Editor -> Live Template -> PHP
* 2. Klick in the right +
* 3. chose Live Template
* 4. Give a abbreviation like "pdebug"
* 5. Copie the Template into Template Text
* 6. in your code Type "pdeb.." use auto compleate ;)
*
* You get a Debug like this.
*
* Array
* (
* [DEBUG_LOCATION] => Array
* (
* [PATH] => /var/www/html/project/Classes/DataGrabber
* [FILE] => Offerlinks.php
* [FUNCTION] => getLinks:144
* )
*
* [DEBUG] => Array
* (
* [$objTree->getName()] => Saint Tropez
* [$branchId] => 2
* [$objBranchId->getId()] => 1
* )
*
* )
*
**/
/** The Live Template **/
echo '<pre>';print_r( [ 'DEBUG_LOCATION' => [ 'PATH' => dirname( __FILE__ ), 'FILE' => basename( __FILE__ ), 'FUNCTION' => __FUNCTION__ . ':' . __LINE__ ], 'DEBUG' => [
'$NAME$' => $END$$VAR$,
]
] );echo '</pre>';
die();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment