@@ -259,18 +259,23 @@ public function isNotEmptyArray(string $message = ''): self
259259 public function every (callable $ callback , string $ message = '' ): self
260260 {
261261 $ array = $ this ->variable ;
262+
262263 if (!is_array ($ array )) {
263264 Assert::assertTrue (false , $ message ?: 'Variable is not an array. ' );
264265 }
266+
265267 if (empty ($ array )) {
266268 Assert::assertTrue (false , $ message ?: 'Array is empty, cannot evaluate condition on elements. ' );
267269 }
270+
268271 foreach ($ array as $ key => $ value ) {
269272 if (!$ callback ($ value , $ key )) {
270273 Assert::assertTrue (false , $ message ?: 'Not all elements satisfy the condition. ' );
271274 }
272275 }
276+
273277 Assert::assertTrue (true , $ message );
278+
274279 return $ this ;
275280 }
276281
@@ -292,18 +297,23 @@ public function every(callable $callback, string $message = ''): self
292297 public function some (callable $ callback , string $ message = '' ): self
293298 {
294299 $ array = $ this ->variable ;
300+
295301 if (!is_array ($ array )) {
296302 Assert::assertTrue (false , $ message ?: 'Variable is not an array. ' );
297303 }
304+
298305 if (empty ($ array )) {
299306 Assert::assertTrue (false , $ message ?: 'Array is empty, cannot evaluate condition on elements. ' );
300307 }
308+
301309 foreach ($ array as $ key => $ value ) {
302310 if ($ callback ($ value , $ key )) {
303311 Assert::assertTrue (true , $ message );
312+
304313 return $ this ;
305314 }
306315 }
316+
307317 Assert::assertTrue (false , $ message ?: 'No elements satisfy the condition. ' );
308318 }
309319
@@ -325,18 +335,23 @@ public function some(callable $callback, string $message = ''): self
325335 public function none (callable $ callback , string $ message = '' ): self
326336 {
327337 $ array = $ this ->variable ;
338+
328339 if (!is_array ($ array )) {
329340 Assert::assertTrue (false , $ message ?: 'Variable is not an array. ' );
330341 }
342+
331343 if (empty ($ array )) {
332344 Assert::assertTrue (false , $ message ?: 'Array is empty, cannot evaluate condition on elements. ' );
333345 }
346+
334347 foreach ($ array as $ key => $ value ) {
335348 if ($ callback ($ value , $ key )) {
336349 Assert::assertTrue (false , $ message ?: 'At least one element satisfies the condition. ' );
337350 }
338351 }
352+
339353 Assert::assertTrue (true , $ message );
354+
340355 return $ this ;
341356 }
342357}
0 commit comments