Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfabiocarneiro <fahecs@gmail.com>2015-05-27 12:56:17 +0300
committerfabiocarneiro <fahecs@gmail.com>2015-05-27 12:56:17 +0300
commita2a63d34ebb460174e1a3e8d8022fe3e3ab4b469 (patch)
treefbfc480352bc711bc03f12849824507e56b5034a /core/AssetManager.php
parentb2f5b5489ceca056217fc6663ec6c2c6b052cd42 (diff)
fix core folder with php-cs-fixer for psr-2
Diffstat (limited to 'core/AssetManager.php')
-rw-r--r--core/AssetManager.php29
1 files changed, 8 insertions, 21 deletions
diff --git a/core/AssetManager.php b/core/AssetManager.php
index 28f8407b79..a1a1762a4b 100644
--- a/core/AssetManager.php
+++ b/core/AssetManager.php
@@ -19,10 +19,8 @@ use Piwik\AssetManager\UIAssetFetcher\StylesheetUIAssetFetcher;
use Piwik\AssetManager\UIAssetFetcher;
use Piwik\AssetManager\UIAssetMerger\JScriptUIAssetMerger;
use Piwik\AssetManager\UIAssetMerger\StylesheetUIAssetMerger;
-use Piwik\Config as PiwikConfig;
use Piwik\Container\StaticContainer;
use Piwik\Plugin\Manager;
-use Piwik\Translate;
/**
* AssetManager is the class used to manage the inclusion of UI assets:
@@ -67,7 +65,7 @@ class AssetManager extends Singleton
*/
private $theme;
- function __construct()
+ public function __construct()
{
$this->cacheBuster = UIAssetCacheBuster::getInstance();
$this->minimalStylesheetFetcher = new StaticUIAssetFetcher(array('plugins/Morpheus/stylesheets/base.less', 'plugins/Morpheus/stylesheets/general/_forms.less'), array(), $this->theme);
@@ -122,14 +120,11 @@ class AssetManager extends Singleton
$result = "<script type=\"text/javascript\">\n" . Translate::getJavascriptTranslations() . "\n</script>";
if ($this->isMergedAssetsDisabled()) {
-
$this->getMergedCoreJSAsset()->delete();
$this->getMergedNonCoreJSAsset()->delete();
$result .= $this->getIndividualJsIncludes();
-
} else {
-
$result .= sprintf(self::JS_IMPORT_DIRECTIVE, self::GET_CORE_JS_MODULE_ACTION);
$result .= sprintf(self::JS_IMPORT_DIRECTIVE, self::GET_NON_CORE_JS_MODULE_ACTION);
}
@@ -202,13 +197,13 @@ class AssetManager extends Singleton
{
$loadedPlugins = array();
- foreach(Manager::getInstance()->getPluginsLoadedAndActivated() as $plugin) {
-
+ foreach (Manager::getInstance()->getPluginsLoadedAndActivated() as $plugin) {
$pluginName = $plugin->getPluginName();
$pluginIsCore = Manager::getInstance()->isPluginBundledWithCore($pluginName);
- if (($pluginIsCore && $core) || (!$pluginIsCore && !$core))
+ if (($pluginIsCore && $core) || (!$pluginIsCore && !$core)) {
$loadedPlugins[] = $pluginName;
+ }
}
return $loadedPlugins;
@@ -222,21 +217,14 @@ class AssetManager extends Singleton
$assetsToRemove = array($this->getMergedStylesheetAsset());
if ($pluginName) {
-
if ($this->pluginContainsJScriptAssets($pluginName)) {
-
if (Manager::getInstance()->isPluginBundledWithCore($pluginName)) {
-
$assetsToRemove[] = $this->getMergedCoreJSAsset();
-
} else {
-
$assetsToRemove[] = $this->getMergedNonCoreJSAsset();
}
}
-
} else {
-
$assetsToRemove[] = $this->getMergedCoreJSAsset();
$assetsToRemove[] = $this->getMergedNonCoreJSAsset();
}
@@ -310,7 +298,6 @@ class AssetManager extends Singleton
$jsIncludeString = '';
foreach ($assetFetcher->getCatalog()->getAssets() as $jsFile) {
-
$jsFile->validateFile();
$jsIncludeString = $jsIncludeString . sprintf(self::JS_IMPORT_DIRECTIVE, $jsFile->getRelativeLocation());
}
@@ -338,7 +325,7 @@ class AssetManager extends Singleton
try {
$assets = $fetcher->getCatalog()->getAssets();
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
// This can happen when a plugin is not valid (eg. Piwik 1.x format)
// When posting the event to the plugin, it returns an exception "Plugin has not been loaded"
return false;
@@ -347,13 +334,13 @@ class AssetManager extends Singleton
$plugin = Manager::getInstance()->getLoadedPlugin($pluginName);
if ($plugin->isTheme()) {
-
$theme = Manager::getInstance()->getTheme($pluginName);
$javaScriptFiles = $theme->getJavaScriptFiles();
- if (!empty($javaScriptFiles))
+ if (!empty($javaScriptFiles)) {
$assets = array_merge($assets, $javaScriptFiles);
+ }
}
return !empty($assets);
@@ -364,7 +351,7 @@ class AssetManager extends Singleton
*/
public function removeAssets($uiAssets)
{
- foreach($uiAssets as $uiAsset) {
+ foreach ($uiAssets as $uiAsset) {
$uiAsset->delete();
}
}