feeds icon indicating copy to clipboard operation
feeds copied to clipboard

Resolving IDE warnings through a custom facade

Open dingman opened this issue 11 months ago • 1 comments

Hey Will,

Love your package, thank you!

I commonly run into IDE warnings for methods like ->make() within PHPStorm.

I was able to resolve these warnings by creating a custom Facade. Is there another approach that I'm not thinking about?

<?php

namespace App\Facades;

use willvincent\Feeds\Facades\FeedsFacade as OriginalFeedsFacade;

/**
 * @method static \SimplePie\SimplePie make( string $url )
 * @method static bool init()
 * @method static string|null get_title()
 * @method static string|null get_description()
 * @method static string|null get_link()
 * @method static string|null get_language()
 * @method static string|null get_encoding()
 * @method static array get_items( int $start = 0, int $max = 0 )
 * @method static \SimplePie\Item[]|\SimplePie\Registry get_item( int $key = 0 )
 * @method static int get_item_quantity( int $max = 0 )
 * @method static string get_feed_url()
 * @method static bool set_feed_url( string $url )
 * @method static bool is_feed( string $data )
 * @method static string|null get_type()
 * @method static string|null get_base()
 * @method static int get_updated_date()
 *
 * @see \SimplePie\SimplePie
 * @see \willvincent\Feeds\FeedsFactory
 */
class CustomFeeds extends OriginalFeedsFacade {
    // No additional code needed; PHPDoc annotations handle the rest.
}

dingman avatar Feb 04 '25 02:02 dingman

Hi @dingman

Go ahead and submit a PR for the existing Facade. 👍

willvincent avatar Feb 19 '25 07:02 willvincent