@@ -49,7 +49,7 @@ class Container extends Nette\ComponentModel\Container implements \ArrayAccess
4949 */
5050 public function setDefaults (array |object $ data , bool $ erase = false ): static
5151 {
52- $ form = $ this ->getForm (false );
52+ $ form = $ this ->getForm (throw: false );
5353 $ this ->setValues ($ data , $ erase , $ form ?->isAnchored() && $ form ->isSubmitted ());
5454 return $ this ;
5555 }
@@ -87,7 +87,7 @@ public function setValues(array|object $values, bool $erase = false, bool $onlyD
8787 */
8888 public function getValues (string |object |bool |null $ returnType = null , ?array $ controls = null ): object |array
8989 {
90- $ form = $ this ->getForm (false );
90+ $ form = $ this ->getForm (throw: false );
9191 if ($ form && ($ submitter = $ form ->isSubmitted ())) {
9292 if ($ this ->validated === null ) {
9393 throw new Nette \InvalidStateException ('You cannot call getValues() during the validation process. Use getUntrustedValues() instead. ' );
@@ -98,10 +98,10 @@ public function getValues(string|object|bool|null $returnType = null, ?array $co
9898
9999 if ($ controls === null && $ submitter instanceof SubmitterControl) {
100100 $ controls = $ submitter ->getValidationScope ();
101- if ($ controls !== null && !in_array ($ this , $ controls , true )) {
101+ if ($ controls !== null && !in_array ($ this , $ controls , strict: true )) {
102102 $ scope = $ this ;
103103 while (($ scope = $ scope ->getParent ()) instanceof self) {
104- if (in_array ($ scope , $ controls , true )) {
104+ if (in_array ($ scope , $ controls , strict: true )) {
105105 $ controls [] = $ this ;
106106 break ;
107107 }
@@ -130,7 +130,7 @@ public function getUntrustedValues(string|object|null $returnType = null, ?array
130130 $ properties = (new \ReflectionClass ($ resultObj ))->getProperties ();
131131
132132 } else {
133- $ returnType = ( $ returnType ?? $ this ->mappedType ?? ArrayHash::class) ;
133+ $ returnType ??= $ this ->mappedType ?? ArrayHash::class;
134134 $ rc = new \ReflectionClass ($ returnType === self ::Array ? \stdClass::class : $ returnType );
135135 $ constructor = $ rc ->hasMethod ('__construct ' ) ? $ rc ->getMethod ('__construct ' ) : null ;
136136 if ($ constructor ?->getNumberOfRequiredParameters()) {
@@ -146,7 +146,7 @@ public function getUntrustedValues(string|object|null $returnType = null, ?array
146146 $ properties = array_combine (array_map (fn ($ p ) => $ p ->getName (), $ properties ), $ properties );
147147
148148 foreach ($ this ->getComponents () as $ name => $ control ) {
149- $ allowed = $ controls === null || in_array ($ this , $ controls , true ) || in_array ($ control , $ controls , true );
149+ $ allowed = $ controls === null || in_array ($ this , $ controls , strict: true ) || in_array ($ control , $ controls , strict: true );
150150 $ name = (string ) $ name ;
151151 $ property = $ properties [$ name ] ?? null ;
152152 if (
0 commit comments