Skip to content

Commit 962dcfe

Browse files
Add return types to internal & magic methods when possible
1 parent a77e326 commit 962dcfe

File tree

80 files changed

+171
-138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+171
-138
lines changed

src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private function createCollector($queries)
205205

206206
class StringRepresentableClass
207207
{
208-
public function __toString()
208+
public function __toString(): string
209209
{
210210
return 'string representation';
211211
}

src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIntIdEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct($id1, $id2, $name)
3434
$this->name = $name;
3535
}
3636

37-
public function __toString()
37+
public function __toString(): string
3838
{
3939
return $this->name;
4040
}

src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct($id1, $id2, $name)
3434
$this->name = $name;
3535
}
3636

37-
public function __toString()
37+
public function __toString(): string
3838
{
3939
return $this->name;
4040
}

src/Symfony/Bridge/Doctrine/Tests/Fixtures/Person.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct($id, $name)
3838
$this->name = $name;
3939
}
4040

41-
public function __toString()
41+
public function __toString(): string
4242
{
4343
return (string) $this->name;
4444
}

src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleAssociationToIntIdEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(SingleIntIdNoToStringEntity $entity, $name)
3131
$this->name = $name;
3232
}
3333

34-
public function __toString()
34+
public function __toString(): string
3535
{
3636
return (string) $this->name;
3737
}

src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct($id, $name)
3333
$this->name = $name;
3434
}
3535

36-
public function __toString()
36+
public function __toString(): string
3737
{
3838
return (string) $this->name;
3939
}

src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringCastableIdEntity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct($id, $name)
3535
$this->name = $name;
3636
}
3737

38-
public function __toString()
38+
public function __toString(): string
3939
{
4040
return (string) $this->name;
4141
}
@@ -50,7 +50,7 @@ public function __construct($id)
5050
$this->id = $id;
5151
}
5252

53-
public function __toString()
53+
public function __toString(): string
5454
{
5555
return (string) $this->id;
5656
}

src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct($id, $name)
3030
$this->name = $name;
3131
}
3232

33-
public function __toString()
33+
public function __toString(): string
3434
{
3535
return $this->name;
3636
}

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function build(ContainerBuilder $container)
7979
$container->register('logger', NullLogger::class);
8080
}
8181

82-
public function __sleep()
82+
public function __sleep(): array
8383
{
8484
return ['varDir', 'testCase', 'rootConfig', 'environment', 'debug'];
8585
}

src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function getLogDir(): string
6464
return $this->cacheDir;
6565
}
6666

67-
public function __sleep()
67+
public function __sleep(): array
6868
{
6969
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
7070
}

0 commit comments

Comments
 (0)