<?php function issue($entities, $groupId, $textLength = 10) { $clippedNamesInGroup = array(); foreach ($entities as $entity) { if ($entity->getGroupId() == $groupId) { $clippedNamesInGroup[] = mb_strimwidth( $entity->getName(), 0, $textLength, '…' ); } } return $clippedNamesInGroup; } これでは、どこからどこまでが「グループによる抽出」で、どこからどこまでが「名前の文字数切り詰め」かという区別をつけにくくなる。いまこの2つの概念は、入れ子構造を成していて不可分なものになっている。 もし、グループを問わずに名前を

