Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3.1.x' into 3.0.x-into-3.1.x-sync
Browse files Browse the repository at this point in the history
# Conflicts:
#	.laminas-ci.json
#	composer.lock
  • Loading branch information
gsteel committed Jan 23, 2025
2 parents 37f0c2b + 5f1329a commit a9a0ffb
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 123 deletions.
4 changes: 2 additions & 2 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"backwardCompatibilityCheck": true,
"ignore_php_platform_requirements": {
"8.4": true
},
"backwardCompatibilityCheck": true
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"ext-posix": "*",
"laminas/laminas-cache-storage-adapter-benchmark": "^2.0",
"laminas/laminas-cache-storage-adapter-test": "^4.1",
"laminas/laminas-coding-standard": "~2.4",
"laminas/laminas-coding-standard": "~3.0",
"laminas/laminas-serializer": "^3.0",
"phpunit/phpunit": "^10.5",
"phpunit/phpunit": "^10.5.35",
"psalm/plugin-phpunit": "^0.19.0",
"vimeo/psalm": "^5.18"
},
Expand Down
246 changes: 152 additions & 94 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ final class Filesystem extends AbstractMetadataCapableAdapter implements
*/
private string $lastFileSpec = '';

private FilesystemInteractionInterface $filesystem;
private ClockInterface $clock;
private readonly FilesystemInteractionInterface $filesystem;
private readonly ClockInterface $clock;

/**
* @param null|iterable<string,mixed>|FilesystemOptions $options
Expand Down
2 changes: 1 addition & 1 deletion src/Filesystem/Exception/MetadataException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class MetadataException extends RuntimeException
public const METADATA_MTIME = 'mtime';
public const METADATA_FILESIZE = 'filesize';

private ErrorException $error;
private readonly ErrorException $error;

/**
* @psalm-param MetadataException::METADATA_* $metadata
Expand Down
2 changes: 1 addition & 1 deletion src/Filesystem/Exception/UnlinkException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

final class UnlinkException extends RuntimeException
{
private ErrorException $error;
private readonly ErrorException $error;

public function __construct(string $path, ErrorException $error)
{
Expand Down
33 changes: 15 additions & 18 deletions src/FilesystemIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
*/
final class FilesystemIterator implements IteratorInterface
{
/**
* The Filesystem storage instance
*/
private Filesystem $storage;

/**
* The iterator mode
*
Expand All @@ -31,24 +26,26 @@ final class FilesystemIterator implements IteratorInterface
/**
* The GlobIterator instance
*/
private GlobIterator $globIterator;

/**
* The namespace sprefix
*/
private string $prefix;
private readonly GlobIterator $globIterator;

/**
* String length of namespace prefix
*/
private int $prefixLength;

public function __construct(Filesystem $storage, string $path, string $prefix)
{
$this->storage = $storage;
private readonly int $prefixLength;

public function __construct(
/**
* The Filesystem storage instance
*/
private readonly Filesystem $storage,
string $path,
/**
* The namespace sprefix
*/
private readonly string $prefix
) {
$this->globIterator = new GlobIterator($path, GlobIterator::KEY_AS_FILENAME);
$this->prefix = $prefix;
$this->prefixLength = strlen($prefix);
$this->prefixLength = strlen($this->prefix);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions test/unit/FilesystemOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use function realpath;
use function rmdir;
use function str_replace;
use function str_starts_with;
use function strpos;
use function substr;
use function sys_get_temp_dir;
Expand All @@ -42,7 +43,6 @@ final class FilesystemOptionsTest extends AbstractAdapterOptionsTest
protected string $keyPattern = FilesystemOptions::KEY_PATTERN;

/**
* @param array $out
* @psalm-assert list<string> $out
*/
private static function assertAllString(array $out): void
Expand Down Expand Up @@ -99,7 +99,7 @@ public function testNormalizeCacheDir(): void

public function testSetCacheDirNotWritableException(): void
{
if (substr(PHP_OS, 0, 3) === 'WIN') {
if (str_starts_with(PHP_OS, 'WIN')) {
self::markTestSkipped('Not testable on windows');
} else {
$out = [];
Expand Down Expand Up @@ -131,7 +131,7 @@ public function testSetCacheDirNotWritableException(): void

public function testSetCacheDirNotReadableException(): void
{
if (substr(PHP_OS, 0, 3) === 'WIN') {
if (str_starts_with(PHP_OS, 'WIN')) {
self::markTestSkipped('Not testable on windows');
} else {
@exec('whoami 2>&1', $out, $ret);
Expand Down

0 comments on commit a9a0ffb

Please sign in to comment.