From 7f34851da83813b7c8d057d2c85534097655be39 Mon Sep 17 00:00:00 2001 From: Tom Wright Date: Fri, 3 Nov 2023 15:23:47 +0000 Subject: [PATCH] Formatted method argument spacing Signed-off-by: Tom Wright --- src/BufferProviderTrait.php | 5 ++- src/ContentCollection.php | 5 ++- src/Embed/Audio.php | 10 +++-- src/Embed/Audioboom.php | 25 +++++++----- src/Embed/Media.php | 75 ++++++++++++++++++++++++++-------- src/Embed/MediaTrait.php | 80 ++++++++++++++++++++++--------------- src/Embed/Video.php | 15 ++++--- src/Embed/Vimeo.php | 15 ++++--- src/Embed/Youtube.php | 15 ++++--- src/Factory.php | 20 ++++++---- src/Mail/Generator.php | 20 ++++++---- src/Plugins/Embed.php | 5 ++- src/Plugins/Icon.php | 35 +++++++++------- src/Plugins/Number.php | 10 +++-- src/Plugins/Time.php | 5 ++- src/Tag.php | 61 +++++++++++++++++----------- 16 files changed, 254 insertions(+), 147 deletions(-) diff --git a/src/BufferProviderTrait.php b/src/BufferProviderTrait.php index f43366c..05c48b4 100644 --- a/src/BufferProviderTrait.php +++ b/src/BufferProviderTrait.php @@ -16,8 +16,9 @@ trait BufferProviderTrait /** * Create new buffer */ - protected function newBuffer(?string $content): BufferInterface - { + protected function newBuffer( + ?string $content + ): BufferInterface { return new Buffer($content); } } diff --git a/src/ContentCollection.php b/src/ContentCollection.php index dc79cd4..fbb6bd2 100644 --- a/src/ContentCollection.php +++ b/src/ContentCollection.php @@ -58,8 +58,9 @@ public function __toString(): string /** * Render contents */ - public function render(bool $pretty = false): Buffer - { + public function render( + bool $pretty = false + ): Buffer { $output = ''; foreach ($this->items as $value) { diff --git a/src/Embed/Audio.php b/src/Embed/Audio.php index 96fd4ef..762c4f1 100644 --- a/src/Embed/Audio.php +++ b/src/Embed/Audio.php @@ -27,8 +27,9 @@ class Audio implements Media /** * Convert an anonymous id to a URL */ - public static function defaultUrlFromId(string $id): string - { + public static function defaultUrlFromId( + string $id + ): string { return '//embeds.audioboom.com/boos/' . $id . '/embed/v4'; } @@ -49,8 +50,9 @@ public function render(): Element /** * Prepare iframe element */ - protected function prepareIframeElement(?string $url): Element - { + protected function prepareIframeElement( + ?string $url + ): Element { $tag = Element::create('iframe.embed.audio', null, [ 'id' => $this->id, 'src' => $url, diff --git a/src/Embed/Audioboom.php b/src/Embed/Audioboom.php index d17eca9..868c007 100644 --- a/src/Embed/Audioboom.php +++ b/src/Embed/Audioboom.php @@ -32,8 +32,9 @@ class Audioboom extends Audio /** * Extract parts from URL */ - protected function setUrl(?string $url): static - { + protected function setUrl( + ?string $url + ): static { parent::setUrl($url); if (!$this->url) { @@ -122,8 +123,9 @@ public function render(): Element * * @param array $options */ - public function lookupThumbnail(?array $options = null): ?string - { + public function lookupThumbnail( + ?array $options = null + ): ?string { switch ($this->type) { case 'embed': $url = 'https://audioboom.com/publishing/oembed.json?url=https://audioboom.com/posts/' . $this->audioboomId; @@ -154,8 +156,9 @@ public function lookupThumbnail(?array $options = null): ?string * @param array $options * @return array */ - public function lookupMeta(?array $options = null): ?array - { + public function lookupMeta( + ?array $options = null + ): ?array { switch ($this->type) { case 'embed': return $this->lookupEmbedMeta($options); @@ -174,8 +177,9 @@ public function lookupMeta(?array $options = null): ?array * @param array $options * @return array */ - protected function lookupEmbedMeta(?array $options = null): ?array - { + protected function lookupEmbedMeta( + ?array $options = null + ): ?array { $url = 'https://audioboom.com/publishing/oembed.json?url=https://audioboom.com/posts/' . $this->audioboomId; try { @@ -212,8 +216,9 @@ protected function lookupEmbedMeta(?array $options = null): ?array * @param array $options * @return array */ - protected function lookupPlaylistMeta(?array $options = null): ?array - { + protected function lookupPlaylistMeta( + ?array $options = null + ): ?array { $url = 'https://api.audioboom.com/playlists/' . $this->audioboomId; try { diff --git a/src/Embed/Media.php b/src/Embed/Media.php index 74286f1..7fa61ce 100644 --- a/src/Embed/Media.php +++ b/src/Embed/Media.php @@ -17,11 +17,22 @@ interface Media extends Markup /** * @return static */ - public static function parse(string $embed): static; + public static function parse( + string $embed + ): static; + + public static function extractProviderName( + string $url + ): ?string; + + public static function getClassForUrl( + string $url + ): string; + + public static function defaultUrlFromId( + string $id + ): string; - public static function extractProviderName(string $url): ?string; - public static function getClassForUrl(string $url): string; - public static function defaultUrlFromId(string $id): string; public function getUrl(): ?string; public function getPreparedUrl(): ?string; @@ -30,80 +41,110 @@ public function getProvider(): ?string; /** * @return static */ - public function setId(?string $id): static; + public function setId( + ?string $id + ): static; public function getId(): ?string; /** * @return static */ - public function setOrigin(?string $origin): static; + public function setOrigin( + ?string $origin + ): static; + public function getOrigin(): ?string; /** * @return static */ - public function setWidth(?int $width): static; + public function setWidth( + ?int $width + ): static; /** * @return static */ - public function scaleWidth(int $width): static; + public function scaleWidth( + int $width + ): static; public function getWidth(): ?int; /** * @return static */ - public function setHeight(?int $height): static; + public function setHeight( + ?int $height + ): static; public function getHeight(): ?int; - public function setDimensions(?int $width, ?int $height = null): static; + + public function setDimensions( + ?int $width, + ?int $height = null + ): static; /** * @return static */ - public function setAllowFullScreen(bool $flag): static; + public function setAllowFullScreen( + bool $flag + ): static; + public function shouldAllowFullScreen(): bool; /** * @return static */ - public function setAutoPlay(bool $flag): static; + public function setAutoPlay( + bool $flag + ): static; public function shouldAutoPlay(): bool; /** * @return static */ - public function setStartTime(?int $seconds): static; + public function setStartTime( + ?int $seconds + ): static; public function getStartTime(): ?int; /** * @return static */ - public function setEndTime(?int $seconds): static; + public function setEndTime( + ?int $seconds + ): static; public function getEndTime(): ?int; /** * @return static */ - public function setDuration(?int $seconds): static; + public function setDuration( + ?int $seconds + ): static; public function getDuration(): ?int; /** * @param array $options */ - public function lookupThumbnail(?array $options = null): ?string; + public function lookupThumbnail( + ?array $options = null + ): ?string; /** * @param array $options * @return array|null */ - public function lookupMeta(?array $options = null): ?array; + public function lookupMeta( + ?array $options = null + ): ?array; public function render(): ?Element; public function __toString(): string; diff --git a/src/Embed/MediaTrait.php b/src/Embed/MediaTrait.php index 1efff8e..10a2083 100644 --- a/src/Embed/MediaTrait.php +++ b/src/Embed/MediaTrait.php @@ -37,8 +37,9 @@ trait MediaTrait /** * Parse embed string */ - public static function parse(string $embed): static - { + public static function parse( + string $embed + ): static { $embed = trim($embed); $stripEmbed = strip_tags($embed, '