Skip to content

Commit

Permalink
Comply with coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed May 4, 2024
1 parent 74ef259 commit 3eaa381
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/AbstractBinaryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class AbstractBinaryType extends AbstractType
/**
* Prepare content (can be extended by child classes)
*
* @param string $content
* @param string $content
* @return string
*/
public function prepareContent(string $content): string
Expand All @@ -20,7 +20,7 @@ public function prepareContent(string $content): string
/**
* Determine of current type is binary
*
* @return boolean
* @return bool
*/
public function isBinary(): bool
{
Expand Down
14 changes: 7 additions & 7 deletions src/AbstractType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract class AbstractType
/**
* Determine if the given content matches the signature
*
* @param string $content
* @param string $content
* @return bool
*/
public function matches(string $content): bool
Expand All @@ -34,7 +34,7 @@ public function matches(string $content): bool
/**
* Determine if the detected type is an image
*
* @return boolean
* @return bool
*/
public function isImage(): bool
{
Expand All @@ -44,7 +44,7 @@ public function isImage(): bool
/**
* Determine if the detected type is an video
*
* @return boolean
* @return bool
*/
public function isVideo(): bool
{
Expand All @@ -54,7 +54,7 @@ public function isVideo(): bool
/**
* Determine if the detected type is an audio file
*
* @return boolean
* @return bool
*/
public function isAudio(): bool
{
Expand All @@ -64,7 +64,7 @@ public function isAudio(): bool
/**
* Determine if the detected type is an archive
*
* @return boolean
* @return bool
*/
public function isArchive(): bool
{
Expand All @@ -79,7 +79,7 @@ public function isArchive(): bool
/**
* Prepare content (can be extended by child classes)
*
* @param string $content
* @param string $content
* @return string
*/
public function prepareContent(string $content): string
Expand All @@ -90,7 +90,7 @@ public function prepareContent(string $content): string
/**
* Determine of current type is binary
*
* @return boolean
* @return bool
*/
public function isBinary(): bool
{
Expand Down
12 changes: 6 additions & 6 deletions src/MimeSniffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct($content = '')
*
* @return MimeSniffer
*/
public static function createFromString(string $content): MimeSniffer
public static function createFromString(string $content): self
{
return new self($content);
}
Expand All @@ -42,7 +42,7 @@ public static function createFromString(string $content): MimeSniffer
*
* @return MimeSniffer
*/
public function setFromString(string $content): MimeSniffer
public function setFromString(string $content): self
{
$this->content = strval($content);

Expand All @@ -56,7 +56,7 @@ public function setFromString(string $content): MimeSniffer
*
* @return MimeSniffer
*/
public static function createFromFilename(string $filename): MimeSniffer
public static function createFromFilename(string $filename): self
{
return (new self())->setFromFilename($filename);
}
Expand All @@ -68,7 +68,7 @@ public static function createFromFilename(string $filename): MimeSniffer
*
* @return MimeSniffer
*/
public function setFromFilename(string $filename): MimeSniffer
public function setFromFilename(string $filename): self
{
$fp = fopen($filename, 'r');
$this->setFromString(fread($fp, 1024));
Expand Down Expand Up @@ -102,8 +102,8 @@ public function getType(): AbstractType
/**
* Determine if content matches the given type or any if the given types in array
*
* @param AbstractType|string|array<AbstractType|string> $types
* @return boolean
* @param AbstractType|string|array<AbstractType|string> $types
* @return bool
*/
public function matches(AbstractType|string|array $types): bool
{
Expand Down
3 changes: 2 additions & 1 deletion src/Types/ApplicationOctetStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ class ApplicationOctetStream extends AbstractType
*
* @var string
*/
protected $pattern = "/[\x{00}\x{01}\x{03}\x{04}\x{05}\x{06}\x{07}\x{08}\x{0B}\x{0E}\x{0F}\x{10}\x{11}\x{12}\x{13}\x{14}\x{15}\x{16}\x{17}\x{18}\x{19}\x{1A}\x{1C}\x{1D}\x{1E}\x{1F}]/";
protected $pattern = "/[\x{00}\x{01}\x{03}\x{04}\x{05}\x{06}\x{07}\x{08}\x{0B}\x{0E}\x{0F}" .
"\x{10}\x{11}\x{12}\x{13}\x{14}\x{15}\x{16}\x{17}\x{18}\x{19}\x{1A}\x{1C}\x{1D}\x{1E}\x{1F}]/";
}

0 comments on commit 3eaa381

Please sign in to comment.