Skip to content

Commit 35b326a

Browse files
authored
Merge pull request #17 from minvws/feature/doc-update
chore: small update of license documentation
2 parents 479f9af + fec6d2e commit 35b326a

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

LICENSES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ First - The work that is created in the Covid19 context, such as the notificatio
44

55
However - that does not mean that all (derived) work is solely under that single license. For example - where appropriate certain (open source) modules may be required and included. These will remain under their original Copyright and License (though some may be released under the EUPL/1.2 if they are unsuitable to be contributed back upstream).
66

7-
Secondly – The documents of this project that are held in the directory ‘documentation’ are released under the CC0 license (see www.rijksoverheid.nl/copyright). If you use (parts) of these documents, you are not obliged to quote the source, but you must not imply that the Dutch government endorses the derivative work.
7+
Secondly – The documentation of this project is released under the CC0 license (see www.rijksoverheid.nl/copyright). If you use (parts) of these documents, you are not obliged to quote the source, but you must not imply that the Dutch government endorses the derivative work.
88

99
The CC0 does not apply to:
1010

phpstan.neon.dist

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ parameters:
33
- ./src
44
- ./tests
55
level: max
6-
checkGenericClassInNonGenericObjectType: false
7-
checkMissingIterableValueType: false
86
universalObjectCratesClasses:
97
- MinVWS\Codable\Encoding\EncodingContainer
108
- MinVWS\Codable\Decoding\DecodingContainer
11-
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
9+
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
10+
11+
ignoreErrors:
12+
- identifier: missingType.generics
13+
- identifier: missingType.iterableValue

tests/Encoding/EncoderTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Encoding;
66

7+
use Countable;
78
use DateTimeImmutable;
89
use Generator;
910
use MinVWS\Codable\Encoding\Encoder;
@@ -17,6 +18,26 @@
1718
use PHPUnit\Framework\Attributes\DataProvider;
1819
use PHPUnit\Framework\TestCase;
1920

21+
/**
22+
* @phpstan-type PersonShape array{
23+
* firstName: string,
24+
* infix: string,
25+
* surname: string,
26+
* birthDate: string,
27+
* favoriteFruit: string,
28+
* address: array{
29+
* country: string,
30+
* },
31+
* dislikedFruits: array<Fruit>,
32+
* notes: array<string>,
33+
* }
34+
* @phpstan-type FruitSaladShape array{
35+
* title: string,
36+
* description: string,
37+
* author: string,
38+
* fruits: Countable,
39+
* }
40+
*/
2041
class EncoderTest extends TestCase
2142
{
2243
use WithFaker;
@@ -98,6 +119,8 @@ public function testEncodeComplexType(Person $person): void
98119
{
99120
$encoder = new Encoder();
100121
$encoder->getContext()->setUseAssociativeArraysForObjects(true);
122+
123+
/** @var PersonShape $data */
101124
$data = $encoder->encode($person);
102125
$this->assertIsArray($data);
103126
$this->assertEquals($person->firstName, $data['firstName']);
@@ -119,6 +142,7 @@ public static function encodingModeProvider(): Generator
119142
yield [EncodingContext::MODE_DISPLAY, false];
120143
}
121144

145+
122146
#[DataProvider('encodingModeProvider')]
123147
public function testEncodingMode(?string $mode, bool $expectsAuthor): void
124148
{
@@ -132,6 +156,8 @@ public function testEncodingMode(?string $mode, bool $expectsAuthor): void
132156
$encoder = new Encoder();
133157
$encoder->getContext()->setMode($mode);
134158
$encoder->getContext()->setUseAssociativeArraysForObjects(true);
159+
160+
/** @var FruitSaladShape $data */
135161
$data = $encoder->encode($salad);
136162
$this->assertIsArray($data);
137163
$this->assertEquals($salad->title, $data['title']);

0 commit comments

Comments
 (0)