Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Ensure configured element count #635

Merged
merged 1 commit into from
Jul 18, 2014
Merged

[TASK] Ensure configured element count #635

merged 1 commit into from
Jul 18, 2014

Conversation

bjo3rnf
Copy link
Contributor

@bjo3rnf bjo3rnf commented Jul 16, 2014

Fixes #628.

$subject = iterator_to_array($subject, TRUE);
} elseif (FALSE === is_array($subject)) {
throw new \Exception('Cannot get values of unsupported type: ' . gettype($subject), 1357098192);
}
if (TRUE === $fixed) {
if (TRUE === (boolean)$fixed) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after (boolean) to read (boolean) $fixed

$subjectSize = count($subject);
$chunkSize = ceil($subjectSize / $count);
$output = array_chunk($subject, $chunkSize);
// Fill the resulting array with empty items to get the desired element count
if (count($output) < $count) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last revision before merging:

Please assign intermedia variable for count($output) since this expression is used twice thrice.

@bjo3rnf
Copy link
Contributor Author

bjo3rnf commented Jul 18, 2014

done.

NamelessCoder added a commit that referenced this pull request Jul 18, 2014
[TASK] Ensure configured element count
@NamelessCoder NamelessCoder merged commit ae8df67 into FluidTYPO3:development Jul 18, 2014
@bjo3rnf bjo3rnf deleted the chunknorris branch July 19, 2014 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iterator.chunk with fixed-setting may result in less than expected chunks
2 participants