Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9298af4

Browse filesBrowse files
Add union types
1 parent d9f0467 commit 9298af4
Copy full SHA for 9298af4

File tree

Expand file treeCollapse file tree

199 files changed

+384
-566
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

199 files changed

+384
-566
lines changed

‎src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php
+2-8Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,7 @@ private function initializeSubscribers()
207207
$this->subscribers = [];
208208
}
209209

210-
/**
211-
* @param string|object $listener
212-
*/
213-
private function getHash($listener): string
210+
private function getHash(string | object $listener): string
214211
{
215212
if (\is_string($listener)) {
216213
return '_service_'.$listener;
@@ -219,10 +216,7 @@ private function getHash($listener): string
219216
return spl_object_hash($listener);
220217
}
221218

222-
/**
223-
* @param object $listener
224-
*/
225-
private function getMethod($listener, string $event): string
219+
private function getMethod(object $listener, string $event): string
226220
{
227221
if (!method_exists($listener, $event) && method_exists($listener, '__invoke')) {
228222
return '__invoke';

‎src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function createChoiceLabel(object $choice): string
7373
* @internal This method is public to be usable as callback. It should not
7474
* be used in user code.
7575
*/
76-
public static function createChoiceName(object $choice, $key, string $value): string
76+
public static function createChoiceName(object $choice, int | string $key, string $value): string
7777
{
7878
return str_replace('-', '_', (string) $value);
7979
}
@@ -92,7 +92,7 @@ public static function createChoiceName(object $choice, $key, string $value): st
9292
* @internal This method is public to be usable as callback. It should not
9393
* be used in user code.
9494
*/
95-
public function getQueryBuilderPartsForCachingHash($queryBuilder): ?array
95+
public function getQueryBuilderPartsForCachingHash(object $queryBuilder): ?array
9696
{
9797
return null;
9898
}

‎src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getBlockPrefix()
7676
* @internal This method is public to be usable as callback. It should not
7777
* be used in user code.
7878
*/
79-
public function getQueryBuilderPartsForCachingHash($queryBuilder): ?array
79+
public function getQueryBuilderPartsForCachingHash(object $queryBuilder): ?array
8080
{
8181
if (!$queryBuilder instanceof QueryBuilder) {
8282
throw new \TypeError(sprintf('Expected an instance of "%s", but got "%s".', QueryBuilder::class, get_debug_type($queryBuilder)));

‎src/Symfony/Bridge/Twig/Extension/FormExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Extension/FormExtension.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ private function createFieldTranslation(?string $value, array $parameters, $doma
193193
*
194194
* @see ChoiceView::isSelected()
195195
*/
196-
function twig_is_selected_choice(ChoiceView $choice, $selectedValue): bool
196+
function twig_is_selected_choice(ChoiceView $choice, string | array $selectedValue): bool
197197
{
198198
if (\is_array($selectedValue)) {
199199
return \in_array($choice->value, $selectedValue, true);

‎src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(FragmentHandler $handler, FragmentUriGeneratorInterf
3838
*
3939
* @see FragmentHandler::render()
4040
*/
41-
public function renderFragment($uri, array $options = []): string
41+
public function renderFragment(string | ControllerReference $uri, array $options = []): string
4242
{
4343
$strategy = $options['strategy'] ?? 'inline';
4444
unset($options['strategy']);
@@ -53,7 +53,7 @@ public function renderFragment($uri, array $options = []): string
5353
*
5454
* @see FragmentHandler::render()
5555
*/
56-
public function renderFragmentStrategy(string $strategy, $uri, array $options = []): string
56+
public function renderFragmentStrategy(string $strategy, string | ControllerReference $uri, array $options = []): string
5757
{
5858
return $this->handler->render($uri, $strategy, $options);
5959
}

‎src/Symfony/Bridge/Twig/Extension/TranslationExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Extension/TranslationExtension.php
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ public function getTranslationNodeVisitor(): TranslationNodeVisitor
106106
}
107107

108108
/**
109-
* @param string|\Stringable|TranslatableInterface|null $message
110-
* @param array|string $arguments Can be the locale as a string when $message is a TranslatableInterface
109+
* @param array|string $arguments Can be the locale as a string when $message is a TranslatableInterface
111110
*/
112-
public function trans($message, $arguments = [], string $domain = null, string $locale = null, int $count = null): string
111+
public function trans(string | \Stringable | TranslatableInterface | null $message, array | string $arguments = [], string $domain = null, string $locale = null, int $count = null): string
113112
{
114113
if ($message instanceof TranslatableInterface) {
115114
if ([] !== $arguments && !\is_string($arguments)) {

‎src/Symfony/Bridge/Twig/Mime/NotificationEmail.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Mime/NotificationEmail.php
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,10 @@ public function importance(string $importance)
124124
}
125125

126126
/**
127-
* @param \Throwable|FlattenException $exception
128-
*
129127
* @return $this
130128
*/
131-
public function exception($exception)
129+
public function exception(\Throwable | FlattenException $exception)
132130
{
133-
if (!$exception instanceof \Throwable && !$exception instanceof FlattenException) {
134-
throw new \LogicException(sprintf('"%s" accepts "%s" or "%s" instances.', __METHOD__, \Throwable::class, FlattenException::class));
135-
}
136-
137131
$exceptionAsString = $this->getExceptionAsString($exception);
138132

139133
$this->context['exception'] = true;

‎src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
*/
2929
abstract class AbstractConfigCommand extends ContainerDebugCommand
3030
{
31-
/**
32-
* @param OutputInterface|StyleInterface $output
33-
*/
34-
protected function listBundles($output)
31+
protected function listBundles(OutputInterface | StyleInterface $output)
3532
{
3633
$title = 'Available registered bundles with their extension alias if available';
3734
$headers = ['Bundle name', 'Extension alias'];

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ abstract protected function describeContainerTags(ContainerBuilder $builder, arr
113113
*
114114
* @param Definition|Alias|object $service
115115
*/
116-
abstract protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null);
116+
abstract protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null);
117117

118118
/**
119119
* Describes container services.

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
6767
$this->writeData($data, $options);
6868
}
6969

70-
protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null)
70+
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
7171
{
7272
if (!isset($options['id'])) {
7373
throw new \InvalidArgumentException('An "id" option must be provided.');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.