Skip to content

Commit

Permalink
Formatted method argument spacing
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <tom@inflatablecookie.com>
  • Loading branch information
betterthanclay committed Nov 3, 2023
1 parent 1428cdd commit 7f34851
Show file tree
Hide file tree
Showing 16 changed files with 254 additions and 147 deletions.
5 changes: 3 additions & 2 deletions src/BufferProviderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
5 changes: 3 additions & 2 deletions src/ContentCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 6 additions & 4 deletions src/Embed/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand All @@ -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,
Expand Down
25 changes: 15 additions & 10 deletions src/Embed/Audioboom.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -122,8 +123,9 @@ public function render(): Element
*
* @param array<string, mixed> $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;
Expand Down Expand Up @@ -154,8 +156,9 @@ public function lookupThumbnail(?array $options = null): ?string
* @param array<string, mixed> $options
* @return array<string, mixed>
*/
public function lookupMeta(?array $options = null): ?array
{
public function lookupMeta(
?array $options = null
): ?array {
switch ($this->type) {
case 'embed':
return $this->lookupEmbedMeta($options);
Expand All @@ -174,8 +177,9 @@ public function lookupMeta(?array $options = null): ?array
* @param array<string, mixed> $options
* @return array<string, mixed>
*/
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 {
Expand Down Expand Up @@ -212,8 +216,9 @@ protected function lookupEmbedMeta(?array $options = null): ?array
* @param array<string, mixed> $options
* @return array<string, mixed>
*/
protected function lookupPlaylistMeta(?array $options = null): ?array
{
protected function lookupPlaylistMeta(
?array $options = null
): ?array {
$url = 'https://api.audioboom.com/playlists/' . $this->audioboomId;

try {
Expand Down
75 changes: 58 additions & 17 deletions src/Embed/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<string, mixed> $options
*/
public function lookupThumbnail(?array $options = null): ?string;
public function lookupThumbnail(
?array $options = null
): ?string;

/**
* @param array<string, mixed> $options
* @return array<string, mixed>|null
*/
public function lookupMeta(?array $options = null): ?array;
public function lookupMeta(
?array $options = null
): ?array;

public function render(): ?Element;
public function __toString(): string;
Expand Down
Loading

0 comments on commit 7f34851

Please sign in to comment.