8000 feature #23262 Add scalar typehints/return types (chalasr, xabbuh) · symfony/lock@43cb7f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 43cb7f0

Browse files
committed
feature #23262 Add scalar typehints/return types (chalasr, xabbuh)
This PR was merged into the 4.0-dev branch. Discussion ---------- Add scalar typehints/return types | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (final, already breaks if doc not respected) | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#23242 (comment) | License | MIT | Doc PR | n/a Commits ------- 7b1715b078 [Yaml] use scalar type hints where possible 6ce70e4bf9 Add scalar typehints/return types on final/internal/private code
2 parents e6b3e87 + 8be53ab commit 43cb7f0

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

Key.php

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,49 +25,32 @@ final class Key
2525
/**
2626
* @param string $resource
2727
*/
28-
public function __construct($resource)
28+
public function __construct(string $resource)
2929
{
30-
$this->resource = (string) $resource;
30+
$this->resource = $resource;
3131
}
3232

3333
public function __toString()
3434
{
3535
return $this->resource;
3636
}
3737

38-
/**
39-
* @param string $stateKey
40-
*
41-
* @return bool
42-
*/
43-
public function hasState($stateKey)
38+
public function hasState(string $stateKey): bool
4439
{
4540
return isset($this->state[$stateKey]);
4641
}
4742

48-
/**
49-
* @param string $stateKey
50-
* @param mixed $state
51-
*/
52-
public function setState($stateKey, $state)
43+
public function setState(string $stateKey, $state): void
5344
{
5445
$this->state[$stateKey] = $state;
5546
}
5647

57-
/**
58-
* @param string $stateKey
59-
*/
60-
public function removeState($stateKey)
48+
public function removeState(string $stateKey): void
6149
{
6250
unset($this->state[$stateKey]);
6351
}
6452

65-
/**
66-
* @param $stateKey
67-
*
68-
* @return mixed
69-
*/
70-
public function getState($stateKey)
53+
public function getState(string $stateKey)
7154
{
7255
return $this->state[$stateKey];
7356
}

0 commit comments

Comments
 (0)
0