【问题标题】:How to mass generate PHPDoc Facade Laravel on PhpStorm [closed]如何在 PhpStorm 上批量生成 PHPDoc Facade Laravel [关闭]
【发布时间】:2021-07-04 09:50:44
【问题描述】:

我想在没有ide_helper.php 的情况下在我的 Facade 类上批量生成 PHPDoc。如何生成它? 我试过ide_helper.php 它适用于自动完成。但就我而言,我想将 PHPDoc 写入我的 Facade 类 然后在我的 Facade 类中会自动写 PHPDoc

从这里

<?php

namespace AshAllenDesign\LaravelExchangeRates\Facades;

use Carbon\Carbon;
use Illuminate\Support\Facades\Facade;

class ExchangeRate extends Facade
{
    protected static function getFacadeAccessor()
    {
        return 'exchange-rate';
    }
}

到这里

<?php

namespace AshAllenDesign\LaravelExchangeRates\Facades;

use Carbon\Carbon;
use Illuminate\Support\Facades\Facade;

/**
 * @method static array currencies(array $currencies = [])
 * @method static string|array exchangeRate(string $from, $to, ?Carbon $date = null)
 * @method static array exchangeRateBetweenDateRange(string $from, $to, Carbon $date, Carbon $endDate, array $conversions = [])
 * @method static float|array convert(int $value, string $from, $to, Carbon $date = null)
 * @method static array convertBetweenDateRange(int $value, string $from, $to, Carbon $date, Carbon $endDate, array $conversions = [])
 * @method static self shouldBustCache(bool $bustCache = true)
 * @method static self shouldCache(bool $shouldCache = true)
 *
 * @see \AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate
 */
class ExchangeRate extends Facade
{
    protected static function getFacadeAccessor()
    {
        return 'exchange-rate';
    }
}

【问题讨论】:

标签: php laravel phpstorm laravel-facade


【解决方案1】:

我制作了自己的工具来为 Facade laravel 批量生成 PHPDocs,看看这个 https://gist.github.com/ardzz/473f8b994714370b917d6232ce5146f0

【讨论】:

    猜你喜欢
    • 2016-07-13
    • 2010-11-14
    • 1970-01-01
    • 1970-01-01
    • 2018-04-29
    • 1970-01-01
    • 1970-01-01
    • 2012-01-31
    • 2020-10-24
    相关资源
    最近更新 更多