I have a question regarding the need to duplicate the types specified in @return
in a data provider. Given the following test:
<?php declare(strict_types=1);
namespace MyNamespace;
use PHPUnit\Framework\TestCase;
class SomeTest extends TestCase
{
/**
* @return array<string,array{data:array<string,string>}>
*/
public static function getData(): array
{
return [
'some data' => [
'data' => [
'foo' => 'bar',
'bar' => 'foo',
],
],
];
}
/**
* @dataProvider getData
*/
public function testSomething(array $data): void
{
foreach ($data as $key => $value) {
// do some assertions
}
}
}
If I run psalm
with an errorLevel
set to 1
on this code I get the following error:
ERROR: MixedAssignment - tests/SomeTest.php:28:35 - Unable to determine the type that $value is being assigned to (see https://psalm.dev/032)
foreach ($data as $key => $value) {
I thought psalm might get this information from the @return
docblock in the data provider. Do I need to duplicate the type for array $data
as $param array< ... > $data
on the testSomething
method, or am I missing something?
Currently we don't specify the visibility of new GitHub teams, and by default they are secret. Console should enforce "public" for all managed GitHub teams.
chore: remove typo in go.mod
fix: typo in error message
feat(github-reconciler): ensure all managed teams are visible
Resolves #116
Currently we don't specify the visibility of new GitHub teams, and by default they are secret. Console should enforce "public" for all managed GitHub teams.
chore: fix typo in go.mod
chore(deps): bump govulncheck and staticcheck
fix: upgrade next from 12.2.5 to 12.3.4
Snyk has created this PR to upgrade next from 12.2.5 to 12.3.4.
See this package in npm: https://www.npmjs.com/package/next
See this project in Snyk: https://app.snyk.io/org/teamdagpenger/project/307dff39-f1b7-4b99-b74a-0c7b67f10a7d?utm_source=github&utm_medium=referral&page=upgrade-pr
composer update and fix warnings from PHPUnit
Remove unused variable
Bump vimeo/psalm to next major
Bump imbo/behat-api-extension to next major
Bump PHPUnit to next major and migrate tests
Remove old option
Remove old option from the workflow, and update contribution docs
Remove old option from the workflow, and update contribution docs
Bump PHPUnit to next major and migrate tests
fix: upgrade no.nav.security:token-validation-spring from 2.0.21 to 2.1.9
Snyk has created this PR to upgrade no.nav.security:token-validation-spring from 2.0.21 to 2.1.9.
See this package in Maven Repository: https://mvnrepository.com/artifact/no.nav.security/token-validation-spring/
See this project in Snyk: https://app.snyk.io/org/teamfamilie/project/5adb4bff-90c4-4bec-9480-e9a960f4967b?utm_source=github&utm_medium=referral&page=upgrade-pr
fix: upgrade com.google.cloud:spring-cloud-gcp-starter-sql-postgresql from 3.4.4 to 3.4.5
Snyk has created this PR to upgrade com.google.cloud:spring-cloud-gcp-starter-sql-postgresql from 3.4.4 to 3.4.5.
See this package in Maven Repository: https://mvnrepository.com/artifact/com.google.cloud/spring-cloud-gcp-starter-sql-postgresql/
See this project in Snyk: https://app.snyk.io/org/teambidrag/project/2fef5daa-1ccd-426f-8e24-22737520b2a8?utm_source=github&utm_medium=referral&page=upgrade-pr
Bump imbo/behat-api-extension to next major
Bump vimeo/psalm to next major
Remove unused variable
Rename boolean -> bool and add some types to test-related code
Bump deps
feat(docs): add more docs to the README
feat(metrics): update metrics every 5 minutes
feat(config): specify listen address
feat(azureclient): move client initialization to the package
feat(config): use sethvargo/go-envconfig for configuration handling as this automatically trims whitespace from env values
feat(config): use env vars provided by NAIS