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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-02-16 06:56:54 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-02-16 06:58:03 +0300
commit256da08b84bb4ef3921d8ed62f57387a997b4a0f (patch)
tree11b3027e445d3e0439db58b96472679c25193578
parenteef987343a3048fec68984e6af42f851e8700c2d (diff)
Return null in case a return value is expected (suppresses warning)
-rw-r--r--core/Plugin.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/Plugin.php b/core/Plugin.php
index 7f33591dc9..af564a002b 100644
--- a/core/Plugin.php
+++ b/core/Plugin.php
@@ -328,7 +328,7 @@ class Plugin
$classname = $this->cache->fetch($cacheId);
if (empty($classname)) {
- return; // might by "false" in case has no menu, widget, ...
+ return null; // might by "false" in case has no menu, widget, ...
}
if (file_exists($componentFile)) {
@@ -339,7 +339,7 @@ class Plugin
$this->cache->save($cacheId, false); // prevent from trying to load over and over again for instance if there is no Menu for a plugin
if (!file_exists($componentFile)) {
- return;
+ return null;
}
require_once $componentFile;
@@ -347,13 +347,13 @@ class Plugin
$classname = sprintf('Piwik\\Plugins\\%s\\%s', $this->pluginName, $componentName);
if (!class_exists($classname)) {
- return;
+ return null;
}
if (!empty($expectedSubclass) && !is_subclass_of($classname, $expectedSubclass)) {
Log::warning(sprintf('Cannot use component %s for plugin %s, class %s does not extend %s',
$componentName, $this->pluginName, $classname, $expectedSubclass));
- return;
+ return null;
}
$this->cache->save($cacheId, $classname);