小编zha*_*nik的帖子

PHPStorm.重新格式化代码.链式方法调用包装

我有一些关于phpstorm代码重新格式化的问题.

我有长线和单线.

$this->getSelect()->join('some_code_here')->join('some_code_here')->join('some_code_here')->join('some_code_here')->join('some_code_here');
$this->getSelect()->join('some_code_here')->join('some_code_here');
Run Code Online (Sandbox Code Playgroud)

我想配置设置:

代码样式/ PHP/Wrapping和Braces/Chained方法调用

此设置有4种变体:

Do not wrap (1)
Wrap if long (2)
Crop down if long (3)
Wrap always (4)
Run Code Online (Sandbox Code Playgroud)

当我选择2或3时,我有以下内容:

    $this->getSelect()->join('some_code_here')->join('some_code_here')->join('some_code_here')->join(
        'some_code_here'
    )->join('some_code_here');
    $this->getSelect()->join('some_code_here')->join('some_code_here');
Run Code Online (Sandbox Code Playgroud)

当我选择第4名时,我有:

    $this->getSelect()
        ->join('some_code_here')
        ->join('some_code_here')
        ->join('some_code_here')
        ->join('some_code_here')
        ->join('some_code_here');
    $this->getSelect()
        ->join('some_code_here')
        ->join('some_code_here');
Run Code Online (Sandbox Code Playgroud)

我的问题是:

是否有可能从新行包装每个调用,只有方法很长(超过120个符号).

预期结果:

    $this->getSelect()
        ->join('some_code_here')
        ->join('some_code_here')
        ->join('some_code_here')
        ->join('some_code_here')
        ->join('some_code_here');
    $this->getSelect()->join('some_code_here')->join('some_code_here');
Run Code Online (Sandbox Code Playgroud)

word-wrap reformatting phpstorm

10
推荐指数
1
解决办法
1061
查看次数

MS Dynamics 365 商务中心。API POST、PATCH、DELETE 不起作用

我们已经在我们的服务器上安装了 MS Dynamics 365 Business Central(我不知道如何查看当前安装的版本)。我们对我们的请求使用oData v4协议。

任务

我们需要从 PHP 对这个系统进行 API 调用

问题

当 GET 请求运行良好时,不可能发出 POST、PATCH、DELETE 请求。

得到

要求:

获取 https://d365bc.vendor.com:7058/attain/ODataV4/Company('{{company}}')/Customer

回复

{
    "@odata.context": "https://d365bc.vendor.com:7058/attain/ODataV4/$metadata#Company('...')/Customer",
    "value": [
        {
            "@odata.etag": "W/\"JzQ0O29EcmJmcGs4V3NRMHlEQ0Fxa0JxL1N0bi9xZjY5UDFQakZ0U2tBUGU1Kzg9MTswMDsn\"",
            "No": "01121212",
            "Name": "Spotsmeyer's Furnishings",
            "Responsibility_Center": "",
            "Location_Code": "YELLOW",
            "Post_Code": "US-FL 37125",
            "Country_Region_Code": "US",
            "Phone_No": "",
            "IC_Partner_Code": "",
            "Contact": "Mr. Mike Nash",
            "Salesperson_Code": "JR",
            "Customer_Posting_Group": "FOREIGN",
            "Gen_Bus_Posting_Group": "EXPORT",
            "VAT_Bus_Posting_Group": "EXPORT",
            "Customer_Price_Group": "",
            "Customer_Disc_Group": "",
            "Payment_Terms_Code": "1M(8D)",
            "Reminder_Terms_Code": "FOREIGN",
            "Fin_Charge_Terms_Code": "2.0 FOR.",
            "Currency_Code": "USD",
            "Language_Code": "ENU",
            "Search_Name": …
Run Code Online (Sandbox Code Playgroud)

api microsoft-dynamics odata dynamics-business-central

7
推荐指数
1
解决办法
1715
查看次数