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
* 4.1:
[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
@@ -438,11 +438,7 @@ public function setNormalizer($option, \Closure $normalizer)
438
438
}
439
439
440
440
if (!isset($this->defined[$option])) {
441
-
thrownewUndefinedOptionsException(sprintf(
442
-
'The option "%s" does not exist. Defined options are: "%s".',
443
-
$option,
444
-
implode('", "', array_keys($this->defined))
445
-
));
441
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
446
442
}
447
443
448
444
$this->normalizers[$option] = $normalizer;
@@ -481,11 +477,7 @@ public function setAllowedValues($option, $allowedValues)
481
477
}
482
478
483
479
if (!isset($this->defined[$option])) {
484
-
thrownewUndefinedOptionsException(sprintf(
485
-
'The option "%s" does not exist. Defined options are: "%s".',
486
-
$option,
487
-
implode('", "', array_keys($this->defined))
488
-
));
480
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
@@ -526,11 +518,7 @@ public function addAllowedValues($option, $allowedValues)
526
518
}
527
519
528
520
if (!isset($this->defined[$option])) {
529
-
thrownewUndefinedOptionsException(sprintf(
530
-
'The option "%s" does not exist. Defined options are: "%s".',
531
-
$option,
532
-
implode('", "', array_keys($this->defined))
533
-
));
521
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
534
522
}
535
523
536
524
if (!\is_array($allowedValues)) {
@@ -571,11 +559,7 @@ public function setAllowedTypes($option, $allowedTypes)
571
559
}
572
560
573
561
if (!isset($this->defined[$option])) {
574
-
thrownewUndefinedOptionsException(sprintf(
575
-
'The option "%s" does not exist. Defined options are: "%s".',
576
-
$option,
577
-
implode('", "', array_keys($this->defined))
578
-
));
562
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
@@ -610,11 +594,7 @@ public function addAllowedTypes($option, $allowedTypes)
610
594
}
611
595
612
596
if (!isset($this->defined[$option])) {
613
-
thrownewUndefinedOptionsException(sprintf(
614
-
'The option "%s" does not exist. Defined options are: "%s".',
615
-
$option,
616
-
implode('", "', array_keys($this->defined))
617
-
));
597
+
thrownewUndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
618
598
}
619
599
620
600
if (!isset($this->allowedTypes[$option])) {
@@ -720,11 +700,7 @@ public function resolve(array $options = array())
720
700
ksort($clone->defined);
721
701
ksort($diff);
722
702
723
-
thrownewUndefinedOptionsException(sprintf(
724
-
(\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".',
725
-
implode('", "', array_keys($diff)),
726
-
implode('", "', array_keys($clone->defined))
727
-
));
703
+
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))));
728
704
}
729
705
730
706
// Override options set by the user
@@ -739,10 +715,7 @@ public function resolve(array $options = array())
739
715
if (\count($diff) > 0) {
740
716
ksort($diff);
741
717
742
-
thrownewMissingOptionsException(sprintf(
743
-
\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.',
744
-
implode('", "', array_keys($diff))
745
-
));
718
+
thrownewMissingOptionsException(sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', implode('", "', array_keys($diff))));
746
719
}
747
720
748
721
// Lock the container
@@ -786,17 +759,10 @@ public function offsetGet($option)
786
759
// Check whether the option is set at all
787
760
if (!array_key_exists($option, $this->defaults)) {
788
761
if (!isset($this->defined[$option])) {
789
-
thrownewNoSuchOptionException(sprintf(
790
-
'The option "%s" does not exist. Defined options are: "%s".',
791
-
$option,
792
-
implode('", "', array_keys($this->defined))
793
-
));
762
+
thrownewNoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
794
763
}
795
764
796
-
thrownewNoSuchOptionException(sprintf(
797
-
'The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.',
798
-
$option
799
-
));
765
+
thrownewNoSuchOptionException(sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $option));
800
766
}
801
767
802
768
$value = $this->defaults[$option];
@@ -806,10 +772,7 @@ public function offsetGet($option)
806
772
// If the closure is already being called, we have a cyclic
807
773
// dependency
808
774
if (isset($this->calling[$option])) {
809
-
thrownewOptionDefinitionException(sprintf(
810
-
'The options "%s" have a cyclic dependency.',
811
-
implode('", "', array_keys($this->calling))
812
-
));
775
+
thrownewOptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling))));
813
776
}
814
777
815
778
// The following section must be protected from cyclic
@@ -909,10 +872,7 @@ public function offsetGet($option)
909
872
// If the closure is already being called, we have a cyclic
910
873
// dependency
911
874
if (isset($this->calling[$option])) {
912
-
thrownewOptionDefinitionException(sprintf(
913
-
'The options "%s" have a cyclic dependency.',
914
-
implode('", "', array_keys($this->calling))
915
-
));
875
+
thrownewOptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling))));
0 commit comments