Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8728589

Browse files
committedJun 20, 2023
Add type-hints and return types
1 parent b3b88d2 commit 8728589

File tree

102 files changed

+312
-305
lines changed

Some content is hidden

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

102 files changed

+312
-305
lines changed
 

‎bundles/configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ can add some configuration that looks like this:
8585
// config/packages/acme_social.php
8686
use Symfony\Config\AcmeSocialConfig;
8787
88-
return static function (AcmeSocialConfig $acmeSocial) {
88+
return static function (AcmeSocialConfig $acmeSocial): void {
8989
$acmeSocial->twitter()
9090
->clientId(123)
9191
->clientSecret('your_secret');
@@ -394,7 +394,7 @@ logic to the bundle class directly::
394394
// config/definition.php
395395
use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
396396
397-
return static function (DefinitionConfigurator $definition) {
397+
return static function (DefinitionConfigurator $definition): void {
398398
$definition->rootNode()
399399
->children()
400400
->scalarNode('foo')->defaultValue('bar')->end()

‎cache.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The following example shows a typical usage of the cache::
1010
use Symfony\Contracts\Cache\ItemInterface;
1111

1212
// The callable will only be executed on a cache miss.
13-
$value = $pool->get('my_cache_key', function (ItemInterface $item) {
13+
$value = $pool->get('my_cache_key', function (ItemInterface $item): string {
1414
$item->expiresAfter(3600);
1515

1616
// ... do some HTTP request or heavy computations
@@ -557,13 +557,13 @@ the same key could be invalidated with one function call::
557557

558558
public function someMethod()
559559
{
560-
$value0 = $this->myCachePool->get('item_0', function (ItemInterface $item) {
560+
$value0 = $this->myCachePool->get('item_0', function (ItemInterface $item): string {
561561
$item->tag(['foo', 'bar']);
562562

563563
return 'debug';
564564
});
565565

566-
$value1 = $this->myCachePool->get('item_1', function (ItemInterface $item) {
566+
$value1 = $this->myCachePool->get('item_1', function (ItemInterface $item): string {
567567
$item->tag('foo');
568568

569569
return 'debug';

0 commit comments

Comments
 (0)