{"id":55736,"date":"2022-11-08T18:10:10","date_gmt":"2022-11-08T12:40:10","guid":{"rendered":"https:\/\/2thenew.online\/blog\/?p=55736"},"modified":"2022-11-08T18:10:10","modified_gmt":"2022-11-08T12:40:10","slug":"check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook","status":"publish","type":"post","link":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/","title":{"rendered":"Check Drupal coding standard by phpcs in git pre-commit hook"},"content":{"rendered":"<div><span style=\"color: #24292f; font-family: -apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-55735 alignleft\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/11\/usage-of-phpcs-on-github-via-pull-request-for-drupal-applications-png-788\u00d7443--300x165.png\" alt=\"Blog image\" width=\"278\" height=\"153\" srcset=\"https:\/\/2thenew.online\/blog\/wp-content\/uploads\/2022\/11\/usage-of-phpcs-on-github-via-pull-request-for-drupal-applications-png-788\u00d7443--300x165.png 300w, https:\/\/2thenew.online\/blog\/wp-content\/uploads\/2022\/11\/usage-of-phpcs-on-github-via-pull-request-for-drupal-applications-png-788\u00d7443--1024x564.png 1024w, https:\/\/2thenew.online\/blog\/wp-content\/uploads\/2022\/11\/usage-of-phpcs-on-github-via-pull-request-for-drupal-applications-png-788\u00d7443--768x423.png 768w, https:\/\/2thenew.online\/blog\/wp-content\/uploads\/2022\/11\/usage-of-phpcs-on-github-via-pull-request-for-drupal-applications-png-788\u00d7443--624x344.png 624w, https:\/\/2thenew.online\/blog\/wp-content\/uploads\/2022\/11\/usage-of-phpcs-on-github-via-pull-request-for-drupal-applications-png-788\u00d7443-.png 1528w\" sizes=\"auto, (max-width: 278px) 100vw, 278px\" \/><\/span><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<p><span style=\"color: #24292f; font-family: -apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;\">In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors.<\/span><\/p>\n<div>\n<h2><strong>Follow the next steps to set up the pre-commit git hook with Drupal coding standards:<\/strong><\/h2>\n<ol>\n<li>Create hooks directory on root project.<\/li>\n<li>Create a pre-commit file in the hooks directory.<\/li>\n<li>Add the below pre-commit code to the hooks\/pre-commit file.<\/li>\n<\/ol>\n<blockquote class=\"gmail_quote\">\n<pre>#!\/bin\/bash\r\n\r\nSTANDARD=\"Drupal\"\r\nBIN=\".\/vendor\/bin\"\r\n\r\necho\r\necho \"Drupal Coder pre-commit hook \u2013 commit with the --no-verify option to skip the hook\"\r\necho\r\n\r\n# Check whether PHP_CodeSniffer can be found\r\nif [ ! -f \"$BIN\/phpcs\" ]\r\nthen\r\n  echo \"Drupal Coder not found \u2013 is it installed? 'composer require drupal\/coder'\"\r\n  echo\r\n  exit 1\r\nfi\r\n\r\n# Retrieve staged files\r\nFILES=$(git diff --cached --name-only --diff-filter=ACMR HEAD)\r\n\r\n# Run the sniffer\r\necho \"Running Drupal Coder.\"\r\necho\r\nPHPCS=(\"$BIN\/phpcs\" \"--standard=$STANDARD\" \"--filter=gitstaged\" \"--encoding=utf-8\" \"-p\" \".\")\r\n\"${PHPCS[@]}\"\r\n\r\n# Syntax Error\r\nif [ $? != 0 ]\r\nthen\r\n  echo \"Please fix each violations detected.\"\r\n  echo\r\n  exit 1\r\nfi\r\n\r\n# Syntax OK\r\nif [ $? == 0 ]\r\nthen\r\n  echo \"No violations detected\"\r\n  echo\r\n  exit 0\r\nfi<\/pre>\n<\/blockquote>\n<h2><strong>Add PHP commands on the scripts section of the composer.json file.<\/strong><\/h2>\n<blockquote>\n<pre class=\"gmail_quote\">\"scripts\": {\r\n\u00a0 \u00a0 \u00a0 \"post-install-cmd\": [\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"php -r \\\"copy('hooks\/pre-commit', '.git\/hooks\/pre-commit');\\\"\",\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"php -r \\\"chmod('.git\/hooks\/pre-commit', 0755);\\\"\"\r\n\u00a0 \u00a0 \u00a0 ]\r\n}<\/pre>\n<\/blockquote>\n<div><\/div>\n<div>Now execute <b>Composer install<\/b>\u00a0in your project directory<\/div>\n<\/div>\n<div>Composer install will mv hooks\/pre-commit file to .git\/hooks\/pre-commit.<\/div>\n<div><\/div>\n<div>\n<h2>How to use it<\/h2>\n<\/div>\n<div>\n<pre>git commit -m <span class=\"gmail-pl-s\"><span class=\"gmail-pl-pds\">\"<\/span>The commit message.<span class=\"gmail-pl-pds\">\"<\/span><\/span><\/pre>\n<p>This is going to execute Drupal Coder on each file and returns messages on the terminal in case of finding errors on files.<\/p>\n<div><\/div>\n<\/div>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next [&hellip;]<\/p>\n","protected":false},"author":1368,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":81,"footnotes":""},"categories":[3602],"tags":[4862],"class_list":["post-55736","post","type-post","status-publish","format-standard","hentry","category-drupal","tag-drupal"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Rajveer Singh\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#article\",\"name\":\"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog\",\"headline\":\"Check Drupal coding standard by phpcs in git pre-commit hook\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rajveer-singh\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2022\\\/11\\\/usage-of-phpcs-on-github-via-pull-request-for-drupal-applications-png-788\\u00d7443--300x165.png\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#articleImage\"},\"datePublished\":\"2022-11-08T18:10:10+05:30\",\"dateModified\":\"2022-11-08T18:10:10+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#webpage\"},\"articleSection\":\"Drupal, Drupal\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"name\":\"Drupal\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"position\":2,\"name\":\"Drupal\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#listItem\",\"name\":\"Check Drupal coding standard by phpcs in git pre-commit hook\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#listItem\",\"position\":3,\"name\":\"Check Drupal coding standard by phpcs in git pre-commit hook\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"name\":\"Drupal\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rajveer-singh\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rajveer-singh\\\/\",\"name\":\"Rajveer Singh\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/69db7071-beb6-4673-aa20-5c7b9af9de0a_Rajveer-Singh-Profile-Pitcure.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Rajveer Singh\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/\",\"name\":\"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog\",\"description\":\"In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rajveer-singh\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rajveer-singh\\\/#author\"},\"datePublished\":\"2022-11-08T18:10:10+05:30\",\"dateModified\":\"2022-11-08T18:10:10+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog","description":"In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next","canonical_url":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#article","name":"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog","headline":"Check Drupal coding standard by phpcs in git pre-commit hook","author":{"@id":"https:\/\/2thenew.online\/blog\/author\/rajveer-singh\/#author"},"publisher":{"@id":"https:\/\/2thenew.online\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2022\/11\/usage-of-phpcs-on-github-via-pull-request-for-drupal-applications-png-788\u00d7443--300x165.png","@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#articleImage"},"datePublished":"2022-11-08T18:10:10+05:30","dateModified":"2022-11-08T18:10:10+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#webpage"},"articleSection":"Drupal, Drupal"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.online\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/drupal\/#listItem","name":"Drupal"}},{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/drupal\/#listItem","position":2,"name":"Drupal","item":"https:\/\/2thenew.online\/blog\/category\/drupal\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#listItem","name":"Check Drupal coding standard by phpcs in git pre-commit hook"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#listItem","position":3,"name":"Check Drupal coding standard by phpcs in git pre-commit hook","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/drupal\/#listItem","name":"Drupal"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.online\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.online\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.online\/blog\/author\/rajveer-singh\/#author","url":"https:\/\/2thenew.online\/blog\/author\/rajveer-singh\/","name":"Rajveer Singh","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/69db7071-beb6-4673-aa20-5c7b9af9de0a_Rajveer-Singh-Profile-Pitcure.jpeg","width":96,"height":96,"caption":"Rajveer Singh"}},{"@type":"WebPage","@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#webpage","url":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/","name":"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog","description":"In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.online\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.online\/blog\/author\/rajveer-singh\/#author"},"creator":{"@id":"https:\/\/2thenew.online\/blog\/author\/rajveer-singh\/#author"},"datePublished":"2022-11-08T18:10:10+05:30","dateModified":"2022-11-08T18:10:10+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.online\/blog\/#website","url":"https:\/\/2thenew.online\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.online\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog","og:description":"In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next","og:url":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/","og:image":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Check Drupal coding standard by phpcs in git pre-commit hook | TO THE NEW Blog","twitter:description":"In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git. Git pre-commit validates Drupal coding standards on files before committing them and returns a message to fix each line of code on the files having errors. Follow the next","twitter:image":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"55736","title":null,"description":null,"keywords":[],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":{"id":"#aioseo-article-65e0509231121","slug":"article","graphName":"Article","label":"Article","properties":{"type":"BlogPosting","name":"#post_title","headline":"#post_title","description":"#post_excerpt","image":"","keywords":"","author":{"name":"#author_name","url":"#author_url"},"dates":{"include":true,"datePublished":"","dateModified":""}}},"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2022-11-08 12:37:03","updated":"2024-02-29 09:38:26","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.online\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.online\/blog\/category\/drupal\/\" title=\"Drupal\">Drupal<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCheck Drupal coding standard by phpcs in git pre-commit hook\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.online\/blog"},{"label":"Drupal","link":"https:\/\/2thenew.online\/blog\/category\/drupal\/"},{"label":"Check Drupal coding standard by phpcs in git pre-commit hook","link":"https:\/\/2thenew.online\/blog\/check-drupal-coding-standard-by-phpcs-in-git-pre-commit-hook\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/55736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/users\/1368"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/comments?post=55736"}],"version-history":[{"count":2,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/55736\/revisions"}],"predecessor-version":[{"id":55756,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/55736\/revisions\/55756"}],"wp:attachment":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/media?parent=55736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/categories?post=55736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/tags?post=55736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}