Skip to content

Commit c200b51

Browse files
[Contracts] add return types and bump to v3
1 parent fa9f02f commit c200b51

Some content is hidden

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

56 files changed

+73
-115
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php-http/async-client-implementation": "*",
2020
"php-http/client-implementation": "*",
2121
"psr/cache-implementation": "1.0|2.0|3.0",
22-
"psr/container-implementation": "1.0",
22+
"psr/container-implementation": "1.1|2.0",
2323
"psr/event-dispatcher-implementation": "1.0",
2424
"psr/http-client-implementation": "1.0",
2525
"psr/link-implementation": "1.0",
@@ -39,11 +39,11 @@
3939
"doctrine/persistence": "^2",
4040
"twig/twig": "^2.13|^3.0.4",
4141
"psr/cache": "^1.0|^2.0|^3.0",
42-
"psr/container": "^1.0",
42+
"psr/container": "^1.1|^2.0",
4343
"psr/event-dispatcher": "^1.0",
4444
"psr/link": "^1.1",
4545
"psr/log": "~1.0",
46-
"symfony/contracts": "^2.5",
46+
"symfony/contracts": "^2.5|^3.0",
4747
"symfony/polyfill-ctype": "~1.8",
4848
"symfony/polyfill-intl-grapheme": "~1.0",
4949
"symfony/polyfill-intl-icu": "~1.0",
@@ -186,7 +186,7 @@
186186
"url": "src/Symfony/Contracts",
187187
"options": {
188188
"versions": {
189-
"symfony/contracts": "2.5.x-dev"
189+
"symfony/contracts": "3.0.x-dev"
190190
}
191191
}
192192
},

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function isOptional()
6262
/**
6363
* {@inheritdoc}
6464
*/
65-
public static function getSubscribedServices()
65+
public static function getSubscribedServices(): array
6666
{
6767
return [
6868
'translator' => TranslatorInterface::class,

src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function getParameter(string $name)
8686
return $this->container->get('parameter_bag')->get($name);
8787
}
8888

89-
public static function getSubscribedServices()
89+
public static function getSubscribedServices(): array
9090
{
9191
return [
9292
'router' => '?'.RouterInterface::class,

src/Symfony/Bundle/FrameworkBundle/Routing/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private function resolve(mixed $value): mixed
196196
/**
197197
* {@inheritdoc}
198198
*/
199-
public static function getSubscribedServices()
199+
public static function getSubscribedServices(): array
200200
{
201201
return [
202202
'routing.loader' => LoaderInterface::class,

src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\Translation\Loader\LoaderInterface;
2323
use Symfony\Component\Translation\Loader\YamlFileLoader;
2424
use Symfony\Component\Translation\MessageCatalogue;
25+
use Symfony\Contracts\Translation\TranslatorInterface;
2526

2627
class TranslatorTest extends TestCase
2728
{
@@ -310,7 +311,7 @@ protected function getContainer($loader)
310311
return $container;
311312
}
312313

313-
public function getTranslator($loader, $options = [], $loaderFomat = 'loader', $translatorClass = Translator::class, $defaultLocale = 'en', array $enabledLocales = [])
314+
public function getTranslator($loader, $options = [], $loaderFomat = 'loader', $translatorClass = Translator::class, $defaultLocale = 'en', array $enabledLocales = []): TranslatorInterface
314315
{
315316
$translator = $this->createTranslator($loader, $options, $translatorClass, $loaderFomat, $defaultLocale, $enabledLocales);
316317

src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function isOptional()
8181
/**
8282
* {@inheritdoc}
8383
*/
84-
public static function getSubscribedServices()
84+
public static function getSubscribedServices(): array
8585
{
8686
return [
8787
'twig' => Environment::class,

src/Symfony/Component/Cache/Adapter/AbstractTagAwareAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public function deleteItems(array $keys): bool
282282
/**
283283
* {@inheritdoc}
284284
*/
285-
public function invalidateTags(array $tags)
285+
public function invalidateTags(array $tags): bool
286286
{
287287
if (empty($tags)) {
288288
return false;

src/Symfony/Component/Cache/Adapter/ArrayAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static function ($key, $value, $isHit) {
7373
/**
7474
* {@inheritdoc}
7575
*/
76-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
76+
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed
7777
{
7878
$item = $this->getItem($key);
7979
$metadata = $item->getMetadata();

src/Symfony/Component/Cache/Adapter/ChainAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static function ($sourceItem, $item, $defaultLifetime, $sourceMetadata = null) {
9292
/**
9393
* {@inheritdoc}
9494
*/
95-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
95+
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed
9696
{
9797
$lastItem = null;
9898
$i = 0;

src/Symfony/Component/Cache/Adapter/NullAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static function ($key) {
4040
/**
4141
* {@inheritdoc}
4242
*/
43-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
43+
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed
4444
{
4545
$save = true;
4646

0 commit comments

Comments
 (0)