diff --git a/src/File.php b/src/File.php index db59fcb..b29f001 100644 --- a/src/File.php +++ b/src/File.php @@ -29,6 +29,6 @@ class File extends Resource throw new IOException("Unable to open file"); } - return new self($fd, $mode->seekable(), $mode->readable(), $mode->writeable()); + return new self($fd, $mode->seekable(), $mode->readable(), $mode->writable()); } } diff --git a/src/FileMode.php b/src/FileMode.php index 29b41cc..e219c03 100644 --- a/src/FileMode.php +++ b/src/FileMode.php @@ -28,7 +28,7 @@ enum FileMode : string return $this === self::READ || $this === self::RW; } - public function writeable(): bool + public function writable(): bool { return $this === self::WRITE || $this === self::RW; } diff --git a/tests/Unit/FileModeTest.php b/tests/Unit/FileModeTest.php index c86d781..daddfa5 100644 --- a/tests/Unit/FileModeTest.php +++ b/tests/Unit/FileModeTest.php @@ -10,10 +10,10 @@ it('defines expected fopen mode values', function () { it('reports read and write capabilities for each mode', function () { expect(FileMode::READ->readable())->toBeTrue() - ->and(FileMode::READ->writeable())->toBeFalse() + ->and(FileMode::READ->writable())->toBeFalse() ->and(FileMode::WRITE->readable())->toBeFalse() - ->and(FileMode::WRITE->writeable())->toBeTrue() + ->and(FileMode::WRITE->writable())->toBeTrue() ->and(FileMode::RW->readable())->toBeTrue() - ->and(FileMode::RW->writeable())->toBeTrue() + ->and(FileMode::RW->writable())->toBeTrue() ->and(FileMode::READ->seekable())->toBeTrue(); });