Skip to content

Commit

Permalink
Add type coverage phpstan extension
Browse files Browse the repository at this point in the history
  • Loading branch information
usox committed Oct 31, 2023
1 parent 85952c0 commit 0d284be
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"phpstan/phpstan-strict-rules": "^1",
"phpunit/phpunit": "^10",
"rector/rector": "^0.18",
"tomasvotruba/cognitive-complexity": "^0.2"
"tomasvotruba/cognitive-complexity": "^0.2",
"tomasvotruba/type-coverage": "^0.2.1"
},
"license": "MIT",
"authors": [
Expand Down
145 changes: 144 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ parameters:
cognitive_complexity:
class: 50
function: 10
type_coverage:
return_type: 100
param_type: 100
property_type: 100

includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Cli/Wizard/UserCreationWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function create(
return;
}

$validator = static function ($password): string {
$validator = static function (mixed $password): string {
$password = trim((string) $password);
if (mb_strlen($password) < PasswordVerificator::PASSWORD_MIN_LENGTH) {
throw new InvalidArgumentException('Password too short');
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Io/Transcoder/FfmpegTranscoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function setFilePath(string $file_path): self
/**
* @return resource
*/
public function getHandle()
public function getHandle(): mixed
{
$transcodingConfig = $this->configProvider->getTranscodingConfig();

Expand Down
2 changes: 1 addition & 1 deletion src/Component/Io/Transcoder/TranscoderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public function setFilePath(string $file_path): self;
/**
* @return resource
*/
public function getHandle();
public function getHandle(): mixed;
}

0 comments on commit 0d284be

Please sign in to comment.