Skip to content

Commit 3bceb2f

Browse files
committed
General: Fix missing phpstan data
1 parent 5a3f38f commit 3bceb2f

16 files changed

+44
-32
lines changed

src/PHPDraft/In/Tests/ApibFileParserTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public function testParseBasic(): void
108108
*
109109
* @covers \PHPDraft\In\ApibFileParser::set_apib_content
110110
*/
111-
public function testSetContent(){
111+
public function testSetContent(): void
112+
{
112113
$this->class->set_apib_content('content');
113114
$this->assertEquals('content', $this->get_reflection_property_value('full_apib'));
114115
}

src/PHPDraft/Model/Elements/ObjectStructureElement.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@
1818
class ObjectStructureElement extends BasicStructureElement
1919
{
2020

21+
/**
22+
* Object representation before parsing
23+
* @var \stdClass
24+
*/
2125
private $object;
2226

2327
/**
2428
* Unset object function.
2529
* @internal Only for tests
2630
*/
27-
public function __clearForTest()
31+
public function __clearForTest(): void
2832
{
2933
$this->object = null;
3034
}

src/PHPDraft/Model/Elements/StructureElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface StructureElement
1717
/**
1818
* Default data types.
1919
*
20-
* @var array
20+
* @var string[]
2121
*/
2222
public const DEFAULTS = ['boolean', 'string', 'number', 'object', 'array', 'enum'];
2323

src/PHPDraft/Model/Elements/Tests/ArrayStructureElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function setUp(): void
4141
*
4242
* @covers \PHPDraft\Model\Elements\ArrayStructureElement::parse
4343
*/
44-
public function testSuccessfulParse($object, $expected)
44+
public function testSuccessfulParse(string $object, ArrayStructureElement $expected): void
4545
{
4646
$dep = [];
4747
$obj = json_decode($object);

src/PHPDraft/Model/Elements/Tests/BasicStructureElementTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public function testSetupCorrectly(): void
5353
* @dataProvider stringValueProvider
5454
*
5555
* @param mixed $value Value to set to the class
56-
* @param string $string_value Expected string representation
56+
* @param mixed $string_value Expected string representation
5757
*/
58-
public function testStringValue($value, $string_value)
58+
public function testStringValue($value, $string_value): void
5959
{
6060
$this->set_reflection_property_value('value', $value);
6161

@@ -119,7 +119,7 @@ public function testParseCommonDeps(): void
119119
* @param mixed $value Value to set to the class
120120
* @param BasicStructureElement $expected_value Expected string representation
121121
*/
122-
public function testParseCommon($value, $expected_value)
122+
public function testParseCommon($value, BasicStructureElement $expected_value): void
123123
{
124124
$dep = [];
125125
$method = $this->reflection->getMethod('parse_common');

src/PHPDraft/Model/Elements/Tests/ElementStructureElementTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function tearDown(): void
3434
/**
3535
* @covers \PHPDraft\Model\Elements\ElementStructureElement::parse
3636
*/
37-
public function testParse()
37+
public function testParse(): void
3838
{
3939
$json = '{"element": "Cow", "content": "stuff", "meta": {"description": {"content": "desc"}}}';
4040
$dep = [];
@@ -49,15 +49,15 @@ public function testParse()
4949
/**
5050
* @covers \PHPDraft\Model\Elements\ElementStructureElement::string_value
5151
*/
52-
public function testStringValue()
52+
public function testStringValue(): void
5353
{
5454
$this->assertSame('<li class="list-group-item mdl-list__item"><a class="code" title="" href="#object-"></a></li>', $this->class->string_value());
5555
}
5656

5757
/**
5858
* @covers \PHPDraft\Model\Elements\ElementStructureElement::__toString
5959
*/
60-
public function testToString()
60+
public function testToString(): void
6161
{
6262
$this->set_reflection_property_value('type', 'string');
6363

@@ -67,7 +67,7 @@ public function testToString()
6767
/**
6868
* @covers \PHPDraft\Model\Elements\ElementStructureElement::__toString
6969
*/
70-
public function testToStringCustomType()
70+
public function testToStringCustomType(): void
7171
{
7272
$this->set_reflection_property_value('type', 'Cow');
7373

@@ -77,7 +77,7 @@ public function testToStringCustomType()
7777
/**
7878
* @covers \PHPDraft\Model\Elements\ElementStructureElement::__toString
7979
*/
80-
public function testToStringDescription()
80+
public function testToStringDescription(): void
8181
{
8282
$this->set_reflection_property_value('type', 'Cow');
8383
$this->set_reflection_property_value('description', 'Something');
@@ -88,7 +88,7 @@ public function testToStringDescription()
8888
/**
8989
* @covers \PHPDraft\Model\Elements\ElementStructureElement::__toString
9090
*/
91-
public function testToStringValue()
91+
public function testToStringValue(): void
9292
{
9393
$this->set_reflection_property_value('type', 'Cow');
9494
$this->set_reflection_property_value('value', 'stuff');
@@ -99,7 +99,7 @@ public function testToStringValue()
9999
/**
100100
* @covers \PHPDraft\Model\Elements\ElementStructureElement::__toString
101101
*/
102-
public function testToStringDescriptionAndValue()
102+
public function testToStringDescriptionAndValue(): void
103103
{
104104
$this->set_reflection_property_value('type', 'Cow');
105105
$this->set_reflection_property_value('value', 'stuff');

src/PHPDraft/Model/Elements/Tests/EnumStructureElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function testToStringWithComplexArray(): void
120120
*
121121
* @covers \PHPDraft\Model\Elements\EnumStructureElement::parse
122122
*/
123-
public function testSuccesfulParse($object, $expected)
123+
public function testSuccesfulParse(string $object, EnumStructureElement $expected): void
124124
{
125125
$dep = [];
126126
$res = $this->class->parse(json_decode($object), $dep);

src/PHPDraft/Model/Elements/Tests/ObjectStructureElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testNewInstance(): void
5858
*
5959
* @covers \PHPDraft\Model\Elements\ObjectStructureElement::parse
6060
*/
61-
public function testSuccesfulParse($object, $expected)
61+
public function testSuccesfulParse(string $object, ObjectStructureElement $expected): void
6262
{
6363
$dep = [];
6464
$res = $this->class->parse(json_decode($object), $dep);

src/PHPDraft/Model/Elements/Tests/RequestBodyElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testPrintJsonArray(): void
112112
*
113113
* @covers \PHPDraft\Model\Elements\ObjectStructureElement::parse
114114
*/
115-
public function testSuccessfulParse($object, $expected)
115+
public function testSuccessfulParse(string $object, ObjectStructureElement $expected): void
116116
{
117117
$dep = [];
118118
$res = $this->class->parse(json_decode($object), $dep);

src/PHPDraft/Out/BaseTemplateRenderer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ abstract class BaseTemplateRenderer
2626
/**
2727
* CSS Files to load.
2828
*
29-
* @var array
29+
* @var string[]
3030
*/
3131
public $css = [];
3232
/**
3333
* JS Files to load.
3434
*
35-
* @var array
35+
* @var string[]
3636
*/
3737
public $js = [];
3838
/**
@@ -56,7 +56,7 @@ abstract class BaseTemplateRenderer
5656
/**
5757
* The base data of the API.
5858
*
59-
* @var array
59+
* @var array<mixed>
6060
*/
6161
protected $base_data;
6262
/**

0 commit comments

Comments
 (0)