code: private function countSourceItems($sources)
      {
          $count = 0;
          foreach ($sources as $source) {
              $count += count($source);
          }
  
          return $count;
      }
docs: Counts number of items in the services.
  
  @param \Traversable[]|array[] $sources
  
  @return int