• <i id='M5ngJ'><tr id='M5ngJ'><dt id='M5ngJ'><q id='M5ngJ'><span id='M5ngJ'><b id='M5ngJ'><form id='M5ngJ'><ins id='M5ngJ'></ins><ul id='M5ngJ'></ul><sub id='M5ngJ'></sub></form><legend id='M5ngJ'></legend><bdo id='M5ngJ'><pre id='M5ngJ'><center id='M5ngJ'></center></pre></bdo></b><th id='M5ngJ'></th></span></q></dt></tr></i><div id='M5ngJ'><tfoot id='M5ngJ'></tfoot><dl id='M5ngJ'><fieldset id='M5ngJ'></fieldset></dl></div>

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

    <legend id='M5ngJ'><style id='M5ngJ'><dir id='M5ngJ'><q id='M5ngJ'></q></dir></style></legend><tfoot id='M5ngJ'></tfoot>

        • <bdo id='M5ngJ'></bdo><ul id='M5ngJ'></ul>
      1. 尝试使用作曲家时意外的“使用"(T_USE)

        unexpected #39;use#39; (T_USE) when trying to use composer(尝试使用作曲家时意外的“使用(T_USE))

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

          <tbody id='oYTag'></tbody>

              • <bdo id='oYTag'></bdo><ul id='oYTag'></ul>
              • <legend id='oYTag'><style id='oYTag'><dir id='oYTag'><q id='oYTag'></q></dir></style></legend>
              • <tfoot id='oYTag'></tfoot>
                <i id='oYTag'><tr id='oYTag'><dt id='oYTag'><q id='oYTag'><span id='oYTag'><b id='oYTag'><form id='oYTag'><ins id='oYTag'></ins><ul id='oYTag'></ul><sub id='oYTag'></sub></form><legend id='oYTag'></legend><bdo id='oYTag'><pre id='oYTag'><center id='oYTag'></center></pre></bdo></b><th id='oYTag'></th></span></q></dt></tr></i><div id='oYTag'><tfoot id='oYTag'></tfoot><dl id='oYTag'><fieldset id='oYTag'></fieldset></dl></div>
                  本文介绍了尝试使用作曲家时意外的“使用"(T_USE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  所以,我正在尝试使用 coinbase API.我正在尝试一个简单的测试,看看我是否可以让它工作,但我遇到了各种作曲家错误.

                  So, I am trying to use the coinbase API. I'm attempting a simple test to see if I can make it work, but I'm getting various composer errors.

                  目前,我对这段代码的使用"感到意外:

                  Currently, I am getting unexpected t 'use' for this code:

                              use CoinbaseWalletClient;
                              use CoinbaseWalletConfiguration;
                  
                              $apiKey = 'public';
                              $apiSecret = 'private';
                              $configuration = Configuration::apiKey($apiKey, $apiSecret);
                              $client = Client::create($configuration);
                              $spotPrice = $client->getSpotPrice();
                              echo $spotPrice;
                  

                  那么,我的使用语句是不是放错地方了?我已经在索引函数之外和课堂之外尝试过它们.两者都产生与此完全不同的结果集.

                  So, are my use statements in the wrong place? Ive tried them outside the index function and outside the class. Both yield completely different sets of results than this.

                  在 Keks 类之外,我得到了

                  Outside of the Keks class, I get

                  致命错误:CoinbaseWalletConfiguration"类未在/home/content/61/11420661/html/beta/application/controllers/keks.php在第 15 行

                  Fatal error: Class 'CoinbaseWalletConfiguration' not found in /home/content/61/11420661/html/beta/application/controllers/keks.php on line 15

                  在类内但在 index() 函数之外

                  And inside the class but outside the index() function I get

                  致命错误:在第 4 行的 >/home/content/61/11420661/html/beta/application/controllers/keks.php 中找不到特征CoinbaseWalletClient"

                  Fatal error: Trait 'CoinbaseWalletClient' not found in >/home/content/61/11420661/html/beta/application/controllers/keks.php on line 4

                  我的 composer.json 可能有问题吗?

                  Is there something wrong in my composer.json maybe?

                  完整的控制器在这里:http://pastebin.com/4BjPP6YR

                  推荐答案

                  不能在使用的地方使用use".

                  You cannot use "use" where you are using it.

                  use"关键字要么在类定义前面,用于将其他类/接口/特征导入到它自己的命名空间中,要么在类内部(但不在方法内部)以向类添加特征.

                  The "use" keyword is either in front of a class definition to import other classes/interfaces/traits into it's own namespace, or it is inside the class (but not inside a method) to add traits to the class.

                  <?php
                  namespace Foo;
                  
                  use DifferentClass; // use can go here
                  
                  class Bar {
                    use TraitCode; // use can go here
                  
                    public function baz() {
                      $this->traitFunction('etc');
                      // use CANNOT go here
                    }
                  }
                  

                  这篇关于尝试使用作曲家时意外的“使用"(T_USE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How do I parse XML containing custom namespaces using SimpleXML?(如何使用 SimpleXML 解析包含自定义命名空间的 XML?)
                  SimpleXML SOAP response Namespace issues(SimpleXML SOAP 响应命名空间问题)
                  Problems with PHP namespaces and built-in classes, how to fix?(PHP 命名空间和内置类的问题,如何解决?)
                  Use php namespace inside function(在函数内部使用 php 命名空间)
                  PHP adding custom namespace using autoloader from composer(PHP使用来自作曲家的自动加载器添加自定义命名空间)
                  How to use composer packages in codeigniter?(如何在 codeigniter 中使用作曲家包?)

                    <tbody id='UY0Mi'></tbody>

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

                    1. <legend id='UY0Mi'><style id='UY0Mi'><dir id='UY0Mi'><q id='UY0Mi'></q></dir></style></legend>
                        <bdo id='UY0Mi'></bdo><ul id='UY0Mi'></ul>

                            <i id='UY0Mi'><tr id='UY0Mi'><dt id='UY0Mi'><q id='UY0Mi'><span id='UY0Mi'><b id='UY0Mi'><form id='UY0Mi'><ins id='UY0Mi'></ins><ul id='UY0Mi'></ul><sub id='UY0Mi'></sub></form><legend id='UY0Mi'></legend><bdo id='UY0Mi'><pre id='UY0Mi'><center id='UY0Mi'></center></pre></bdo></b><th id='UY0Mi'></th></span></q></dt></tr></i><div id='UY0Mi'><tfoot id='UY0Mi'></tfoot><dl id='UY0Mi'><fieldset id='UY0Mi'></fieldset></dl></div>
                          1. <tfoot id='UY0Mi'></tfoot>