You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 3.4:
[DI] configure inlined services before injecting them when dumping the container
Consistently throw exceptions on a single line
fix fopen calls
Update .editorconfig
Copy file name to clipboardExpand all lines: OptionsResolver.php
+11-51Lines changed: 11 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -381,11 +381,7 @@ public function setNormalizer($option, \Closure $normalizer)
381
381
}
382
382
383
383
if (!isset($this->defined[$option])) {
384
-
thrownewUndefinedOptionsException(sprintf(
385
-
'The option "%s" does not exist. Defined options are: "%s".',
386
-
$option,
387
-
implode('", "', array_keys($this->defined))
388
-
));
384
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
389
385
}
390
386
391
387
$this->normalizers[$option] = $normalizer;
@@ -424,11 +420,7 @@ public function setAllowedValues($option, $allowedValues)
424
420
}
425
421
426
422
if (!isset($this->defined[$option])) {
427
-
thrownewUndefinedOptionsException(sprintf(
428
-
'The option "%s" does not exist. Defined options are: "%s".',
429
-
$option,
430
-
implode('", "', array_keys($this->defined))
431
-
));
423
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
@@ -469,11 +461,7 @@ public function addAllowedValues($option, $allowedValues)
469
461
}
470
462
471
463
if (!isset($this->defined[$option])) {
472
-
thrownewUndefinedOptionsException(sprintf(
473
-
'The option "%s" does not exist. Defined options are: "%s".',
474
-
$option,
475
-
implode('", "', array_keys($this->defined))
476
-
));
464
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
477
465
}
478
466
479
467
if (!\is_array($allowedValues)) {
@@ -514,11 +502,7 @@ public function setAllowedTypes($option, $allowedTypes)
514
502
}
515
503
516
504
if (!isset($this->defined[$option])) {
517
-
thrownewUndefinedOptionsException(sprintf(
518
-
'The option "%s" does not exist. Defined options are: "%s".',
519
-
$option,
520
-
implode('", "', array_keys($this->defined))
521
-
));
505
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
@@ -553,11 +537,7 @@ public function addAllowedTypes($option, $allowedTypes)
553
537
}
554
538
555
539
if (!isset($this->defined[$option])) {
556
-
thrownewUndefinedOptionsException(sprintf(
557
-
'The option "%s" does not exist. Defined options are: "%s".',
558
-
$option,
559
-
implode('", "', array_keys($this->defined))
560
-
));
540
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
561
541
}
562
542
563
543
if (!isset($this->allowedTypes[$option])) {
@@ -662,11 +642,7 @@ public function resolve(array $options = array())
662
642
ksort($clone->defined);
663
643
ksort($diff);
664
644
665
-
thrownewUndefinedOptionsException(sprintf(
666
-
(\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".',
667
-
implode('", "', array_keys($diff)),
668
-
implode('", "', array_keys($clone->defined))
669
-
));
645
+
thrownewUndefinedOptionsException(sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', implode('", "', array_keys($diff)), implode('", "', array_keys($clone->defined))));
670
646
}
671
647
672
648
// Override options set by the user
@@ -681,10 +657,7 @@ public function resolve(array $options = array())
681
657
if (\count($diff) > 0) {
682
658
ksort($diff);
683
659
684
-
thrownewMissingOptionsException(sprintf(
685
-
\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.',
686
-
implode('", "', array_keys($diff))
687
-
));
660
+
thrownewMissingOptionsException(sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', implode('", "', array_keys($diff))));
688
661
}
689
662
690
663
// Lock the container
@@ -728,17 +701,10 @@ public function offsetGet($option)
728
701
// Check whether the option is set at all
729
702
if (!array_key_exists($option, $this->defaults)) {
730
703
if (!isset($this->defined[$option])) {
731
-
thrownewNoSuchOptionException(sprintf(
732
-
'The option "%s" does not exist. Defined options are: "%s".',
733
-
$option,
734
-
implode('", "', array_keys($this->defined))
735
-
));
704
+
thrownewNoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
736
705
}
737
706
738
-
thrownewNoSuchOptionException(sprintf(
739
-
'The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.',
740
-
$option
741
-
));
707
+
thrownewNoSuchOptionException(sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $option));
742
708
}
743
709
744
710
$value = $this->defaults[$option];
@@ -748,10 +714,7 @@ public function offsetGet($option)
748
714
// If the closure is already being called, we have a cyclic
749
715
// dependency
750
716
if (isset($this->calling[$option])) {
751
-
thrownewOptionDefinitionException(sprintf(
752
-
'The options "%s" have a cyclic dependency.',
753
-
implode('", "', array_keys($this->calling))
754
-
));
717
+
thrownewOptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling))));
755
718
}
756
719
757
720
// The following section must be protected from cyclic
@@ -838,10 +801,7 @@ public function offsetGet($option)
838
801
// If the closure is already being called, we have a cyclic
839
802
// dependency
840
803
if (isset($this->calling[$option])) {
841
-
thrownewOptionDefinitionException(sprintf(
842
-
'The options "%s" have a cyclic dependency.',
843
-
implode('", "', array_keys($this->calling))
844
-
));
804
+
thrownewOptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling))));
0 commit comments