Skip to content

Navigation Menu

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 92e1f61

Browse filesBrowse files
committed
log warning
1 parent b486c62 commit 92e1f61
Copy full SHA for 92e1f61

File tree

1 file changed

+8
-4
lines changed
Filter options

1 file changed

+8
-4
lines changed

‎src/Symfony/Component/OptionsResolver/OptionsResolver.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/OptionsResolver/OptionsResolver.php
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,9 @@ public function setAllowedValues($option, $allowedValues)
549549
throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.');
550550
}
551551

552-
// Not supported for nested options
553552
if ($this->isNested($option)) {
553+
@trigger_error(sprintf('The "%s" method should not be used with nested options. A failed attempt occurred with the option "%" for values %s', __METHOD__, $option, $this->formatValues($allowedValues)), E_USER_WARNING);
554+
554555
return $this;
555556
}
556557

@@ -599,8 +600,9 @@ public function addAllowedValues($option, $allowedValues)
599600
throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.');
600601
}
601602

602-
// Not supported for nested options
603603
if ($this->isNested($option)) {
604+
@trigger_error(sprintf('The "%s" method should not be used with nested options. A failed attempt occurred with the option "%" for values %s', __METHOD__, $option, $this->formatValues($allowedValues)), E_USER_WARNING);
605+
604606
return $this;
605607
}
606608

@@ -649,8 +651,9 @@ public function setAllowedTypes($option, $allowedTypes)
649651
throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.');
650652
}
651653

652-
// Not supported for nested options
653654
if ($this->isNested($option)) {
655+
@trigger_error(sprintf('The "%s" method should not be used with nested options. A failed attempt occurred with the option "%" for types %s', __METHOD__, $option, $this->formatValues($allowedTypes)), E_USER_WARNING);
656+
654657
return $this;
655658
}
656659

@@ -693,8 +696,9 @@ public function addAllowedTypes($option, $allowedTypes)
693696
throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.');
694697
}
695698

696-
// Not supported for nested options
697699
if ($this->isNested($option)) {
700+
@trigger_error(sprintf('The "%s" method should not be used with nested options. A failed attempt occurred with the option "%" for types %s', __METHOD__, $option, $this->formatValues($allowedTypes)), E_USER_WARNING);
701+
698702
return $this;
699703
}
700704

0 commit comments

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