Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] Add parameter type declarations #32237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 8 src/Symfony/Component/Form/AbstractExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract class AbstractExtension implements FormExtensionInterface
/**
* {@inheritdoc}
*/
public function getType($name)
public function getType(string $name)
{
if (null === $this->types) {
$this->initTypes();
Expand All @@ -66,7 +66,7 @@ public function getType($name)
/**
* {@inheritdoc}
*/
public function hasType($name)
public function hasType(string $name)
{
if (null === $this->types) {
$this->initTypes();
Expand All @@ -78,7 +78,7 @@ public function hasType($name)
/**
* {@inheritdoc}
*/
public function getTypeExtensions($name)
public function getTypeExtensions(string $name)
{
if (null === $this->typeExtensions) {
$this->initTypeExtensions();
Expand All @@ -92,7 +92,7 @@ public function getTypeExtensions($name)
/**
* {@inheritdoc}
*/
public function hasTypeExtensions($name)
public function hasTypeExtensions(string $name)
{
if (null === $this->typeExtensions) {
$this->initTypeExtensions();
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Form/AbstractRendererEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ abstract protected function loadResourceForBlockName(string $cacheKey, FormView
*
* @see getResourceForBlockHierarchy()
*/
private function loadResourceForBlockNameHierarchy(string $cacheKey, FormView $view, array $blockNameHierarchy, $hierarchyLevel): bool
private function loadResourceForBlockNameHierarchy(string $cacheKey, FormView $view, array $blockNameHierarchy, int $hierarchyLevel): bool
{
$blockName = $blockNameHierarchy[$hierarchyLevel];

Expand Down
18 changes: 6 additions & 12 deletions 18 src/Symfony/Component/Form/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function getParent()
*
* @throws BadMethodCallException
*/
public function add($child, $type = null, array $options = [])
public function add($child, string $type = null, array $options = [])
{
throw new BadMethodCallException('Buttons cannot have children.');
}
Expand All @@ -138,23 +138,19 @@ public function add($child, $type = null, array $options = [])
*
* This method should not be invoked.
*
* @param string $name
*
* @throws BadMethodCallException
*/
public function get($name)
public function get(string $name)
vudaltsov marked this conversation as resolved.
Show resolved Hide resolved
{
throw new BadMethodCallException('Buttons cannot have children.');
}

/**
* Unsupported method.
*
* @param string $name
*
* @return bool Always returns false
*/
public function has($name)
public function has(string $name)
{
return false;
}
Expand All @@ -164,11 +160,9 @@ public function has($name)
*
* This method should not be invoked.
*
* @param string $name
*
* @throws BadMethodCallException
*/
public function remove($name)
public function remove(string $name)
{
throw new BadMethodCallException('Buttons cannot have children.');
}
Expand All @@ -184,7 +178,7 @@ public function all()
/**
* {@inheritdoc}
*/
public function getErrors($deep = false, $flatten = true)
public function getErrors(bool $deep = false, bool $flatten = true)
{
return new FormErrorIterator($this, []);
}
Expand Down Expand Up @@ -378,7 +372,7 @@ public function handleRequest($request = null)
*
* @throws Exception\AlreadySubmittedException if the button has already been submitted
*/
public function submit($submittedData, $clearMissing = true)
public function submit($submittedData, bool $clearMissing = true)
{
if ($this->submitted) {
throw new AlreadySubmittedException('A form can only be submitted once');
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.