-2

I want to mass generate PHPDoc on my Facade class without ide_helper.php. How to generate it? I've tried ide_helper.php it's work for autocomplete. But in my case I want write the PHPDoc into my Facade class Then in my Facade class will automatically written PHPDoc

From this

<?php

namespace AshAllenDesign\LaravelExchangeRates\Facades;

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

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

To this

<?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';
    }
}
  • You could check for plugins for your specific editor or IDE for this. This will be specific to the editor or IDE you are using. maybe rephrase your question to how one might be able to do this for X editor. – Sakibul Alam Jul 04 '21 at 13:04
  • I've searched this things on the internet but it doesn't helped me at all – Naufal Reky Ardhana Jul 04 '21 at 13:53
  • have you tried these https://marketplace.visualstudio.com/items?itemName=rexshi.phpdoc-comment-vscode-plugin#:~:text=Using,shift%20%2B%20i%20or%20context%20menu. https://www.jetbrains.com/help/phpstorm/phpdoc-comments.html – Sakibul Alam Jul 04 '21 at 14:03
  • Of course I've tried those one, but it's different with my case. I think you should read this https://laravel.com/docs/8.x/facades#how-facades-work – Naufal Reky Ardhana Jul 04 '21 at 16:46

1 Answers1

3

I made my own tool to mass generate PHPDocs for facade laravel, check this out https://gist.github.com/ardzz/473f8b994714370b917d6232ce5146f0