@@ 1463-1476 (lines=14) @@ | ||
1460 | * @param int $size |
|
1461 | * @return bool |
|
1462 | */ |
|
1463 | function sizeIs($collection, $size) |
|
1464 | { |
|
1465 | $itemsTempCount = 0; |
|
1466 | ||
1467 | foreach ($collection as $key => $value) { |
|
1468 | $itemsTempCount++; |
|
1469 | ||
1470 | if ($itemsTempCount > $size) { |
|
1471 | return false; |
|
1472 | } |
|
1473 | } |
|
1474 | ||
1475 | return $itemsTempCount == $size; |
|
1476 | } |
|
1477 | ||
1478 | /** |
|
1479 | * Checks whether $collection has less than $size items. |
|
@@ 1485-1498 (lines=14) @@ | ||
1482 | * @param int $size |
|
1483 | * @return bool |
|
1484 | */ |
|
1485 | function sizeIsLessThan($collection, $size) |
|
1486 | { |
|
1487 | $itemsTempCount = 0; |
|
1488 | ||
1489 | foreach ($collection as $key => $value) { |
|
1490 | $itemsTempCount++; |
|
1491 | ||
1492 | if ($itemsTempCount > $size) { |
|
1493 | return false; |
|
1494 | } |
|
1495 | } |
|
1496 | ||
1497 | return $itemsTempCount < $size; |
|
1498 | } |
|
1499 | ||
1500 | /** |
|
1501 | * Checks whether $collection has more than $size items. |
|
@@ 1507-1520 (lines=14) @@ | ||
1504 | * @param int $size |
|
1505 | * @return bool |
|
1506 | */ |
|
1507 | function sizeIsGreaterThan($collection, $size) |
|
1508 | { |
|
1509 | $itemsTempCount = 0; |
|
1510 | ||
1511 | foreach ($collection as $key => $value) { |
|
1512 | $itemsTempCount++; |
|
1513 | ||
1514 | if ($itemsTempCount > $size) { |
|
1515 | return true; |
|
1516 | } |
|
1517 | } |
|
1518 | ||
1519 | return $itemsTempCount > $size; |
|
1520 | } |
|
1521 | ||
1522 | /** |
|
1523 | * Checks whether $collection has between $fromSize to $toSize items. $toSize can be |