{"id":22752,"date":"2023-06-12T16:10:55","date_gmt":"2023-06-12T07:10:55","guid":{"rendered":"https:\/\/motoki-design.co.jp\/wordpress\/?p=22752"},"modified":"2024-03-05T05:26:48","modified_gmt":"2024-03-04T20:26:48","slug":"wp-coding-standards","status":"publish","type":"post","link":"https:\/\/motoki-design.co.jp\/wordpress\/wp-coding-standards\/","title":{"rendered":"WordPress\u2502Web\u5236\u4f5c\u3067\u304a\u3059\u3059\u3081\uff01Visual Studio Code\u306e\u74b0\u5883\u69cb\u7bc9\u2502phpcs phpcbf"},"content":{"rendered":"\n<p>\u4eca\u307e\u3067Visual Studio Code\u3067PHP\u3092\u66f8\u3044\u3066\u305f\u6642\u306f\u5373\u52b9\u6027\u306e\u9ad8\u3044\u30d7\u30e9\u30b0\u30a4\u30f3\uff08PHP Intelephense\uff09\u3067\u81ea\u52d5\u6574\u5f62\u3092\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001<\/p>\n\n\n\n<p>Windows PC\u304b\u3089MacBookAir\u306b\u5207\u308a\u66ff\u3048\u305f\u306e\u3092\u6a5f\u306bWordPress\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304f\u308c\u308b\u5b9a\u756a\u306eVisual Studio Code\u306e\u74b0\u5883\u69cb\u7bc9\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"is-style-icon_info\">Windows\u306e\u5834\u5408\u306f\u74b0\u5883\u69cb\u7bc9\u304c\u96e3\u3057\u3044\u30b1\u30fc\u30b9\u304c\u591a\u3044\u306e\u3067\u3001Web\u5236\u4f5c\u306fMac\u306e\u65b9\u304c\u8272\u3005\u3068\u826f\u3044\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Web\u5236\u4f5c\u3067\u304a\u3059\u3059\u3081\u306eVisual Studio Code\u306e\u74b0\u5883\u69cb\u7bc9<\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u4e8c\u3064\u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u5c0e\u5165\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>phpcs\u3000\u2192\u3000\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3092\u5143\u306b\u30b3\u30fc\u30c9\u306e\u72b6\u614b\u3092\u81ea\u52d5\u691c\u77e5<\/li>\n\n\n\n<li>phpcbf\u3000\u2192\u3000\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u901a\u308a\u306b\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u6574\u5f62<\/li>\n<\/ul>\n\n\n\n<p>\u4eca\u56de\u3001\u5c0e\u5165\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001Mac\u306eHomebrew\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u72b6\u614b\u304c\u524d\u63d0\u6761\u4ef6\u3068\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>Composer\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>brew install composer<\/code><\/pre><\/div>\n\n\n\n<p>\u5b8c\u4e86\u3057\u305f\u3089<code>composer -v<\/code>\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">CodeSniffer\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>composer global require &quot;squizlabs\/php_codesniffer=*&quot;<\/code><\/pre><\/div>\n\n\n\n<p>\u5b8c\u4e86\u3057\u305f\u3089<code>\/Users\/{\u30e6\u30fc\u30b6\u30fc\u540d}\/.composer\/vendor\/bin\/phpcs --version<\/code>\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7d9a\u3044\u3066\u30d1\u30b9\u306e\u767b\u9332<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>echo &#39;export PATH=$HOME\/.composer\/vendor\/bin:$PATH&#39; &gt;&gt; ~\/.bash_profile\nsource ~\/.bash_profile<\/code><\/pre><\/div>\n\n\n\n<p>\u7d42\u308f\u3063\u305f\u3089<code>phpcs -i<\/code>\u3067\u78ba\u8a8d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WordPress\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>composer global require wp-coding-standards\/wpcs<\/code><\/pre><\/div>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fWordPress\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3092\u30bb\u30c3\u30c8<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>phpcs --config-set installed_paths ~\/wpcs<\/code><\/pre><\/div>\n\n\n\n<p>\u6700\u5f8c\u306b<code>phpcs -i<\/code>\u3067\u78ba\u8a8d\u3057\u3066WordPress\u3068\u3044\u3046\u6587\u5b57\u304c\u78ba\u8a8d\u3067\u304d\u308c\u3070OK\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-icon_pen\">\u78ba\u8a8d\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u30bb\u30c3\u30c8\u304c\u4e0a\u624b\u304f\u3044\u3063\u3066\u306a\u3044\u306e\u3067\u3001\u3084\u308a\u76f4\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u6642\u70b9\u3067\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u3044\u3066\u30b3\u30fc\u30c9\u306e\u72b6\u614b\u3092\u30c1\u30a7\u30c3\u30af\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-border_left\">\u53c2\u8003<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>phpcs \/Users\/motoki\/Documents\/wordpress\/themes\/my-theme\/index.php  <\/code><\/pre><\/div>\n\n\n\n<p>\u7d50\u679c<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>FILE: \/Users\/motoki\/Documents\/wordpress\/themes\/my-theme\/index.php\n---------------------------------------------------------------------------\nFOUND 14 ERRORS AFFECTING 7 LINES\n---------------------------------------------------------------------------\n 1 | ERROR | [ ] Missing file doc comment\n 3 | ERROR | [x] Tabs must be used to indent lines; spaces are not allowed\n 3 | ERROR | [x] Opening PHP tag must be on a line by itself\n 3 | ERROR | [x] No space after opening parenthesis is prohibited\n 3 | ERROR | [x] No space before closing parenthesis is prohibited\n 4 | ERROR | [x] Tabs must be used to indent lines; spaces are not allowed\n 4 | ERROR | [x] No space after opening parenthesis is prohibited\n 4 | ERROR | [x] No space before closing parenthesis is prohibited\n 4 | ERROR | [x] Newline required after opening brace\n 5 | ERROR | [x] Tabs must be used to indent lines; spaces are not allowed\n 6 | ERROR | [x] Tabs must be used to indent lines; spaces are not allowed\n 7 | ERROR | [x] Tabs must be used to indent lines; spaces are not allowed\n 7 | ERROR | [x] Closing PHP tag must be on a line by itself\n 9 | ERROR | [x] File must end with a newline character\n---------------------------------------------------------------------------\nPHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n---------------------------------------------------------------------------<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>phpcbf \/Users\/motoki\/Documents\/wordpress\/themes\/my-theme\/index.php  <\/code><\/pre><\/div>\n\n\n\n<p>\u7d50\u679c<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>PHPCBF RESULT SUMMARY\n------------------------------------------------------------------------------\nFILE                                                          FIXED  REMAINING\n------------------------------------------------------------------------------\n\/Users\/motoki\/Documents\/wordpress\/themes\/suimin\/index.php     13     1\n------------------------------------------------------------------------------\nA TOTAL OF 13 ERRORS WERE FIXED IN 1 FILE\n------------------------------------------------------------------------------\n<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u3053\u3067\u78ba\u8a8d\u3067\u304d\u308c\u3070\u3001\u3042\u3068\u306fVisual Studio Code\u306e\u8a2d\u5b9a\u3068\u9023\u643a\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Visual Studio Code\u306e\u8a2d\u5b9a<\/h3>\n\n\n\n<p>2\u3064\u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u540c\u3058\u540d\u524d\u3067\u62e1\u5f35\u6a5f\u80fd\u3092\u767b\u9332\u3057\u3066\u3044\u308b\u4eba\u304c\u3044\u308b\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><strong>phpcbf<\/strong>\u3000 \u5236\u4f5c\u8005\u306fPer Soderlind<\/p>\n\n\n\n<p><strong>phpcs<\/strong>\u3000 \u5236\u4f5c\u8005\u306fIoannis Kappas\u3000\u203b\u62e1\u5f35\u6a5f\u80fd\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u6b62\u307e\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u73fe\u72b6\u3053\u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u4f7f\u3046\u306e\u304c\u30d9\u30b9\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"812\" height=\"243\" src=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.15.26-812x243.png\" alt=\"\" class=\"wp-image-22753\" srcset=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.15.26-812x243.png 812w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.15.26-382x114.png 382w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.15.26-768x230.png 768w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.15.26.png 924w\" sizes=\"(max-width: 812px) 100vw, 812px\" \/><\/figure>\n\n\n\n<p>\u6b21\u306b\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>Ctrl+Shift+P\u3092\u53e9\u3044\u3066\u3001\u57fa\u672c\u8a2d\u5b9a\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"812\" height=\"124\" src=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.18.50-812x124.png\" alt=\"\" class=\"wp-image-22754\" srcset=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.18.50-812x124.png 812w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.18.50-382x58.png 382w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.18.50-768x118.png 768w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.18.50.png 924w\" sizes=\"(max-width: 812px) 100vw, 812px\" \/><\/figure>\n\n\n\n<p>\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u3066 settings.json\u3067\u7de8\u96c6\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"812\" height=\"288\" src=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.19.02-812x288.png\" alt=\"\" class=\"wp-image-22755\" srcset=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.19.02-812x288.png 812w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.19.02-382x135.png 382w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.19.02-768x272.png 768w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.19.02.png 924w\" sizes=\"(max-width: 812px) 100vw, 812px\" \/><\/figure>\n\n\n\n<p>\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u3092\u633f\u5165\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u203bmotoki\u306e\u90e8\u5206\u306f\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>{\n  &quot;editor.detectIndentation&quot;: false,\n\t&quot;editor.insertSpaces&quot;: false,\n\t&quot;editor.tabSize&quot;: 4,\n\t&quot;files.eol&quot;: &quot;\\n&quot;,\n\t&quot;phpcs.executablePath&quot;: &quot;\/Users\/motoki\/.composer\/vendor\/squizlabs\/php_codesniffer\/bin\/phpcs&quot;,\n\t&quot;phpcbf.executablePath&quot;: &quot;\/Users\/motoki\/.composer\/vendor\/squizlabs\/php_codesniffer\/bin\/phpcbf&quot;,\n\t&quot;phpcs.standard&quot;: &quot;WordPress&quot;,\n\t&quot;phpcbf.standard&quot;: &quot;WordPress&quot;,\n\t&quot;phpcbf.onsave&quot;: true,\n\t&quot;security.workspace.trust.untrustedFiles&quot;: &quot;open&quot;,\n\t&quot;editor.codeActionsOnSave&quot;: {\n\t},\n}<\/code><\/pre><\/div>\n\n\n\n<p class=\"is-style-border_left\">\u53c2\u8003<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<a href=\"http:\/\/tech.hi-works.com\/webcreative\/1064\" class=\"c-blogLink -external\" data-style=\"text\" target=\"_blank\" rel=\"noopener noreferrer\">\n\t\t\t\t<!-- <i class=\"c-blogLink__icon icon-link\" role=\"presentation\"><\/i> -->\n\t\t\t\t<span class=\"c-blogLink__icon\">\n\t\t\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"swl-svg-externalLink __svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 48 48\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M44 2H30c-1.1 0-2 .9-2 2s.9 2 2 2h9.2L24 21.2c-.8.8-.8 2 0 2.8s2 .8 2.8 0L42 8.8V18c0 1.1.9 2 2 2s2-.9 2-2V4c0-1.1-.9-2-2-2z\" \/><path d=\"M41 27c-1.1 0-2 .9-2 2v10c0 1.1-.9 2-2 2H9c-1.1 0-2-.9-2-2V11c0-1.1.9-2 2-2h10c1.1 0 2-.9 2-2s-.9-2-2-2H9c-3.3 0-6 2.7-6 6v28c0 3.3 2.7 6 6 6h28c3.3 0 6-2.7 6-6V29c0-1.1-.9-2-2-2z\" \/><\/svg>\t\t\t\t<\/span>\n\t\t\t\t<span class=\"c-blogLink__text\">VS Code \u3067 phpcs \u3068 phpcbf \u3092\u4f7f\u3063\u3066WordPress\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3067\u81ea\u52d5\u6574\u5f62\u3059\u308b | H.I. Art Work&#8230;<\/span>\n\t\t\t<\/a>\n\t\t<\/div>\n\n\n<p>\u4ee5\u4e0b\u3001\u89e3\u8aac\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u8a2d\u5b9a<\/th><th>\u5099\u8003<\/th><\/tr><\/thead><tbody><tr><td>editor.detectIndentation<\/td><td>\u3053\u306e\u8a2d\u5b9a\u3092false\u306b\u3059\u308b\u3068\u3001VS Code\u306f\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u305f\u3073\u306b\u30a4\u30f3\u30c7\u30f3\u30c8\u8a2d\u5b9a\uff08\u30b9\u30da\u30fc\u30b9\u307e\u305f\u306f\u30bf\u30d6\uff09\u3092\u81ea\u52d5\u7684\u306b\u63a8\u6e2c\u3057\u3088\u3046\u3068\u306f\u3057\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u30a4\u30f3\u30c7\u30f3\u30c8\u30b9\u30bf\u30a4\u30eb\u304c\u56fa\u5b9a\u3067\u3042\u308b\u5834\u5408\u3084\u3001\u7570\u306a\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u9593\u3067\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u305f\u3081\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/td><\/tr><tr><td>editor.insertSpaces<\/td><td>\u3053\u306e\u8a2d\u5b9a\u3092false\u306b\u3059\u308b\u3068\u3001VS Code\u306f\u30bf\u30d6\u30ad\u30fc\u3092\u62bc\u3057\u305f\u3068\u304d\u306b\u30b9\u30da\u30fc\u30b9\u3067\u306f\u306a\u304f\u30bf\u30d6\u3092\u633f\u5165\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>editor.tabSize<\/td><td>\u30bf\u30d6\u30ad\u30fc\u3092\u62bc\u3057\u305f\u3068\u304d\u306bVS Code\u304c\u633f\u5165\u3059\u308b\u30b9\u30da\u30fc\u30b9\u306e\u6570\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u30bf\u30d6\u306f4\u3064\u306e\u30b9\u30da\u30fc\u30b9\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/td><\/tr><tr><td>phpcs.executablePath<\/td><td>PHP CodeSniffer\u306e\u5b9f\u884c\u53ef\u80fd\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002PHP CodeSniffer\u306f\u3001PHP\u30b3\u30fc\u30c9\u306b\u5bfe\u3059\u308b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306e\u9055\u53cd\u3092\u691c\u51fa\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/td><\/tr><tr><td>phpcbf.executablePath<\/td><td>PHP Code Beautifier and Fixer\u306e\u5b9f\u884c\u53ef\u80fd\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u30c4\u30fc\u30eb\u306f\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306b\u9055\u53cd\u3059\u308b\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u7684\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>phpcs.standard<\/td><td>PHP CodeSniffer\u306b\u3088\u3063\u3066\u4f7f\u7528\u3055\u308c\u308b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001WordPress\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/td><\/tr><tr><td>phpcbf.standard<\/td><td>PHP Code Beautifier and Fixer\u306b\u3088\u3063\u3066\u4f7f\u7528\u3055\u308c\u308b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001WordPress\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/td><\/tr><tr><td>phpcbf.onsave<\/td><td>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3073\u306bPHP Code Beautifier and Fixer\u304c\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>security.workspace.trust.untrustedFiles<\/td><td>\u4fe1\u983c\u3055\u308c\u3066\u3044\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3068\u304d\u306e\u52d5\u4f5c\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u3067\u306f\u3001VS Code\u306f\u4fe1\u983c\u3055\u308c\u3066\u3044\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3053\u3068\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>editor.codeActionsOnSave<\/td><td>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3059\u308b\u3068\u304d\u306b\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3055\u308c\u308b\u30b3\u30fc\u30c9\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u4ee5\u4e0b\u306b\u3001\u6307\u5b9a\u3055\u308c\u305f\u8a2d\u5b9a\u306e\u5404\u884c\u306e\u8a73\u7d30\u306a\u8aac\u660e\u3092\u63d0\u4f9b\u3057\u307e\u3059\uff1a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u3042\u3068\u306f\u5b9f\u969b\u306ephp\u30d5\u30a1\u30a4\u30eb\u3092\u3092\u958b\u304d\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u306e\u30a6\u30a4\u30f3\u30c9\u30a6\u306e\u554f\u984c\u306e\u3068\u3053\u308d\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u89e3\u6c7a\u3059\u308b\u3079\u304d\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"812\" height=\"238\" src=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.58.46-812x238.png\" alt=\"\" class=\"wp-image-22756\" srcset=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.58.46-812x238.png 812w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.58.46-382x112.png 382w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.58.46-768x225.png 768w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-11-23.58.46.png 834w\" sizes=\"(max-width: 812px) 100vw, 812px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u4fdd\u5b58\u6642\u306bphpcbf\uff08\u81ea\u52d5\u6574\u5f62\uff09\u304c\u5b9f\u884c\u3055\u308c\u306a\u3044\u6642<\/h3>\n\n\n\n<p>\u4e00\u5ea6\u3001\u30b3\u30fc\u30c9\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u624b\u52d5\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u95a2\u9023\u3065\u3051\u3089\u308c\u308c\u3070\u3001\u6b21\u56de\u4fdd\u5b58\u6642\u306bphpcbf\uff08\u81ea\u52d5\u6574\u5f62\uff09\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"634\" height=\"578\" src=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-17-10.34.44.png\" alt=\"\" class=\"wp-image-22775\" srcset=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-17-10.34.44.png 634w, https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-06-17-10.34.44-382x348.png 382w\" sizes=\"(max-width: 634px) 100vw, 634px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">phpcs\u306e\u30a8\u30e9\u30fc\u30b3\u30fc\u30c9\u89e3\u6c7a\u96c6<\/h2>\n\n\n\n<p>\u3088\u304f\u691c\u51fa\u3055\u308c\u308b\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\u306e\u5099\u5fd8\u9332\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Missing file doc comment\u30a8\u30e9\u30fc<\/h3>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u5148\u982d\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u30b3\u30e1\u30f3\u30c8\uff08doc comment\uff09\u3092\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u89e3\u6c7a\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001\u4e0b\u8a18\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u5bfe\u8c61\u306e\u884c\u306b\u5165\u308c\u308b\u3068\u554f\u984c\u304c\u7121\u8996\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code> \/\/ phpcs:ignores<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Using short ternaries is not allowed\u30a8\u30e9\u30fc<\/h3>\n\n\n\n<p>PHP\u306e\u77ed\u7e2e\u5f62\u4e09\u9805\u6f14\u7b97\u5b50 (<code>?:<\/code>) \u306f\u3001WordPress\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3067\u306f\u8a31\u53ef\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u5b8c\u5168\u306a\u4e09\u9805\u6f14\u7b97\u5b50 (<code>? :<\/code>) \u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>$voice_text = get_field( &#39;voice_text&#39; ) ?: &#39;\u3053\u3053\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u5165\u308a\u307e\u3059&#39;;<\/code><\/pre><\/div>\n\n\n\n<p class=\"has-text-align-center\">\u2193<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>$voice_text = get_field( &#39;voice_text&#39; ) ? get_field( &#39;voice_text&#39; ) : &#39;\u3053\u3053\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u5165\u308a\u307e\u3059&#39;;<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">All output should be run through an escaping function\u30a8\u30e9\u30fc<\/h3>\n\n\n\n<p>\u51fa\u529b\u3055\u308c\u308b\u5168\u3066\u306e\u6587\u5b57\u5217\u306f\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u7406\u7531\u304b\u3089\u30a8\u30b9\u30b1\u30fc\u30d7\u51e6\u7406\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>WordPress\u3067\u306f\u3053\u308c\u3092\u884c\u3046\u305f\u3081\u306e\u95a2\u6570\u304c\u3044\u304f\u3064\u304b\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u5834\u5408\u3001<code>esc_html()<\/code>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30a8\u30b9\u30b1\u30fc\u30d7\u51e6\u7406\u3092\u3057\u307e\u3059<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>&lt;?php echo $voice_text; ?&gt;<\/code><\/pre><\/div>\n\n\n\n<p class=\"has-text-align-center\">\u2193<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>&lt;?php echo esc_html( $voice_text ); ?&gt;<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Found precision alignment of 2 spaces\u30a8\u30e9\u30fc<\/h3>\n\n\n\n<p>Ctrl + A\u3067\u30b3\u30fc\u30c9\u3092\u5168\u9078\u629e\u3057\u3066\u3001Shift + Tab\u3067\u4e00\u65e6\u7a7a\u767d\u3092\u6d88\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u5f8c\u81ea\u52d5\u6574\u5f62\u304c\u52b9\u3044\u3066\u7dba\u9e97\u306a\u30a4\u30f3\u30c7\u30f3\u30c8\u306b\u4fee\u6b63\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>PC\u3092mac\u306b\u79fb\u884c\u3057\u3066\u3001\u3061\u3083\u3093\u3068\u3057\u305f\u74b0\u5883\u69cb\u7bc9\u304c\u3067\u304d\u305f\u3068\u3053\u308d\u3067\u3001<\/p>\n\n\n\n<p>\u3082\u3063\u3068\u65e9\u304f\u3084\u3063\u3066\u304a\u3051\u3070\u3088\u304b\u3063\u305f\u3068\u601d\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3067\u3055\u3089\u306b\u3088\u308a\u826f\u3044\u3082\u306e\u304c\u4f5c\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6c17\u306b\u306a\u3063\u305f\u65b9\u306f\u662f\u975e\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-content\/uploads\/wp-env-382x215.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/motoki-design.co.jp\/wordpress\/wp-env\/\">WordPress\u2502wp-env\u306e\u74b0\u5883\u69cb\u7bc9\u30fb\u4f7f\u3044\u65b9<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u3044\u3064\u3082\u306fLocal\u3092\u4f7f\u3063\u3066Web\u5236\u4f5c\u3092\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001 PC\u3092MacBookAir\u306b\u5909\u3048\u305f\u306e\u3067\u3001\u516c\u5f0f\u304c\u63a8\u5968\u3057\u3066\u3044\u308bwp-env\u306e\u74b0\u5883\u69cb\u7bc9\u3092\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u7d50\u8ad6\u3092\u8a00\u3046\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30ef\u30fc&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>\u4eca\u307e\u3067Visual Studio Code\u3067PHP\u3092\u66f8\u3044\u3066\u305f\u6642\u306f\u5373\u52b9\u6027\u306e\u9ad8\u3044\u30d7\u30e9\u30b0\u30a4\u30f3\uff08PHP Intelephense\uff09\u3067\u81ea\u52d5\u6574\u5f62\u3092\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001 Windows PC\u304b\u3089MacBookAir\u306b\u5207\u308a\u66ff\u3048\u305f\u306e\u3092\u6a5f\u306bW [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":22758,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pochipp_cv_data":"","swell_btn_cv_data":"","footnotes":""},"categories":[83],"tags":[],"area":[],"class_list":["post-22752","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tools"],"_links":{"self":[{"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/posts\/22752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/comments?post=22752"}],"version-history":[{"count":1,"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/posts\/22752\/revisions"}],"predecessor-version":[{"id":24289,"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/posts\/22752\/revisions\/24289"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/media\/22758"}],"wp:attachment":[{"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/media?parent=22752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/categories?post=22752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/tags?post=22752"},{"taxonomy":"area","embeddable":true,"href":"https:\/\/motoki-design.co.jp\/wordpress\/wp-json\/wp\/v2\/area?post=22752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}