christeredvartsen
Repos
17
Followers
63
Following
30

Events

Duplicate types for PHPUnit data providers

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?

Created at 14 hours ago
closed issue
Ensure that GitHub teams are visible

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.

Created at 17 hours ago

chore: remove typo in go.mod

fix: typo in error message

feat(github-reconciler): ensure all managed teams are visible

Resolves #116

Created at 17 hours ago
opened issue
Ensure that GitHub teams are visible

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.

Created at 18 hours ago

chore: fix typo in go.mod

chore(deps): bump govulncheck and staticcheck

Created at 18 hours ago

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

Created at 1 day ago
christeredvartsen delete branch snyk-upgrade-2c031f7aaae754e304fd1a405fce4200
Created at 1 day ago
christeredvartsen create branch snyk-upgrade-2c031f7aaae754e304fd1a405fce4200
Created at 1 day ago
delete branch
christeredvartsen delete branch bump-deps
Created at 1 day ago
push

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

Created at 1 day ago
push

Remove old option from the workflow, and update contribution docs

Created at 1 day ago
push

Remove old option

Created at 1 day ago
push

Bump PHPUnit to next major and migrate tests

Created at 1 day ago
christeredvartsen delete branch snyk-upgrade-dafa359153a63a56513eb89c0d74602b
Created at 3 days ago

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

Created at 3 days ago
christeredvartsen create branch snyk-upgrade-dafa359153a63a56513eb89c0d74602b
Created at 3 days ago

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

Created at 3 days ago
christeredvartsen create branch snyk-upgrade-66d32939d1ce02adb3324ffd2c41eddd
Created at 3 days ago
push

Bump imbo/behat-api-extension to next major

Created at 3 days ago
push

Bump vimeo/psalm to next major

Created at 3 days ago
push

Remove unused variable

Created at 4 days ago
create branch
christeredvartsen create branch bump-deps
Created at 4 days ago
christeredvartsen create tag v4.0.0
Created at 4 days ago

Rename boolean -> bool and add some types to test-related code

Bump deps

Created at 4 days ago

feat(docs): add more docs to the README

feat(metrics): update metrics every 5 minutes

Created at 5 days ago

feat(config): specify listen address

feat(azureclient): move client initialization to the package

Created at 5 days ago

feat(config): use sethvargo/go-envconfig for configuration handling as this automatically trims whitespace from env values

Created at 5 days ago

feat(config): use env vars provided by NAIS

Created at 5 days ago