Skip to content

Commit

Permalink
Backport type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jul 2, 2021
1 parent bf71258 commit 29c50e3
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Definition/ArrayNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
protected $removeExtraKeys = true;
protected $normalizeKeys = true;

public function setNormalizeKeys($normalizeKeys)
public function setNormalizeKeys(bool $normalizeKeys)
{
$this->normalizeKeys = (bool) $normalizeKeys;
$this->normalizeKeys = $normalizeKeys;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions Definition/BaseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ public function addEquivalentValue($originalValue, $equivalentValue)

/**
* Set this node as required.
*
* @param bool $boolean Required node
*/
public function setRequired(bool $boolean)
{
Expand Down
2 changes: 0 additions & 2 deletions Definition/Builder/NodeDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ public function end()
/**
* Creates the node.
*
* @param bool $forceRootNode Whether to force this node as the root node
*
* @return NodeInterface
*/
public function getNode(bool $forceRootNode = false)
Expand Down
2 changes: 1 addition & 1 deletion Definition/Exception/InvalidConfigurationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class InvalidConfigurationException extends Exception
private $path;
private $containsHints = false;

public function setPath($path)
public function setPath(string $path)
{
$this->path = $path;
}
Expand Down
2 changes: 1 addition & 1 deletion ResourceCheckerConfigCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private function safelyUnserialize(string $file)
/**
* @internal
*/
public static function handleUnserializeCallback($class)
public static function handleUnserializeCallback(string $class)
{
trigger_error('Class not found: '.$class);
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Definition/PrototypedArrayNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected function getPrototypeNodeWithDefaultChildren()
*
* @dataProvider getDataForKeyRemovedLeftValueOnly
*/
public function testMappedAttributeKeyIsRemovedLeftValueOnly($value, $children, array $expected)
public function testMappedAttributeKeyIsRemovedLeftValueOnly($value, array $children, array $expected)
{
$node = new PrototypedArrayNode('root');
$node->setKeyAttribute('id', true);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Fixtures/Builder/NodeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class NodeBuilder extends BaseNodeBuilder
{
public function barNode($name): NodeDefinition
public function barNode(?string $name): NodeDefinition
{
return $this->node($name, 'bar');
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Resource/ResourceStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __toString(): string
return 'stub';
}

public function isFresh($timestamp): bool
public function isFresh(int $timestamp): bool
{
return $this->fresh;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Util/XmlUtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function getDataForConvertDomToArray(): array
/**
* @dataProvider getDataForPhpize
*/
public function testPhpize($expected, $value)
public function testPhpize($expected, string $value)
{
$this->assertSame($expected, XmlUtils::phpize($value));
}
Expand Down

0 comments on commit 29c50e3

Please sign in to comment.