{"id":153350,"date":"2020-09-09T05:19:46","date_gmt":"2020-09-08T21:19:46","guid":{"rendered":"http:\/\/4563.org\/?p=153350"},"modified":"2020-09-10T00:15:29","modified_gmt":"2020-09-09T16:15:29","slug":"%e5%bb%ba%e8%ae%ae-phper-%e5%b0%9d%e8%af%95%e4%b8%8b%e9%9d%99%e6%80%81%e5%88%86%e6%9e%90%e5%b7%a5%e5%85%b7-phpstan","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=153350","title":{"rendered":"\u5efa\u8bae phper \u5c1d\u8bd5\u4e0b\u9759\u6001\u5206\u6790\u5de5\u5177 phpstan"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5efa\u8bae phper \u5c1d\u8bd5\u4e0b\u9759\u6001\u5206\u6790\u5de5\u5177 phpstan               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : liuyibao <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        php \u7684\u4e3b\u8981\u7f3a\u70b9\u662f\u4ee3\u7801\u5bb9\u6613\u5199\u70c2\uff0c\u8fd9\u6bb5\u65f6\u95f4\u5c1d\u8bd5\u4f7f\u7528\u4e86 phpstan\uff0c\u7684\u786e\u5f88\u597d\uff0c\u9002\u5408\u5728\u73b0\u6709\u9879\u76ee\u4e0a\u7528\u3002<br \/>\u76ee\u524d\u6d41\u884c\u7684\u8fd8\u6709 psalm \u4ee5\u53ca\u6027\u80fd\u6bd4\u8f83\u9ad8\u7684 phan\uff0c\u4f46\u662f\u7efc\u5408\u6765\u770b phpstan \u66f4\u9002\u5408\u73b0\u6709\u9879\u76ee\uff0c\u56e0\u4e3a\u9519\u8bef\u7ea7\u522b\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff0c\u53ea\u5efa\u8bae\u5728\u65b0\u7684 service \u6587\u4ef6\u4e0a\u68c0\u6d4b\uff0c\u56e0\u4e3a\u5e95\u5c42 model \u4ee5\u53ca\u63a7\u5236\u5668\u4f9d\u8d56\u4e8e\u6846\u67b6\uff0c\u4f1a\u62a5\u5f88\u591a\u8b66\u544a\u3002<\/p>\n<p>\u9879\u76ee\u6839\u76ee\u5f55\u521b\u5efa\u6587\u4ef6 phpstan.neon\uff0c\u5efa\u8bae\u914d\u7f6e\u5982\u4e0b\uff1a<br \/>parameters:<br \/> level: 8<br \/> checkMissingIterableValueType: false<br \/> bootstrapFiles:<br \/> &#8211; phpstan\/bootstrap.php<\/p>\n<p>\uff08\u8fd9\u4e2a\u542f\u52a8\u811a\u672c\u770b\u81ea\u5df1\u9879\u76ee\uff0c\u5982\u679c\u90fd\u662f\u6807\u51c6 composer \u52a0\u8f7d\u53ef\u80fd\u4e0d\u9700\u8981\u5199\uff0c\u5982\u679c\u662f\u4f7f\u7528\u7c7b\u4f3c yii \u8fd9\u79cd\u662f\u9700\u8981\u52a0\u8f7d\u7684\uff0c\u8fd9\u4e2a\u7c7b\u4f3c\u5165\u53e3\u6587\u4ef6\uff0c\u81ea\u5df1\u53ef\u4ee5\u6539\u4e00\u6539\uff09<\/p>\n<p>PHPStorm \u9a6c\u4e0a\u4e5f\u8981\u5185\u7f6e\u652f\u6301\u4e86\uff1a<\/p>\n<p>https:\/\/blog.jetbrains.com\/phpstorm\/2020\/07\/phpstan-and-psalm-support-coming-to-phpstorm\/<\/p>\n<p>\u522b\u95ee\u6211 2020 \u4e86\u4e3a\u5565\u8fd8\u5728\u7528 PHP ^__^      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>13<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3221102\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : monospace <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3a\u5565 0202 \u5e74\u4e86\u8fd8\u5728\u7528 PHP \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221103\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : newtype0092 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @liuyibao @monospace \u56e0\u4e3a 2020 \u5e74\u4ee5\u524d\u5199\u7684 PHP \u9879\u76ee\u53ef\u80fd\u5f97\u7ef4\u62a4\u5230 2030 \u5e74                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221104\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ramdava <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @monospace <br \/>@newtype0092 <br \/>@liuyibao <\/p>\n<p>\u56e0\u4e3a PHP \u662f\u4e16\u754c\u4e0a\u6700\u597d\u7684\u8bed\u8a00\uff0c\u4e0d\u63a5\u53d7\u53cd\u9a73                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221105\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : liuxu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @newtype0092<br \/>@monospace <br \/>@liuyibao <br \/>@ramdava <\/p>\n<p> \u7136\u540e 2030 \u5e74\u7684\u5c0f\u8001\u5f1f\u63a5\u624b\u9879\u76ee\u540e\uff0c\u6dfb\u52a0\u7684\u65b0\u9700\u6c42 PHP \u4ee3\u7801\u53ef\u80fd\u88ab 2040 \u5e74\u7684\u5c11\u5e74\u7ef4\u62a4                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221106\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pigzzz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @liuxu \u603b\u7ed3\uff0cphp \u5343\u79cb\u4e07\u4ee3\uff0c\u6e90\u6e90\u4e0d\u606f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221107\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Huelse <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @pigzzz #5 \u65b0\u7684\u8bed\u8a00\u548c\u65b0\u7684\u67b6\u6784\u603b\u4f1a\u4e0d\u65ad\u51fa\u73b0\uff0cphp \u54ea\u6015\u53ea\u6709 1%\u7684\u5360\u6709\u7387\u4e5f\u80fd\u4e98\u53e4\u4e0d\u53d8\uff0c\u6e90\u8fdc\u6d41\u957f <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/09\/504J5BO2-52.png\" alt=\"\u5efa\u8bae phper \u5c1d\u8bd5\u4e0b\u9759\u6001\u5206\u6790\u5de5\u5177 phpstan\"> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221108\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : richzhu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u54c8\u54c8\u54c8\u54c8\uff0c\u6211\u6b63\u5728\u770b\u8fd9\u4e2a\u5e16\u5b50\uff0c\u65c1\u8fb9\u4e00\u4e2a 00 \u540e\u540c\u4e8b\u6765\u8d31\u8d31\u7684\u8bf4\u4e86\u4e00\u53e5\uff0cphp \u662f\u4ec0\u4e48? \u8ddf\u4e07\u80fd\u5145\u662f\u4e00\u4e2a\u4e1c\u897f\u561b\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221109\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wangluwl <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @richzhu \u4f9d\u7136\u53ef\u4ee5\u62cd\u9ec4\u7247                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221110\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wule61 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8001\u94c1,\u8be5\u7528 golang \u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221111\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fhsan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u4e86\u4e0b\u57f9\u8bad\u73ed\uff0c\u73b0\u5728\u6ca1\u57f9\u8bad php \u7684\u4e86\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221112\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dvaknheo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ignoreErrors:<br \/> &#8211; &#8216;#Unsafe usage of new static#&#8217;<br \/> &#8211; &#8216;#no return typehint specified#&#8217;<br \/> &#8211; &#8216;#with no typehint specified#&#8217;<br \/> &#8211; &#8216;#has no typehint specified#&#8217;<\/p>\n<p>\u558f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221113\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : NjcyNzMzNDQ3 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\u5206\u4eab                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3221114\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : avenger <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u4e5f\u53ef\u4ee5\u8bd5\u4e00\u4e0b\uff0c\u914d\u5408\u4f7f\u7528\uff0c\u7597\u6548\u66f4\u597d\uff1a<br \/>https:\/\/psalm.dev                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5efa\u8bae phper \u5c1d\u8bd5\u4e0b\u9759\u6001\u5206\u6790\u5de5&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/153350"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153350"}],"version-history":[{"count":1,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/153350\/revisions"}],"predecessor-version":[{"id":153352,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/153350\/revisions\/153352"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153350"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}