Skip to content

Commit 548bd9c

Browse files
VasekPurchartondrejmirtes
authored andcommitted
Add stubs for (some) Symfony iterable types
1 parent 8cdb0a6 commit 548bd9c

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed

extension.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ parameters:
33
container_xml_path: null
44
constant_hassers: true
55
console_application_loader: null
6+
stubFiles:
7+
- stubs/FormBuilderInterface.php
8+
- stubs/FormInterface.php
9+
- stubs/HeaderBag.php
10+
- stubs/Session.php
611

712
parametersSchema:
813
symfony: structure([

stubs/FormBuilderInterface.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Symfony\Component\Form;
4+
5+
/**
6+
* @extends \Traversable<int, \Symfony\Component\Form\FormBuilderInterface>
7+
*/
8+
interface FormBuilderInterface extends \Traversable
9+
{
10+
11+
}

stubs/FormInterface.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Symfony\Component\Form;
4+
5+
/**
6+
* @extends \Traversable<int, \Symfony\Component\Form\FormInterface>
7+
*/
8+
interface FormInterface extends \Traversable
9+
{
10+
11+
}

stubs/HeaderBag.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Symfony\Component\HttpFoundation;
4+
5+
/**
6+
* @implements \IteratorAggregate<string, string|string[]>
7+
*/
8+
class HeaderBag implements \IteratorAggregate
9+
{
10+
11+
/**
12+
* @phpstan-return \Traversable<string, string|string[]>
13+
*/
14+
public function getIterator() {}
15+
16+
}

stubs/Session.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Symfony\Component\HttpFoundation\Session;
4+
5+
/**
6+
* @implements \IteratorAggregate<string, mixed>
7+
*/
8+
class Session implements \IteratorAggregate
9+
{
10+
11+
/**
12+
* @phpstan-return \Traversable<string, mixed>
13+
*/
14+
public function getIterator() {}
15+
16+
}

0 commit comments

Comments
 (0)