diff --git a/core/Factory.php b/core/BaseFactory.php similarity index 96% rename from core/Factory.php rename to core/BaseFactory.php index 480f9313c17c80ae035044eb1eb9f7f45ba449f1..e24b6dfc02f337f10b384b64ec4e4b713b7c51c5 100644 --- a/core/Factory.php +++ b/core/BaseFactory.php @@ -20,13 +20,13 @@ use Exception; * Derived classes should override the **getClassNameFromClassId** and **getInvalidClassIdExceptionMessage** * static methods. */ -abstract class Factory +abstract class BaseFactory { /** * Creates a new instance of a class using a string ID. * * @param string $classId The ID of the class. - * @return Factory + * @return BaseFactory * @throws Exception if $classId is invalid. */ public static function factory($classId) diff --git a/core/DataTable/Renderer.php b/core/DataTable/Renderer.php index aea71e4da863ae42bd4f49912db0911cb9e8d8c9..e366cc2ec8534912d4da3da37ef4b0748d1ce96e 100644 --- a/core/DataTable/Renderer.php +++ b/core/DataTable/Renderer.php @@ -12,7 +12,7 @@ use Exception; use Piwik\DataTable; use Piwik\Metrics; use Piwik\Piwik; -use Piwik\Factory; +use Piwik\BaseFactory; /** * A DataTable Renderer can produce an output given a DataTable object. @@ -22,7 +22,7 @@ use Piwik\Factory; * $render->setTable($dataTable); * echo $render; */ -abstract class Renderer extends Factory +abstract class Renderer extends BaseFactory { protected $table; diff --git a/core/ReportRenderer.php b/core/ReportRenderer.php index e6ccc530ed818679f956d8eda91ddccbed0caa17..9cf58448f73163dfd03a04afa963896002d9deba 100644 --- a/core/ReportRenderer.php +++ b/core/ReportRenderer.php @@ -14,13 +14,13 @@ use Piwik\DataTable\Row; use Piwik\DataTable\Simple; use Piwik\DataTable; use Piwik\Plugins\ImageGraph\API; -use Piwik\Factory; +use Piwik\BaseFactory; /** * A Report Renderer produces user friendly renderings of any given Piwik report. * All new Renderers must be copied in ReportRenderer and added to the $availableReportRenderers. */ -abstract class ReportRenderer extends Factory +abstract class ReportRenderer extends BaseFactory { const DEFAULT_REPORT_FONT = 'dejavusans'; const REPORT_TEXT_COLOR = "68,68,68"; diff --git a/plugins/ImageGraph/StaticGraph.php b/plugins/ImageGraph/StaticGraph.php index b23e697dffb8f9941b87e7cddea8499a7e6ef420..d9aeeabe677d7925db7cdb155953296d949c3342 100644 --- a/plugins/ImageGraph/StaticGraph.php +++ b/plugins/ImageGraph/StaticGraph.php @@ -14,7 +14,7 @@ use pData; use pImage; use Piwik\Piwik; use Piwik\SettingsPiwik; -use Piwik\Factory; +use Piwik\BaseFactory; require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pDraw.class.php"; require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pImage.class.php"; @@ -24,7 +24,7 @@ require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pData.class.php"; * The StaticGraph abstract class is used as a base class for different types of static graphs. * */ -abstract class StaticGraph extends Factory +abstract class StaticGraph extends BaseFactory { const GRAPH_TYPE_BASIC_LINE = "evolution"; const GRAPH_TYPE_VERTICAL_BAR = "verticalBar"; diff --git a/plugins/MobileMessaging/SMSProvider.php b/plugins/MobileMessaging/SMSProvider.php index 0019a1ad582084e0a86cd52b2ff669bbfc251b52..c9212971e271fffc87f4cacc6802d4e18cb52432 100644 --- a/plugins/MobileMessaging/SMSProvider.php +++ b/plugins/MobileMessaging/SMSProvider.php @@ -10,13 +10,13 @@ namespace Piwik\Plugins\MobileMessaging; use Exception; use Piwik\Piwik; -use Piwik\Factory; +use Piwik\BaseFactory; /** * The SMSProvider abstract class is used as a base class for SMS provider implementations. * */ -abstract class SMSProvider extends Factory +abstract class SMSProvider extends BaseFactory { const MAX_GSM_CHARS_IN_ONE_UNIQUE_SMS = 160; const MAX_GSM_CHARS_IN_ONE_CONCATENATED_SMS = 153; diff --git a/tests/PHPUnit/Core/FactoryTest.php b/tests/PHPUnit/Core/FactoryTest.php index dfa6cbdb7a6c083abce3611b3b2a2e75910c7525..d85efcc2cecfbb24569a4c284e4726b187396e9c 100644 --- a/tests/PHPUnit/Core/FactoryTest.php +++ b/tests/PHPUnit/Core/FactoryTest.php @@ -6,7 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -use Piwik\Factory; +use Piwik\BaseFactory; /** * @group Core @@ -16,7 +16,7 @@ class FactoryTest extends PHPUnit_Framework_TestCase { public function testCreatingExistingClassSucceeds() { - $instance = Factory::factory("Piwik\\Timer"); + $instance = BaseFactory::factory("Piwik\\Timer"); $this->assertNotNull($instance); $this->assertInstanceOf("Piwik\\Timer", $instance); @@ -28,6 +28,6 @@ class FactoryTest extends PHPUnit_Framework_TestCase */ public function testCreatingInvalidClassThrows() { - Factory::factory("This\\Class\\Does\\Not\\Exist"); + BaseFactory::factory("This\\Class\\Does\\Not\\Exist"); } } \ No newline at end of file