Skip to content

Commit

Permalink
Fix formatting in 0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bahiirwa committed Jan 29, 2023
1 parent 513b991 commit bf40d53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"version": "0.5.3",
"configurations": [
{
"name": "Extension",
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

### [0.5.3]
- Fix: Function formats in 0.5.2
### [0.5.2]
- Fix: Add consistency in the child theme snippets.
- Add: New snippets for JS logs.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"bugs": {
"url": "https://github.com/bahiirwa/classicpress-snippets/issues"
},
"version": "0.5.2",
"version": "0.5.3",
"engines": {
"vscode": "^1.18.0"
},
Expand Down
26 changes: 13 additions & 13 deletions snippets/php/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@
"body": [
"// @param string $message Error needed for print",
"// @param string $pre Context text string for where logging happens / expected data should be",
"dd( ${1:$message}, ${2:$pre} );"
"dd( ${1:\\$message}, ${2:\\$pre} );"
],
"description": "Uses clog_detailed in helpers to Log PHP errors with context in the debug.php file."
},
"clog_detailed": {
"prefix": "clog_detailed",
"dd_detailed": {
"prefix": "dd_detailed",
"body": [
"/**",
"* @param mixed $message Error needed for print",
"* @param string $pre Context text string for where logging happens / expected data should be",
"* @return void",
"*/",
"function dd( ${1:$message}, $pre = '' ) {",
"if ( true === WP_DEBUG && ! defined( 'DOING_CRON' ) && ! defined( 'DOING_AJAX' ) ) {",
"if ( $pre ) {",
"function print_error_log( ${1:\\$message}, $pre = '' ) {",
" if ( true === WP_DEBUG && ! defined( 'DOING_CRON' ) && ! defined( 'DOING_AJAX' ) ) {",
" if ( $pre ) {",
"error_log( $pre );",
"}",
"if ( is_array( ${1:$message} ) || is_object( ${1:$message} ) ) {",
"error_log( print_r( ${1:$message}, true ) );",
"} else {",
"error_log( ${1:$message} );",
"}",
"}",
" }",
" if ( is_array( ${1:\\$message} ) || is_object( ${1:\\$message} ) ) {",
" error_log( print_r( ${1:\\$message}, true ) );",
" } else {",
" error_log( ${1:\\$message} );",
" }",
" }",
"}"
],
"description": "Log PHP errors with context in the debug.php file."
Expand Down

0 comments on commit bf40d53

Please sign in to comment.