{"id":5780,"date":"2021-09-30T16:52:14","date_gmt":"2021-09-30T07:52:14","guid":{"rendered":"https:\/\/www.sria.co.jp\/blog\/?p=5780"},"modified":"2021-09-30T16:56:34","modified_gmt":"2021-09-30T07:56:34","slug":"5780","status":"publish","type":"post","link":"https:\/\/www.sria.co.jp\/blog\/2021\/09\/5780\/","title":{"rendered":"\u3010PHP\u3011PSR\u6982\u8981"},"content":{"rendered":"<p>\u3069\u3082\u3001\u30ab\u30ed\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u3001PSR\u306b\u3064\u3044\u3066\u8abf\u3079\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u5143\u304c\u82f1\u6587\u3067\u3001\u4e14\u3064\u5185\u5bb9\u304c\u5805\u82e6\u3057\u304f\u3001\u7406\u89e3\u306b\u82e6\u3057\u3080\u90e8\u5206\u304c\u6709\u3063\u305f\u306e\u3067\u8981\u7d04\u3057\u305f\u3082\u306e\u3092\u30d6\u30ed\u30b0\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306f\u6982\u8981\u306e\u307f\u3067\u3059\u304c\u3001<span>PSR-0\uff5e20\u307e\u3067\u9806\u6b21\u7ffb\u8a33\u3001\u8981\u7d04\u3057\u305f\u3082\u306e\u3092\u30d6\u30ed\u30b0\u306b\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h1>\u305d\u3082\u305d\u3082PSR \u3068\u306f\uff1f<\/h1>\n<p>PSR\uff08PHP Standards Recommendations \u306e\u7565\uff09\u3068\u306f\u3001<\/p>\n<p>\u65e5\u672c\u8a9e\u3067\u306f\u300cPHP\u6a19\u6e96\u52e7\u544a\u300d\u3068\u8a33\u3055\u308c\u3001PHP-FIG\uff08PHP Framework Interop Group \uff09\u304c\u7b56\u5b9a\u3057\u3066\u3044\u308bPHP\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1>PSR\u4e00\u89a7<\/h1>\n<p><a href=\"https:\/\/www.php-fig.org\/psr\/\">PHP-FIG\u306e\u30b5\u30a4\u30c8<\/a>\u3092\u898b\u308b\u3068\u4e00\u89a7\u304c\u3042\u308a\u3001ACCEPTED\u3055\u308c\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u5168\u90e8\u306718\uff08\u5168\u4f53\u3067\u306f20\uff09\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u73fe\u5728\u30c9\u30e9\u30d5\u30c8\u306e\u3082\u306e\u3084\u3001\u975e\u63a8\u5968\u3068\u306a\u3063\u305f\u3082\u306e\u3082\u4e00\u89a7\u3067\u898b\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>2021\u5e749\u670830\u65e5\u6642\u70b9\u3067\u306f\u4ee5\u4e0b\u306e2\u3064\u304c\u975e\u63a8\u5968\uff08<span>Deprecated<\/span>\uff09\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.php-fig.org\/psr\/psr-0\/\">PSR-0 Autoloading Standard<\/a><br \/>\n<a href=\"https:\/\/www.php-fig.org\/psr\/psr-2\/\">PSR-2 Coding Style Guide<\/a><\/p>\n<p style=\"padding-left: 40px;\">\n<style type=\"text\/css\">\n <!-- table,td,th { border-collapse: collapse; border:1px solid #333; } td { padding: 10px 20px; } \/\/--> <\/style>\n<\/p>\n<p>PSR\u4e00\u89a7\uff082021\u5e749\u670830\u65e5\u6642\u70b9\uff09<\/p>\n<div style=\"padding-left: 40px;\">\n<table style=\"border: 1px solid #333; border-collapse: collapse;\">\n<thead>\n<tr>\n<th style=\"text-align: center; padding-left: 30px; padding-right: 30px;\">PSR<\/th>\n<th style=\"text-align: center; padding-left: 30px; padding-right: 30px;\">TITLE<\/th>\n<th style=\"text-align: center; padding-left: 30px; padding-right: 30px;\">STATUS<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span style=\"color: #808080;\">0<\/span><\/td>\n<td><span style=\"color: #808080;\"><a href=\"https:\/\/www.php-fig.org\/psr\/psr-0\/\" style=\"color: #808080;\">Autoloading Standard<\/a><\/span><\/td>\n<td><span>Deprecated<\/span><\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-1\/\">Basic Coding Standard<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #808080;\">2<\/span><\/td>\n<td><span style=\"color: #808080;\"><a href=\"https:\/\/www.php-fig.org\/psr\/psr-2\/\" style=\"color: #808080;\">Coding Style Guide<\/a><\/span><\/td>\n<td><span>Deprecated<\/span><\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-3\/\">Logger Interface<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-4\/\">Autoloading Standard<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-5\/\">PHPDoc Standard<\/a><\/td>\n<td><span>Draft<\/span><\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-6\/\">Caching Interface<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-7\/\">HTTP Message Interface<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-8\/\">Huggable Interface<\/a><\/td>\n<td><span>Abandoned<\/span><\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-9\/\">Security Advisories<\/a><\/td>\n<td><span>Abandoned<\/span><\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-10\/\">Security Reporting Process<\/a><\/td>\n<td><span>Abandoned<\/span><\/td>\n<\/tr>\n<tr>\n<td>11<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-11\/\">Container Interface<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-12\/\">Extended Coding Style Guide<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>13<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-13\/\">Hypermedia Links<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-14\/\">Event Dispatcher<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>15<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-15\/\">HTTP Handlers<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-16\/\">Simple Cache<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>17<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-17\/\">HTTP Factories<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-18\/\">HTTP Client<\/a><\/td>\n<td><span>Accepted<\/span><\/td>\n<\/tr>\n<tr>\n<td>19<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-19\/\">PHPDoc tags<\/a><\/td>\n<td><span>Draft<\/span><\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td><a href=\"https:\/\/www.php-fig.org\/psr\/psr-20\/\">Clock<\/a><\/td>\n<td><span>Draft<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h2>\u30b9\u30c6\u30fc\u30bf\u30b9\u306b\u3064\u3044\u3066<\/h2>\n<ol>\n<li>Pre-Draft\uff08\u63d0\u6848\uff09<\/li>\n<li>Draft\uff08\u8349\u6848\uff09<\/li>\n<li>Review\uff08\u5be9\u67fb\uff09<\/li>\n<li>Accepted\uff08\u627f\u8a8d\uff09\u2026\u6b63\u5f0f\u627f\u8a8d\u3002\u6b63\u5f0f\u306bPSR\u3068\u3057\u3066\u52e7\u544a\u3055\u308c\u305f\u3082\u306e\u3002<\/li>\n<li>Deprecated\uff08\u5ec3\u6b62\u4e88\u5b9a\uff09\u2026\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u7f6e\u63db\u3055\u308c\u305f\u3082\u306e\u3084\u3001\u4e0d\u8981\u306b\u306a\u3063\u305f\u3082\u306e\u3002PSR-0\u306f\u5ec3\u4e88\u5b9a\u3067PSR-4\u306b\u4ee3\u66ff\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/li>\n<li>Abandoned\uff08\u653e\u68c4\uff09<\/li>\n<\/ol>\n<ol><\/ol>\n<ol><\/ol>\n<ol><\/ol>\n<p>&nbsp;<\/p>\n<h2>\u4ed5\u69d8\u306b\u3064\u3044\u3066<\/h2>\n<p><span>PSR\u6587\u66f8\u5185\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b &#8220;MUST&#8221;, &#8220;MUST NOT&#8221;, &#8220;REQUIRED&#8221;, &#8220;SHALL&#8221;, &#8220;SHALL NOT&#8221;, &#8220;SHOULD&#8221;, &#8220;SHOULD NOT&#8221;, &#8220;RECOMMENDED&#8221;, &#8220;MAY&#8221; \u53ca\u3073 &#8220;OPTIONAL&#8221; \u306f\u3001<\/span><\/p>\n<p><a href=\"http:\/\/www.ietf.org\/rfc\/rfc2119.txt\">RFC 2119<\/a><span>\u3067\u8aac\u660e\u3055\u308c\u308b\u8da3\u65e8\u3067\u89e3\u91c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3068\u306e\u3053\u3068<\/span><\/p>\n<ol>\n<li>MUST\u2026\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044<\/li>\n<li>MUST NOT\u2026\u3057\u3066\u306f\u306a\u3089\u306a\u3044<\/li>\n<li>REQUIRED\u2026\u8981\u6c42\u3055\u308c\u3066\u3044\u308b<\/li>\n<li>SHALL\u2026\u3059\u308b\u3053\u3068\u306b\u306a\u308b<\/li>\n<li>SHALL NOT\u2026\u3059\u308b\u3053\u3068\u306f\u306a\u3044<\/li>\n<li>SHOULD\u2026\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b<\/li>\n<li>SHOULD NOT\u2026\u3057\u306a\u3044\u307b\u3046\u304c\u3088\u3044<\/li>\n<li>RECOMMENDED\u2026\u63a8\u5968\u3055\u308c\u308b<\/li>\n<li>MAY\u2026\u3057\u3066\u3082\u3088\u3044<\/li>\n<li>OPTIONAL\u2026\u9078\u629e\u53ef<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h1>\u53c2\u8003<\/h1>\n<p><a href=\"https:\/\/www.php-fig.org\/\">PHP-FIG<\/a><\/p>\n<p><a href=\"http:\/\/www.ietf.org\/rfc\/rfc2119.txt\">RFC2119<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3082\u3001\u30ab\u30ed\u30fc\u30b8\u3067\u3059\u3002 \u3061\u3087\u3063\u3068\u3001PSR\u306b\u3064\u3044\u3066\u8abf\u3079\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u5143\u304c\u82f1\u6587\u3067\u3001\u4e14\u3064\u5185\u5bb9\u304c\u5805\u82e6\u3057\u304f\u3001\u7406\u89e3\u306b\u82e6\u3057\u3080\u90e8\u5206\u304c\u6709\u3063\u305f\u306e\u3067\u8981\u7d04\u3057\u305f\u3082\u306e\u3092\u30d6\u30ed\u30b0\u306b\u3057\u307e\u3057\u305f\u3002 \u4eca\u56de\u306f\u6982\u8981\u306e\u307f\u3067\u3059\u304c\u3001PSR-0\uff5e20\u307e\u3067\u9806\u6b21\u7ffb\u8a33\u3001&#8230;<\/p>\n","protected":false},"author":5,"featured_media":6074,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,16,8,23],"tags":[50,262,261],"_links":{"self":[{"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/posts\/5780"}],"collection":[{"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=5780"}],"version-history":[{"count":24,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/posts\/5780\/revisions"}],"predecessor-version":[{"id":6076,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/posts\/5780\/revisions\/6076"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/media\/6074"}],"wp:attachment":[{"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=5780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=5780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=5780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}