ReportsController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A actionGetInsightsReport() 0 5 1
1
<?php
2
/**
3
 * @link      https://dukt.net/facebook/
4
 * @copyright Copyright (c) Dukt
5
 * @license   https://github.com/dukt/facebook/blob/master/LICENSE.md
6
 */
7
8
namespace dukt\facebook\controllers;
9
10
use craft\web\Controller;
11
use dukt\facebook\Plugin as Facebook;
12
use yii\web\Response;
13
14
/**
15
 * Class ReportsController
16
 *
17
 * @author Dukt <[email protected]>
18
 * @since  2.0
19
 */
20
class ReportsController extends Controller
21
{
22
    // Public Methods
23
    // =========================================================================
24
25
    /**
26
     * Returns the insights report.
27
     *
28
     * @return Response
29
     * @throws \GuzzleHttp\Exception\GuzzleException
30
     */
31
    public function actionGetInsightsReport(): Response
32
    {
33
        $report = Facebook::$plugin->getReports()->getInsightsReport();
34
35
        return $this->asJson($report);
36
    }
37
}
38