Skip to content

Commit

Permalink
Updated ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
AltamashShaikh committed Sep 4, 2024
1 parent b90f957 commit 197e833
Show file tree
Hide file tree
Showing 115 changed files with 236 additions and 56 deletions.
1 change: 1 addition & 0 deletions ApiQuotaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter;

/**
Expand Down
1 change: 1 addition & 0 deletions CannotImportCustomDimensionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter;

class CannotImportCustomDimensionException extends \Exception
Expand Down
1 change: 1 addition & 0 deletions CannotImportCustomDimensionGA4Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter;

class CannotImportCustomDimensionGA4Exception extends \Exception
Expand Down
1 change: 1 addition & 0 deletions CannotImportGoalException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter;

class CannotImportGoalException extends \Exception
Expand Down
1 change: 1 addition & 0 deletions CannotProcessImportException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter;

class CannotProcessImportException extends \Exception
Expand Down
2 changes: 2 additions & 0 deletions Commands/ArchiveImportedData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Commands;

use Piwik\Container\StaticContainer;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Plugins\GoogleAnalyticsImporter\ImportStatus;
use Piwik\Plugins\GoogleAnalyticsImporter\Logger\LogToSingleFileProcessor;
use Piwik\Plugins\GoogleAnalyticsImporter\Tasks;

class ArchiveImportedData extends ConsoleCommand
{
protected function configure()
Expand Down
2 changes: 2 additions & 0 deletions Commands/GenerateGaTestData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Commands;

use Piwik\Common;
Expand All @@ -14,6 +15,7 @@
use Piwik\Http;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Log\LoggerInterface;

class GenerateGaTestData extends ConsoleCommand
{
private $visitorIdSeeds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25];

Check failure on line 21 in Commands/GenerateGaTestData.php

View workflow job for this annotation

GitHub Actions / PHPCS

GenerateGaTestData.php: Line exceeds maximum limit of 100 characters; contains 122 characters
Expand Down
2 changes: 2 additions & 0 deletions Commands/ImportGA4Reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Commands;

use Piwik\Config;
Expand All @@ -28,6 +29,7 @@
use Piwik\Plugins\GoogleAnalyticsImporter\ImportWasCancelledException;
use Piwik\Plugins\GoogleAnalyticsImporter\Logger\LogToSingleFileProcessor;
use Piwik\Plugins\GoogleAnalyticsImporter\Tasks;

require_once __DIR__ . '/../vendor/autoload.php';
class ImportGA4Reports extends ConsoleCommand
{
Expand Down
2 changes: 2 additions & 0 deletions Commands/ImportReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Commands;

use Piwik\Config;
Expand All @@ -27,6 +28,7 @@
use Piwik\Plugins\WebsiteMeasurable\Type;
use Piwik\Site;
use Piwik\Timer;

require_once __DIR__ . '/../vendor/autoload.php';
// TODO: make sure same version of google api client is used in this & SearchEngineKeywordsPerformance
// (may have to add test in target plugin)
Expand Down
2 changes: 2 additions & 0 deletions Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter;

use Piwik\Common;
Expand All @@ -29,6 +30,7 @@
use Piwik\Url;
use Piwik\Log\LoggerInterface;
use Piwik\Plugins\SitesManager\SitesManager;

class Controller extends \Piwik\Plugin\ControllerAdmin
{
const OAUTH_STATE_NONCE_NAME = 'GoogleAnalyticsImporter.oauthStateNonce';
Expand Down
2 changes: 2 additions & 0 deletions Diagnostic/RequiredExecutablesCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Diagnostic;

use Piwik\CliMulti\CliPhp;
use Piwik\Plugins\Diagnostics\Diagnostic\Diagnostic;
use Piwik\Plugins\Diagnostics\Diagnostic\DiagnosticResult;
use Piwik\SettingsServer;
use Piwik\Translation\Translator;

class RequiredExecutablesCheck implements Diagnostic
{
/**
Expand Down
2 changes: 2 additions & 0 deletions Diagnostic/RequiredFunctionsCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Diagnostic;

use Piwik\Plugins\Diagnostics\Diagnostic\Diagnostic;
use Piwik\Plugins\Diagnostics\Diagnostic\DiagnosticResult;
use Piwik\Translation\Translator;

class RequiredFunctionsCheck implements Diagnostic
{
/**
Expand Down
1 change: 1 addition & 0 deletions Exceptions/CloudApiQuotaExceeded.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Piwik\Plugins\GoogleAnalyticsImporter\Exceptions;

use Piwik\Piwik;

class CloudApiQuotaExceeded extends \RuntimeException
{
public function __construct($limit = 0)
Expand Down
2 changes: 2 additions & 0 deletions Google/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\ArchiveProcessor\PluginsArchiver;
Expand All @@ -15,6 +16,7 @@
use Piwik\Option;
use Piwik\Piwik;
use Piwik\Url;

class Authorization
{
const ACCESS_TOKEN_OPTION_NAME = 'GoogleAnalyticsImporter.oauthAccessToken';
Expand Down
2 changes: 2 additions & 0 deletions Google/AuthorizationGA4.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Container\StaticContainer;
use Piwik\Piwik;

class AuthorizationGA4
{
const CLIENT_CONFIG_OPTION_NAME = 'GoogleAnalyticsImporter.clientConfiguration';
Expand Down
1 change: 1 addition & 0 deletions Google/DailyRateLimitReached.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

class DailyRateLimitReached extends \RuntimeException
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleAnalyticsGA4QueryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Matomo\Dependencies\GoogleAnalyticsImporter\Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
Expand All @@ -20,6 +21,7 @@
use Piwik\Site;
use Piwik\Log\LoggerInterface;
use Piwik\Plugins\GoogleAnalyticsImporter\Google\GoogleGA4MetricMapper;

class GoogleAnalyticsGA4QueryService
{
const DEFAULT_MAX_ATTEMPTS = 30;
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleAnalyticsQueryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Common;
Expand All @@ -17,6 +18,7 @@
use Piwik\Piwik;
use Piwik\Site;
use Piwik\Log\LoggerInterface;

class GoogleAnalyticsQueryService
{
const DEFAULT_MAX_ATTEMPTS = 30;
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleCustomDimensionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Plugins\CustomDimensions\Dimension\Name;
use Piwik\Plugins\GoogleAnalyticsImporter\CannotImportCustomDimensionException;
use Piwik\Plugins\GoogleAnalyticsImporter\OutOfCustomDimensionsException;

class GoogleCustomDimensionMapper
{
public function map(\Matomo\Dependencies\GoogleAnalyticsImporter\Google\Service\Analytics\CustomDimension $gaCustomDimension)
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleGA4CustomDimensionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Plugins\CustomDimensions\Dimension\Name;
use Piwik\Plugins\GoogleAnalyticsImporter\CannotImportCustomDimensionGA4Exception;
use Piwik\Plugins\GoogleAnalyticsImporter\OutOfCustomDimensionsException;

class GoogleGA4CustomDimensionMapper
{
public function map(\Matomo\Dependencies\GoogleAnalyticsImporter\Google\Analytics\Admin\V1alpha\CustomDimension $gaCustomDimension)
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleGA4GoalMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Log\LoggerInterface;

class GoogleGA4GoalMapper
{
/**
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleGA4MetricMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\DataTable\Row;
use Piwik\Metrics;
use Piwik\Tracker\GoalManager;

class GoogleGA4MetricMapper
{
/**
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleGA4QueryObjectFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Date;
use Piwik\Plugins\GoogleAnalyticsImporter\ImporterGA4;
use Piwik\Log\LoggerInterface;

class GoogleGA4QueryObjectFactory
{
private static $defaultMetricOrderByPriority = [
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleGA4ResponseDataTableFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\DataTable;
use Piwik\DataTable\Row;

class GoogleGA4ResponseDataTableFactory
{
/**
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleGoalMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Plugins\GoogleAnalyticsImporter\CannotImportGoalException;
use Piwik\Plugins\SitesManager\API;
use Piwik\Log\LoggerInterface;
use Piwik\Url;

class GoogleGoalMapper
{
/**
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleMetricMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\DataTable\Row;
use Piwik\Metrics;
use Piwik\Tracker\GoalManager;

class GoogleMetricMapper
{
/**
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleQueryObjectFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Date;
use Piwik\Plugins\GoogleAnalyticsImporter\Importer;
use Piwik\Log\LoggerInterface;

class GoogleQueryObjectFactory
{
private static $defaultMetricOrderByPriority = ['ga:uniquePageviews', 'ga:uniqueScreenviews', 'ga:pageviews', 'ga:screenviews', 'ga:sessions', 'ga:goalCompletionsAll'];
Expand Down
2 changes: 2 additions & 0 deletions Google/GoogleResponseDataTableFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\DataTable;
use Piwik\DataTable\Row;

class GoogleResponseDataTableFactory
{
/**
Expand Down
1 change: 1 addition & 0 deletions Google/HourlyRateLimitReached.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

class HourlyRateLimitReached extends \RuntimeException
Expand Down
2 changes: 2 additions & 0 deletions Google/SearchEngineMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\GoogleAnalyticsImporter\Google;

use Piwik\Plugins\Referrers\SearchEngine;
use Piwik\Log\LoggerInterface;

class SearchEngineMapper
{
private $sourcesToSearchEngines = [];
Expand Down
Loading

0 comments on commit 197e833

Please sign in to comment.