Generate the named reports.

@param SuiteCollection $collection
@param array $reportNames

@return array
167747
public function generateReports(SuiteCollection $collection, array $reportNames)
    {
        $reportDoms = [];
        $reportConfigs = [];

        foreach ($reportNames as $reportName) {
            $reportConfigs[$reportName] = $this->generatorRegistry->getConfig($reportName);
        }

        foreach ($reportConfigs as $reportName => $reportConfig) {
            $generatorName = $reportConfig['generator'];
            $generator = $this->generatorRegistry->getService($generatorName);

            $reportDom = $generator->generate($collection, $reportConfig);

            if (!$reportDom instanceof Document) {
                throw new \RuntimeException(sprintf(
                    'Report generator "%s" should have return a PhpBench\Dom\Document class, got: "%s"',
                    $generatorName,
                    is_object($reportDom) ? get_class($reportDom) : gettype($reportDom)
                ));
            }

            $reportDom->schemaValidate(__DIR__ . '/schema/report.xsd');

            $reportDoms[] = $reportDom;
        }

        return $reportDoms;
    }
380698
public function generateItems(ItemInterface $templateItem, array $collections)
    {
        $result = [];

        $options = $this->getAttributesResolver($templateItem);

        if ($options['max_page'] < 1) {
            throw new AttributeValueException('Items per page value must be great than 0.', 'max_page', $templateItem->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE));
        }

        $providerName = $this->providerToCollection($options['provider']);
        $templateItemPath = $templateItem->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE);

        $providerItems = $this->getProviderItems($collections, $providerName, $templateItemPath);

        if (empty($options['sort_by']) === false) {
            $providerItems = $this->sortItemsByAttribute($providerItems, $options['sort_by'], $options['sort_type']);
        }

        $pages = (new ArrayWrapper($providerItems))->paginate($options['max_page']);

        $totalPages = count($pages);
        $totalItems = count($providerItems);
        $templatePath = dirname($templateItem->getPath(Item::SNAPSHOT_PATH_RELATIVE));

        if ($templatePath === '.') {
            $templatePath = '';
        }

        foreach ($pages as $page => $items) {
            $previousPage = $page > 1 ? $page - 1 : null;
            $previousPagePath = $this->getPageRelativePath($templatePath, $options['permalink'], $previousPage);
            $previousPageUrl = $this->getPagePermalink($previousPagePath);
            $nextPage = $page === $totalPages ? null : $page + 1;
            $nextPagePath = $this->getPageRelativePath($templatePath, $options['permalink'], $nextPage);
            $nextPageUrl = $this->getPagePermalink($nextPagePath);

            $pageAttr = new ArrayWrapper($templateItem->getAttributes());
            $pageAttr->set('pagination.per_page', $options['max_page']);
            $pageAttr->set('pagination.total_items', $totalItems);
            $pageAttr->set('pagination.total_pages', $totalPages);
            $pageAttr->set('pagination.page', $page);
            $pageAttr->set('pagination.previous_page', $previousPage);
            $pageAttr->set('pagination.previous_page_path', $previousPagePath);
            $pageAttr->set('pagination.previous_page_url', $previousPageUrl);
            $pageAttr->set('pagination.next_page', $nextPage);
            $pageAttr->set('pagination.next_page_path', $nextPagePath);
            $pageAttr->set('pagination.next_page_url', $nextPageUrl);

            $pageAttr->remove('permalink');

            $pagePath = $this->getPageRelativePath($templatePath, $options['permalink'], $page);
            $permalink = $this->getPagePermalink($pagePath);

            $item = new PaginationItem($templateItem->getContent(), $pagePath, $pageAttr->getArray());
            $item->setPageItems($items);
            $item->setPath($pagePath, Item::SNAPSHOT_PATH_RELATIVE);
            $item->setPath($permalink, Item::SNAPSHOT_PATH_PERMALINK);

            $result[] = $item;
        }

        return $result;
    }
1062701
public function spawn($name, Collection $collection)
    {
        $nb = new self($name, $this->conf);
        $nb->takeCollection($collection);

        return $nb;
    }
827313
public static function get_metadata(collection $collection) : collection {
        $toolmonitorrules = [
            'description' => 'privacy:metadata:description',
            'name' => 'privacy:metadata:name',
            'userid' => 'privacy:metadata:userid',
            'plugin' => 'privacy:metadata:plugin',
            'eventname' => 'privacy:metadata:eventname',
            'template' => 'privacy:metadata:template',
            'frequency' => 'privacy:metadata:frequency',
            'timewindow' => 'privacy:metadata:timewindow',
            'timemodified' => 'privacy:metadata:timemodifiedrule',
            'timecreated' => 'privacy:metadata:timecreatedrule'
        ];
        $toolmonitorsubscriptions = [
            'userid' => 'privacy:metadata:useridsub',
            'timecreated' => 'privacy:metadata:timecreatedsub',
            'lastnotificationsent' => 'privacy:metadata:lastnotificationsent',
            'inactivedate' => 'privacy:metadata:inactivedate'
        ];
        // Tool monitor history doesn't look like it is used at all.
        $toolmonitorhistory = [
            'userid' => 'privacy:metadata:useridhistory',
            'timesent' => 'privacy:metadata:timesent'
        ];
        $collection->add_database_table('tool_monitor_rules', $toolmonitorrules, 'privacy:metadata:rulessummary');
        $collection->add_database_table('tool_monitor_subscriptions', $toolmonitorsubscriptions,
                'privacy:metadata:subscriptionssummary');
        $collection->add_database_table('tool_monitor_history', $toolmonitorhistory, 'privacy:metadata:historysummary');
        $collection->link_subsystem('core_message', 'privacy:metadata:messagesummary');
        return $collection;
    }
977279
public function createSuccessFromEventCollection(
        EventCollection $events
    ): EventCollection {
        Assert::assertThat(true, Assert::isTrue());

        return $events;
    }
69951
protected function transformToDocuments($auditLogs)
    {
        $index = $this->getIndex();
        $type = $this->getType();
        $documents = [];
        foreach ($auditLogs as $log) {
            $primary = $log->getId();
            $primary = is_array($primary) ? array_values($primary) : $primary;
            $eventType = $log->getEventType();
            $data = [
                '@timestamp' => $log->getTimestamp(),
                'transaction' => $log->getTransactionId(),
                'type' => $eventType,
                'primary_key' => $primary,
                'source' => $log->getSourceName(),
                'parent_source' => $log->getParentSourceName(),
                'original' => $eventType === 'delete' ? null : $log->getOriginal(),
                'changed' => $eventType === 'delete' ? null : $log->getChanged(),
                'meta' => $log->getMetaInfo()
            ];
            $id = $this->useTransactionId ? $log->getTransactionId() : '';
            $documents[] = new Document($id, $data, $type, $index);
        }

        return $documents;
    }
1039118
public void setReportDefinitions(java.util.Collection<ReportDefinition> reportDefinitions) {
        if (reportDefinitions == null) {
            this.reportDefinitions = null;
            return;
        }

        this.reportDefinitions = new java.util.ArrayList<ReportDefinition>(reportDefinitions);
    }
1246630
public function createSuccessFromEventCollection(
        EventCollection $events
    ): EventCollection {
        $suiteClass = $this->suiteClass;
        $suiteClass::current()->assert($this->successConfig);

        return $events;
    }
1292081
public function report($reportName, $report, $path)
    {
        switch ($reportName) {
            case '{'.self::NS_CALDAV.'}calendar-multiget':
                $this->server->transactionType = 'report-calendar-multiget';
                $this->calendarMultiGetReport($report);

                return false;
            case '{'.self::NS_CALDAV.'}calendar-query':
                $this->server->transactionType = 'report-calendar-query';
                $this->calendarQueryReport($report);

                return false;
            case '{'.self::NS_CALDAV.'}free-busy-query':
                $this->server->transactionType = 'report-free-busy-query';
                $this->freeBusyQueryReport($report);

                return false;
        }
    }
841639
public void generateReport(List<XmlSuite> xmlSuites,
                               List<ISuite> suites,
                               String outputDirectoryName)
    {
        removeEmptyDirectories(new File(outputDirectoryName));
        
        File outputDirectory = new File(outputDirectoryName, REPORT_DIRECTORY);
        outputDirectory.mkdirs();

        Collection<TestClassResults> flattenedResults = flattenResults(suites);

        for (TestClassResults results : flattenedResults)
        {
            VelocityContext context = createContext();
            context.put(RESULTS_KEY, results);

            try
            {
                generateFile(new File(outputDirectory, results.getTestClass().getName() + '_' + RESULTS_FILE),
                             RESULTS_FILE + TEMPLATE_EXTENSION,
                             context);
            }
            catch (Exception ex)
            {
                throw new ReportNGException("Failed generating JUnit XML report.", ex);
            }
        }
    }
6514
private function getCustomisedData(TaskLogCollection $collection)
    {
        $data = [];

        if (!is_null($this->rowCustomiser)) {
            foreach ($collection as $taskLogEntity) {
                $newCustomiser = $this->rowCustomiser->bindTo($taskLogEntity, $taskLogEntity);

                $data[] = array_merge($taskLogEntity->toArray(), (array) $newCustomiser());
            }
        }

        return $data;
    }
585205
public static function getByName(string $name): InvoiceTemplateCollection
    {
        $invoiceTemplates = InvoiceTemplate::get()->where("name", $name);

        return new InvoiceTemplateCollection($invoiceTemplates->elements());
    }
774224
static function &loadExistingReport($reportfile, $projects_folder = "projects")
    {
        $q = new Reportico();
        $q->reports_path = $projects_folder . "/" . ReporticoApp::getconfig("project");
        $q->projects_folder = $projects_folder;

        $reader = new XmlReader ($q, $reportfile, false);
        $reader->xml2query();

        return $q;
    }
1114104
protected function generateStatusesPropertiesMap(array $statusCollection)
    {
        $statusMap = array();

        foreach ($statusCollection as $index => $status) {
            if ($status->isInitialState()) {
                $statusMap[$index]['initialState'] = '1';
            }
            if ($status->isTranslationState()) {
                $statusMap[$index]['translationState'] = '1';
            }
            if ($status->isPublishedState()) {
                $statusMap[$index]['publishedState'] = '1';
            }
            if ($status->isAutoPublishFromState()) {
                $statusMap[$index]['autoPublishFromState'] = '1';
            }
            if ($status->isAutoUnpublishToState()) {
                $statusMap[$index]['autoUnpublishToState'] = '1';
            }
        }

        return $statusMap;
    }
494455
private function createObj($reportDefinitionFields)
    {
        $obj = new \stdClass();

        foreach ($reportDefinitionFields as $reportDefinitionField) {
            $name = $reportDefinitionField->getFieldName();
            $obj->$name = [
                'type' => $reportDefinitionField->getFieldType(),
                'values' => ($reportDefinitionField->getEnumValues() !== null) ? $reportDefinitionField->getEnumValues() : null,
            ];

        }

        return $obj;
    }
362235
public static void initReportData(List<ISuite> suites) {
        logger.entering(suites);
        if (!isReportInitialized) {
            for (ISuite suite : suites) {
                Map<String, ISuiteResult> r = suite.getResults();
                for (ISuiteResult r2 : r.values()) {
                    ITestContext tc = r2.getTestContext();
                    ITestNGMethod[] methods = tc.getAllTestMethods();
                    for (ITestNGMethod method : methods) {
                        method.setId(UUID.randomUUID().toString());
                    }
                }
            }
            isReportInitialized = true;
        }
        logger.exiting();
    }
427115
protected function copyCollectionWith(Collection $collection, array $values)
    {
        $collection = clone $collection;

        $collection->exchangeArray($values);

        return $collection;
    }