File tree 3 files changed +19
-15
lines changed
tests/Stubs/Symfony/Component/Form
3 files changed +19
-15
lines changed Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
5
- namespace Stubs \Symfony \Component \Form ;
5
+ namespace PHPStan \ Stubs \Symfony \Component \Form ;
6
6
7
7
class DataClass
8
8
{
9
- /**
10
- * @var int
11
- */
9
+
10
+ /** @var int */
12
11
public $ foo ;
13
12
14
- /**
15
- * @var string
16
- */
13
+ /** @var string */
17
14
public $ bar ;
15
+
18
16
}
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Stubs \Symfony \Component \Form ;
3
+ declare (strict_types=1 );
4
+
5
+ namespace PHPStan \Stubs \Symfony \Component \Form ;
4
6
5
7
use Symfony \Component \Form \AbstractType ;
6
8
use Symfony \Component \Form \Extension \Core \Type \NumberType ;
13
15
*/
14
16
class DataClassType extends AbstractType
15
17
{
18
+
16
19
public function buildForm (FormBuilderInterface $ builder , array $ options ): void
17
20
{
18
21
$ builder
@@ -29,4 +32,5 @@ public function configureOptions(OptionsResolver $resolver): void
29
32
])
30
33
;
31
34
}
35
+
32
36
}
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Stubs \Symfony \Component \Form ;
3
+ declare (strict_types=1 );
4
+
5
+ namespace PHPStan \Stubs \Symfony \Component \Form ;
4
6
5
7
use Symfony \Component \Form \FormFactoryInterface ;
6
8
7
9
class FormFactoryAwareClass
8
10
{
9
- /**
10
- * @var FormFactoryInterface
11
- */
11
+
12
+ /** @var FormFactoryInterface */
12
13
private $ formFactory ;
13
14
14
- public function __construct (
15
- FormFactoryInterface $ formFactory
16
- ) {
15
+ public function __construct (FormFactoryInterface $ formFactory )
16
+ {
17
17
$ this ->formFactory = $ formFactory ;
18
18
}
19
19
20
20
public function doSomething (): void
21
21
{
22
22
$ form = $ this ->formFactory ->create (DataClassType::class, new DataClass ());
23
23
$ data = $ form ->getData ();
24
+ \PHPStan \dumpType ($ data );
24
25
$ this ->thisOnlyAcceptsDataClass ($ data );
25
26
$ this ->thisOnlyAcceptsDataClassOrNull ($ data );
26
27
}
@@ -40,4 +41,5 @@ private function thisOnlyAcceptsDataClass(DataClass $data): void
40
41
private function thisOnlyAcceptsDataClassOrNull (?DataClass $ data ): void
41
42
{
42
43
}
44
+
43
45
}
You can’t perform that action at this time.
0 commit comments