久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='6B9ax'><style id='6B9ax'><dir id='6B9ax'><q id='6B9ax'></q></dir></style></legend>
    <i id='6B9ax'><tr id='6B9ax'><dt id='6B9ax'><q id='6B9ax'><span id='6B9ax'><b id='6B9ax'><form id='6B9ax'><ins id='6B9ax'></ins><ul id='6B9ax'></ul><sub id='6B9ax'></sub></form><legend id='6B9ax'></legend><bdo id='6B9ax'><pre id='6B9ax'><center id='6B9ax'></center></pre></bdo></b><th id='6B9ax'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6B9ax'><tfoot id='6B9ax'></tfoot><dl id='6B9ax'><fieldset id='6B9ax'></fieldset></dl></div>

    • <bdo id='6B9ax'></bdo><ul id='6B9ax'></ul>
    <tfoot id='6B9ax'></tfoot>
  1. <small id='6B9ax'></small><noframes id='6B9ax'>

      如何讓我的 PHP IDE 理解依賴注入容器?

      How do I make my PHP IDE understand Dependency Injection Containers?(如何讓我的 PHP IDE 理解依賴注入容器?)
            <legend id='sYb1N'><style id='sYb1N'><dir id='sYb1N'><q id='sYb1N'></q></dir></style></legend>

            <small id='sYb1N'></small><noframes id='sYb1N'>

              <tbody id='sYb1N'></tbody>
            <tfoot id='sYb1N'></tfoot>
            1. <i id='sYb1N'><tr id='sYb1N'><dt id='sYb1N'><q id='sYb1N'><span id='sYb1N'><b id='sYb1N'><form id='sYb1N'><ins id='sYb1N'></ins><ul id='sYb1N'></ul><sub id='sYb1N'></sub></form><legend id='sYb1N'></legend><bdo id='sYb1N'><pre id='sYb1N'><center id='sYb1N'></center></pre></bdo></b><th id='sYb1N'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='sYb1N'><tfoot id='sYb1N'></tfoot><dl id='sYb1N'><fieldset id='sYb1N'></fieldset></dl></div>
              • <bdo id='sYb1N'></bdo><ul id='sYb1N'></ul>

              • 本文介紹了如何讓我的 PHP IDE 理解依賴注入容器?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                當(dāng)前情況:我的項(xiàng)目中有依賴項(xiàng),我使用依賴項(xiàng)注入解決了這些依賴項(xiàng).我想采取下一個(gè)邏輯步驟,使用依賴項(xiàng)注入容器 (DIC) 來簡化依賴項(xiàng)的管理和延遲加載類.

                Current situation: I have dependencies in my project that I solve by using dependency injection. I want to take the next logic step by using a dependency injection container (DIC) to ease the management of my dependencies and to lazy-load classes.

                我查看了 Bucket、Pimple 和 sfServiceContainer,運(yùn)行了一些測試并真正欣賞 DIC 的工作方式.我可能會選擇 Pimple,因?yàn)樗暮唵涡院驮剂α?如果我沒有這個(gè)問題:

                I looked at Bucket, Pimple, and sfServiceContainer, ran some test and really appreciate how DIC’s work. I’d probably go for Pimple because of its simplicity and raw power. If I didn’t have this problem:

                由于 DIC 提供的抽象,我使用的 IDE (PHPStorm) 不再理解我的代碼中發(fā)生了什么.它不明白 $container['mailer'] 或 $sc->mailer 持有一個(gè)類對象.我也試過 Netbeans IDE:同樣的問題.

                Due to the abstraction that DIC’s offer, the IDE I’m using (PHPStorm) no longer understands what’s going on in my code. It doesn’t understand that $container['mailer'] or $sc->mailer is holding a class object. I also tried Netbeans IDE: same problem.

                這對我來說真的是個(gè)問題,因?yàn)槲业?IDE 變得毫無用處.在處理類時(shí),我不想在沒有代碼提示、自動完成和重構(gòu)工具的情況下進(jìn)行編程.而且我不希望我的 IDE 在驗(yàn)證代碼時(shí)發(fā)現(xiàn)各種誤報(bào).

                This is really a problem for me because my IDE becomes useless. I don’t want to program without code hints, autocompletion and refactoring tools when dealing with classes. And I don’t want my IDE to find all kinds of false positives when validating code.

                所以我的問題是:有沒有人處理過這個(gè)問題并找到了解決方案?

                So my question is: Has anyone dealt with this problem and found a solution?

                推薦答案

                您可以手動"定義變量的類:

                You can define class of the variable 'manually':

                /** @var YourClassType $mailer */
                $mailer = $container['mailer'];
                

                在 PhpStorm(以及標(biāo)準(zhǔn))中,使用兩個(gè)星號并在變量名稱之前寫入數(shù)據(jù)類型.

                In PhpStorm (and by standards), use two asterisks and write the data type before the name of the variable.

                可以寫出沒有變量名的數(shù)據(jù)類型(但不能寫出沒有數(shù)據(jù)類型的名字).

                You can write the data type without the name of the variable (but not the name without the data type).

                這篇關(guān)于如何讓我的 PHP IDE 理解依賴注入容器?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標(biāo)不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)
              • <i id='6xh01'><tr id='6xh01'><dt id='6xh01'><q id='6xh01'><span id='6xh01'><b id='6xh01'><form id='6xh01'><ins id='6xh01'></ins><ul id='6xh01'></ul><sub id='6xh01'></sub></form><legend id='6xh01'></legend><bdo id='6xh01'><pre id='6xh01'><center id='6xh01'></center></pre></bdo></b><th id='6xh01'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6xh01'><tfoot id='6xh01'></tfoot><dl id='6xh01'><fieldset id='6xh01'></fieldset></dl></div>

                  <bdo id='6xh01'></bdo><ul id='6xh01'></ul>
                • <tfoot id='6xh01'></tfoot>

                  <small id='6xh01'></small><noframes id='6xh01'>

                    <legend id='6xh01'><style id='6xh01'><dir id='6xh01'><q id='6xh01'></q></dir></style></legend>
                      <tbody id='6xh01'></tbody>

                          主站蜘蛛池模板: 久久国产精品一区二区三区 | 99精品99| 色婷婷综合久久久中字幕精品久久 | 毛片网在线观看 | 一级黄色片一级黄色片 | 日韩欧美中文字幕在线观看 | 久久综合一区 | 国产成人一区在线 | www.国产精| 日韩一区二区在线看 | 五月综合激情婷婷 | 干干干日日日 | 日本一区二区不卡视频 | 亚洲一区二区精品 | 日韩高清一区 | 一级黄色录像片子 | 91久久精品国产 | 欧美精品第一区 | 午夜电影合集 | 亚洲精品一区二三区不卡 | 日韩一级黄色片 | 午夜av在线 | 色婷婷综合久久久中字幕精品久久 | 国产激情视频在线 | 日韩一区二区三区四区五区六区 | 午夜成人免费电影 | 日韩综合在线视频 | 91久久精品| 97av视频| 大吊一区二区 | 日韩成人影院在线观看 | 日韩综合网 | 国产精品1区2区3区 中文字幕一区二区三区四区 | 国产视频黄色 | 亚洲精品久久久一区二区三区 | 欧美日韩亚洲视频 | 国产精品久久久久久久免费大片 | 日韩一区二区三区精品 | 欧美激情视频一区二区三区在线播放 | 国产日韩一区二区三免费高清 | 精品国产一区二区在线 |