@@ 1432-1445 (lines=14) @@ | ||
1429 | * @param int $size |
|
1430 | * @return bool |
|
1431 | */ |
|
1432 | function sizeIs($collection, $size) |
|
1433 | { |
|
1434 | $itemsTempCount = 0; |
|
1435 | ||
1436 | foreach ($collection as $key => $value) { |
|
1437 | $itemsTempCount++; |
|
1438 | ||
1439 | if ($itemsTempCount > $size) { |
|
1440 | return false; |
|
1441 | } |
|
1442 | } |
|
1443 | ||
1444 | return $itemsTempCount == $size; |
|
1445 | } |
|
1446 | ||
1447 | /** |
|
1448 | * Checks whether $collection has less than $size items. |
|
@@ 1454-1467 (lines=14) @@ | ||
1451 | * @param int $size |
|
1452 | * @return bool |
|
1453 | */ |
|
1454 | function sizeIsLessThan($collection, $size) |
|
1455 | { |
|
1456 | $itemsTempCount = 0; |
|
1457 | ||
1458 | foreach ($collection as $key => $value) { |
|
1459 | $itemsTempCount++; |
|
1460 | ||
1461 | if ($itemsTempCount > $size) { |
|
1462 | return false; |
|
1463 | } |
|
1464 | } |
|
1465 | ||
1466 | return $itemsTempCount < $size; |
|
1467 | } |
|
1468 | ||
1469 | /** |
|
1470 | * Checks whether $collection has more than $size items. |
|
@@ 1476-1489 (lines=14) @@ | ||
1473 | * @param int $size |
|
1474 | * @return bool |
|
1475 | */ |
|
1476 | function sizeIsGreaterThan($collection, $size) |
|
1477 | { |
|
1478 | $itemsTempCount = 0; |
|
1479 | ||
1480 | foreach ($collection as $key => $value) { |
|
1481 | $itemsTempCount++; |
|
1482 | ||
1483 | if ($itemsTempCount > $size) { |
|
1484 | return true; |
|
1485 | } |
|
1486 | } |
|
1487 | ||
1488 | return $itemsTempCount > $size; |
|
1489 | } |
|
1490 | ||
1491 | /** |
|
1492 | * Checks whether $collection has between $fromSize to $toSize items. $toSize can be |