Skip to content

Commit d10964c

Browse files
minor #33264 [4.4] Add return types on internal|final|private methods (bis) (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [4.4] Add return types on internal|final|private methods (bis) | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Found while working on #33259 `: self` is used for final methods only. I'd have preferred using `: object` but that's not possible on PHP 7.1 Commits ------- 23faee406f [4.4] Add return types on internal|final|private methods (bis)
1 parent d4a6ef0 commit d10964c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Loader/Configurator/CollectionConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ final public function collection($name = ''): self
6060
*
6161
* @return $this
6262
*/
63-
final public function prefix($prefix)
63+
final public function prefix($prefix): self
6464
{
6565
if (\is_array($prefix)) {
6666
if (null === $this->parentPrefixes) {

Loader/Configurator/ImportConfigurator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __destruct()
4141
*
4242
* @return $this
4343
*/
44-
final public function prefix($prefix, bool $trailingSlashOnRoot = true)
44+
final public function prefix($prefix, bool $trailingSlashOnRoot = true): self
4545
{
4646
if (!\is_array($prefix)) {
4747
$this->route->addPrefix($prefix);
@@ -84,7 +84,7 @@ final public function prefix($prefix, bool $trailingSlashOnRoot = true)
8484
*
8585
* @return $this
8686
*/
87-
final public function namePrefix(string $namePrefix)
87+
final public function namePrefix(string $namePrefix): self
8888
{
8989
$this->route->addNamePrefix($namePrefix);
9090

0 commit comments

Comments
 (0)