Skip to content

Commit

Permalink
Add PHP 8.4 (alpha build) tests support
Browse files Browse the repository at this point in the history
  • Loading branch information
SerafimArts committed Jul 28, 2024
1 parent ae6db76 commit 4d648f1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 31 deletions.
21 changes: 12 additions & 9 deletions src/ReadableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
8 changes: 4 additions & 4 deletions src/SourceFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
22 changes: 4 additions & 18 deletions tests/CompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public function testFileCompatibility(): void
public function getPathname(): string {}

public function getStream() {}

public function getContents(): string {}

public function getHash(): string {}
};
}
Expand All @@ -41,9 +39,7 @@ public function testFileWithMixedCompatibility(): void
public function getPathname(): string {}

public function getStream(): mixed {}

public function getContents(): string {}

public function getHash(): string {}
};
}
Expand All @@ -54,9 +50,7 @@ public function testReadableCompatibility(): void

new class () implements ReadableInterface {
public function getStream() {}

public function getContents(): string {}

public function getHash(): string {}
};
}
Expand All @@ -70,9 +64,7 @@ public function testReadableWithMixedCompatibility(): void

new class () implements ReadableInterface {
public function getStream(): mixed {}

public function getContents(): string {}

public function getHash(): string {}
};
}
Expand All @@ -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 {}
};
}

Expand All @@ -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 {}
};
}
}

0 comments on commit 4d648f1

Please sign in to comment.