-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/Stubs/7/Bundle/FrameworkBundle/Controller/AbstractController.stubphp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Symfony\Bundle\FrameworkBundle\Controller; | ||
|
||
use Symfony\Contracts\Service\ServiceSubscriberInterface; | ||
use Psr\Container\ContainerInterface; | ||
use Symfony\Component\Form\FormInterface; | ||
use Symfony\Component\Form\FormTypeInterface; | ||
|
||
abstract class AbstractController implements ServiceSubscriberInterface | ||
{ | ||
/** | ||
* @psalm-suppress PropertyNotSetInConstructor | ||
*/ | ||
protected ContainerInterface $container; | ||
|
||
/** | ||
* @template TData | ||
* @template TFormType of FormTypeInterface<TData> | ||
* | ||
* @psalm-param class-string<TFormType> $type | ||
* | ||
* @psalm-return FormInterface<TData> | ||
*/ | ||
protected function createForm(string $type, mixed $data = null, array $options = []): FormInterface {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\HttpFoundation; | ||
|
||
/** | ||
* @template T of string|int|float|bool | ||
*/ | ||
final class InputBag extends ParameterBag | ||
{ | ||
/** | ||
* Returns a string input value by name. | ||
* | ||
* @template D of T|null | ||
* @psalm-param D $default | ||
* @psalm-return D|T | ||
* @psalm-taint-source input | ||
* @psalm-mutation-free | ||
*/ | ||
public function get(string $key, mixed $default = null): string|int|float|bool|null {} | ||
|
||
/** | ||
* Returns the parameters. | ||
* | ||
* @param string|null $key The name of the parameter to return or null to get them all | ||
* | ||
* @return array An array of parameters | ||
* | ||
* @psalm-taint-source input | ||
* @psalm-mutation-free | ||
*/ | ||
public function all(?string $key = null): array {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\HttpFoundation; | ||
|
||
class ParameterBag implements \IteratorAggregate, \Countable | ||
{ | ||
/** | ||
* Returns a parameter by name. | ||
* | ||
* @param string $key The key | ||
* @param mixed $default The default value if the parameter key does not exist | ||
* | ||
* @return mixed | ||
* @psalm-taint-source input | ||
* @psalm-mutation-free | ||
*/ | ||
public function get(string $key, mixed $default = null): mixed {} | ||
|
||
/** | ||
* Returns the parameters. | ||
* | ||
* @param string|null $key The name of the parameter to return or null to get them all | ||
* | ||
* @return array An array of parameters | ||
* | ||
* @psalm-taint-source input | ||
* @psalm-mutation-free | ||
*/ | ||
public function all(?string $key = null): array {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\HttpFoundation; | ||
|
||
class Request | ||
{ | ||
/** | ||
* @psalm-var InputBag | ||
*/ | ||
public InputBag $request; | ||
|
||
/** | ||
* @psalm-var InputBag<string> | ||
*/ | ||
public InputBag $query; | ||
|
||
/** | ||
* @psalm-var InputBag<string> | ||
*/ | ||
public InputBag $cookies; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Stubs/7/Component/Serializer/Normalizer/DenormalizerInterface.stubphp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Serializer\Normalizer; | ||
|
||
interface DenormalizerInterface | ||
{ | ||
/** | ||
* @template TObject of object | ||
* @template TType of string|class-string<TObject> | ||
* | ||
* @psalm-param TType $type | ||
* @psalm-return (TType is class-string<TObject> ? TObject : mixed) | ||
*/ | ||
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed; | ||
} |