Skip to content

Commit

Permalink
Clean up for PHPStan level 7
Browse files Browse the repository at this point in the history
  • Loading branch information
whikloj committed Nov 20, 2024
1 parent c88c647 commit 6be903b
Show file tree
Hide file tree
Showing 23 changed files with 611 additions and 339 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BagItTools

[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg?style=flat-square)](https://php.net/)
[![Github Actions](https://github.com/whikloj/BagItTools/workflows/Build/badge.svg?branch=main)](https://github.com/whikloj/BagItTools/actions?query=workflow%3A%22Build%22+branch%3Amain)
[![Github Actions](https://github.com/whikloj/BagItTools/actions/workflows/main.yml/badge.svg)](https://github.com/whikloj/BagItTools/actions/workflows/main.yml)
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](./LICENSE)
[![codecov](https://codecov.io/gh/whikloj/BagItTools/branch/main/graph/badge.svg)](https://codecov.io/gh/whikloj/BagItTools)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"scripts": {
"phpstan": [
"php -d memory_limit=-1 ./vendor/bin/phpstan analyze -l 5 src tests"
"php -d memory_limit=-1 ./vendor/bin/phpstan analyze -l 7 src tests"
],
"profile": [
"php -d xdebug.mode=profile -d xdebug.output_dir=mytracedir/ -d xdebug.start_with_request=yes -d xdebug.use_compression=true ./vendor/bin/phpunit"
Expand Down
16 changes: 8 additions & 8 deletions src/AbstractManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ abstract class AbstractManifest
/**
* Associative array where paths are keys and hashes are values.
*
* @var array
* @var array<string, string>
*/
protected array $hashes = [];

/**
* Array of the same paths as in $hashes but normalized for case and characters to check for duplication.
*
* @var array
* @var array<string>
*/
protected array $normalizedPaths = [];

Expand All @@ -54,14 +54,14 @@ abstract class AbstractManifest
/**
* Errors while validating this manifest.
*
* @var array
* @var array<array<string, string>>
*/
protected array $manifestErrors = [];

/**
* Warnings generated while validating this manifest.
*
* @var array
* @var array<array<string, string>>
*/
protected array $manifestWarnings = [];

Expand All @@ -70,7 +70,7 @@ abstract class AbstractManifest
* Because of the path key in the hash array if there are multiple entries for a path we need to track it during
* load but present it at validate().
*
* @var array
* @var array<string, array<array<string, string>>>
* Array of arrays with keys 'error' and 'warning'
* @see AbstractManifest::resetLoadIssues
*/
Expand Down Expand Up @@ -125,7 +125,7 @@ public function getFilename(): string
/**
* Return the array of errors.
*
* @return array
* @return array<array<string, string>>
*/
public function getErrors(): array
{
Expand All @@ -135,7 +135,7 @@ public function getErrors(): array
/**
* Return the array of warnings.
*
* @return array
* @return array<array<string, string>>
*/
public function getWarnings(): array
{
Expand Down Expand Up @@ -186,7 +186,7 @@ public function validate(): void
/**
* Return the payload and hashes as an associative array.
*
* @return array
* @return array<string, string>
* Array of paths => hashes
*/
public function getHashes(): array
Expand Down
Loading

0 comments on commit 6be903b

Please sign in to comment.