diff --git a/src/HtmlCard.php b/src/HtmlCard.php index cc9b960..7b71713 100644 --- a/src/HtmlCard.php +++ b/src/HtmlCard.php @@ -9,14 +9,12 @@ class HtmlCard extends Card { /** * The width of the card (1/3, 1/2, or full). - * * @var string */ public $width = '1/3'; /** * Create a new element. - * * @param string|null $component */ public function __construct($component = null) @@ -37,26 +35,14 @@ public function component() return 'html-card'; } - /** - * Set HTML code to display in a card - * - * @param string $htmlContent - * - * @return HtmlCard - */ - public function html(string $htmlContent) + /** Set HTML code to display in a card. */ + public function html(string $htmlContent): static { return $this->withMeta(['content' => $htmlContent]); } - /** - * Set Markdown code to display in a card (converted into HTML) - * - * @param string $htmlContent - * - * @return HtmlCard - */ - public function markdown(string $markdownContent) + /** Set Markdown code to display in a card (converted into HTML). */ + public function markdown(string $markdownContent): static { $htmlContent = App::make(MarkdownConverter::class)::parse($markdownContent)->toHtml(); @@ -65,27 +51,18 @@ public function markdown(string $markdownContent) /** * Use blade view file to render Card content. - * * @param string $view - * @param array $viewData - * - * @return HtmlCard + * @param array $viewData */ - public function view(string $view, array $viewData = []) + public function view(string $view, array $viewData = []): static { $htmlContent = view($view, $viewData)->render(); return $this->html($htmlContent); } - /** - * Center card's content - * - * @param bool $centerContent - * - * @return HtmlCard - */ - public function center(bool $centerContent = true) + /** Center card's content. */ + public function center(bool $centerContent = true): static { return $this->withMeta(['center' => $centerContent]); } @@ -96,24 +73,14 @@ public function center(bool $centerContent = true) * full-width cards at the bottom. If you want to display full-width cards * not at the end, you should use with=1/3 or 2/3 and this method. * @see https://github.com/laravel/nova-issues/issues/1895#issuecomment-543684472 - * - * @param bool $forceFullWidth - * - * @return HtmlCard */ - public function forceFullWidth(bool $forceFullWidth = true) + public function forceFullWidth(bool $forceFullWidth = true): static { return $this->withMeta(['forceFullWidth' => $forceFullWidth]); } - /** - * Whether to use standard Nova Card styles for a card (background, padding, etc) - * - * @param bool $withoutStyles - * - * @return HtmlCard - */ - public function withoutCardStyles(bool $withoutStyles = true) + /** Whether to use standard Nova Card styles for a card (background, padding, etc). */ + public function withoutCardStyles(bool $withoutStyles = true): static { return $this->withMeta(['withoutCardStyles' => $withoutStyles]); }