diff --git a/src/ReadableInterface.php b/src/ReadableInterface.php index 0f00fb4..cc876af 100644 --- a/src/ReadableInterface.php +++ b/src/ReadableInterface.php @@ -9,18 +9,20 @@ interface ReadableInterface /** * Returns the resource stream of the source. * - * @return resource returns the streaming contents of a file - * @throws SourceExceptionInterface may occur during the inability to - * open or some operations with the resource stream + * @return resource Returns the streaming contents of a file. + * + * @throws SourceExceptionInterface May occur during the inability to + * open or some operations with the resource stream. */ public function getStream(); /** * Returns the contents of the source. * - * @return string returns the string contents of a file - * @throws SourceExceptionInterface may occur when it is not possible to - * read source's data and/or convert it to a string + * @return string Returns the string contents of a file. + * + * @throws SourceExceptionInterface May occur when it is not possible to + * read source's data and/or convert it to a string. */ public function getContents(): string; @@ -30,9 +32,10 @@ public function getContents(): string; * If the value of the source content changes, the hash value will * also be changed. * - * @return non-empty-string returns hash of a file - * @throws SourceExceptionInterface may occur when it is not possible to - * convert object state information into a hash + * @return non-empty-string Returns hash of a file. + * + * @throws SourceExceptionInterface May occur when it is not possible to + * convert object state information into a hash. */ public function getHash(): string; } diff --git a/src/SourceFactoryInterface.php b/src/SourceFactoryInterface.php index dc71674..3482706 100644 --- a/src/SourceFactoryInterface.php +++ b/src/SourceFactoryInterface.php @@ -7,11 +7,11 @@ interface SourceFactoryInterface { /** - * @param mixed $source arbitrary source reference from which you can - * create a {@see ReadableInterface} instance + * @param mixed $source Arbitrary source reference from which you can + * create a {@see ReadableInterface} instance. * - * @throws SourceExceptionInterface in case of an error in creating the - * source object + * @throws SourceExceptionInterface In case of an error in creating the + * source object. */ public function create($source): ReadableInterface; } diff --git a/tests/CompatibilityTest.php b/tests/CompatibilityTest.php index da70146..b5e9bdb 100644 --- a/tests/CompatibilityTest.php +++ b/tests/CompatibilityTest.php @@ -23,9 +23,7 @@ public function testFileCompatibility(): void public function getPathname(): string {} public function getStream() {} - public function getContents(): string {} - public function getHash(): string {} }; } @@ -41,9 +39,7 @@ public function testFileWithMixedCompatibility(): void public function getPathname(): string {} public function getStream(): mixed {} - public function getContents(): string {} - public function getHash(): string {} }; } @@ -54,9 +50,7 @@ public function testReadableCompatibility(): void new class () implements ReadableInterface { public function getStream() {} - public function getContents(): string {} - public function getHash(): string {} }; } @@ -70,9 +64,7 @@ public function testReadableWithMixedCompatibility(): void new class () implements ReadableInterface { public function getStream(): mixed {} - public function getContents(): string {} - public function getHash(): string {} }; } @@ -90,12 +82,9 @@ public function testSourceFactoryCompatibility(): void new class () implements SourceFactoryInterface { public function create($source): ReadableInterface {} - - public function createFromString(string $content = '', ?string $name = null): ReadableInterface {} - + public function createFromString(string $content = '', string $name = null): ReadableInterface {} public function createFromFile(string $filename): FileInterface {} - - public function createFromStream($stream, ?string $name = null): ReadableInterface {} + public function createFromStream($stream, string $name = null): ReadableInterface {} }; } @@ -108,12 +97,9 @@ public function testSourceFactoryWithMixedCompatibility(): void new class () implements SourceFactoryInterface { public function create(mixed $source): ReadableInterface {} - - public function createFromString(string $content = '', ?string $name = null): ReadableInterface {} - + public function createFromString(string $content = '', string $name = null): ReadableInterface {} public function createFromFile(string $filename): FileInterface {} - - public function createFromStream(mixed $stream, ?string $name = null): ReadableInterface {} + public function createFromStream(mixed $stream, string $name = null): ReadableInterface {} }; } }