\ No newline at end of file
diff --git a/src/BusinessLogic/Resources/templates/pick-shipping-services.html b/src/BusinessLogic/Resources/templates/pick-shipping-services.html
index b762e1e3..98b4ecbc 100644
--- a/src/BusinessLogic/Resources/templates/pick-shipping-services.html
+++ b/src/BusinessLogic/Resources/templates/pick-shipping-services.html
@@ -1,12 +1,12 @@
\ No newline at end of file
diff --git a/src/BusinessLogic/Resources/templates/shipping-services-table.html b/src/BusinessLogic/Resources/templates/shipping-services-table.html
index 699798a7..11e1a17e 100644
--- a/src/BusinessLogic/Resources/templates/shipping-services-table.html
+++ b/src/BusinessLogic/Resources/templates/shipping-services-table.html
@@ -1,25 +1,25 @@
-
+
-
+
{$shippingServices.carrier}
-
+
{$shippingServices.serviceTitle}
-
+
{$shippingServices.transitTime}
-
+
{$shippingServices.type}
-
+
{$shippingServices.origin}
-
+
{$shippingServices.destination}
-
+
diff --git a/src/BusinessLogic/Scheduler/Models/Schedule.php b/src/BusinessLogic/Scheduler/Models/Schedule.php
index 87214233..c36b754f 100644
--- a/src/BusinessLogic/Scheduler/Models/Schedule.php
+++ b/src/BusinessLogic/Scheduler/Models/Schedule.php
@@ -103,20 +103,6 @@ public function __construct(Task $task = null, $queueName = null, $context = '')
$this->context = $context;
}
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* Transforms raw array data to this entity instance.
*
diff --git a/src/BusinessLogic/Scheduler/ScheduleCheckTask.php b/src/BusinessLogic/Scheduler/ScheduleCheckTask.php
index 031de409..3f46c58b 100644
--- a/src/BusinessLogic/Scheduler/ScheduleCheckTask.php
+++ b/src/BusinessLogic/Scheduler/ScheduleCheckTask.php
@@ -36,7 +36,7 @@ class ScheduleCheckTask extends Task
*/
public static function fromArray(array $array)
{
- return new self();
+ return new static();
}
/**
diff --git a/src/BusinessLogic/ShipmentDraft/Models/OrderSendDraftTaskMap.php b/src/BusinessLogic/ShipmentDraft/Models/OrderSendDraftTaskMap.php
index 1291b518..22c782f5 100644
--- a/src/BusinessLogic/ShipmentDraft/Models/OrderSendDraftTaskMap.php
+++ b/src/BusinessLogic/ShipmentDraft/Models/OrderSendDraftTaskMap.php
@@ -40,20 +40,6 @@ class OrderSendDraftTaskMap extends Entity
*/
protected $executionId;
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* @inheritDoc
*/
diff --git a/src/BusinessLogic/ShipmentDraft/Objects/ShipmentDraftStatus.php b/src/BusinessLogic/ShipmentDraft/Objects/ShipmentDraftStatus.php
index e3c97b73..6fd5acef 100644
--- a/src/BusinessLogic/ShipmentDraft/Objects/ShipmentDraftStatus.php
+++ b/src/BusinessLogic/ShipmentDraft/Objects/ShipmentDraftStatus.php
@@ -41,7 +41,7 @@ class ShipmentDraftStatus extends DataTransferObject
*/
public static function fromArray(array $raw)
{
- $me = new self();
+ $me = new static();
$me->status = static::getDataValue($raw, 'status');
$me->message = static::getDataValue($raw, 'message');
diff --git a/src/BusinessLogic/ShipmentDraft/OrderSendDraftTaskMapService.php b/src/BusinessLogic/ShipmentDraft/OrderSendDraftTaskMapService.php
index 9ef0a5ef..84daa291 100644
--- a/src/BusinessLogic/ShipmentDraft/OrderSendDraftTaskMapService.php
+++ b/src/BusinessLogic/ShipmentDraft/OrderSendDraftTaskMapService.php
@@ -45,18 +45,6 @@ public function __construct()
$this->repository = new OrderSendDraftTaskRepository();
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Retrieves Order - SendDraftTask map instance.
*
diff --git a/src/BusinessLogic/ShipmentDraft/ShipmentDraftService.php b/src/BusinessLogic/ShipmentDraft/ShipmentDraftService.php
index 19bdf5e6..82572c34 100644
--- a/src/BusinessLogic/ShipmentDraft/ShipmentDraftService.php
+++ b/src/BusinessLogic/ShipmentDraft/ShipmentDraftService.php
@@ -33,18 +33,6 @@ class ShipmentDraftService extends BaseService
*/
protected static $instance;
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Enqueues the task for creating shipment draft for provided order id.
* Ensures proper mapping between the order and the created task are persisted.
diff --git a/src/BusinessLogic/ShippingMethod/Models/ShippingMethod.php b/src/BusinessLogic/ShippingMethod/Models/ShippingMethod.php
index 016e9197..8b5bdd04 100644
--- a/src/BusinessLogic/ShippingMethod/Models/ShippingMethod.php
+++ b/src/BusinessLogic/ShippingMethod/Models/ShippingMethod.php
@@ -168,20 +168,6 @@ class ShippingMethod extends Entity
*/
public $systemDefaults;
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* Transforms raw array data to this entity instance.
*
diff --git a/src/BusinessLogic/ShippingMethod/Models/ShippingPricePolicy.php b/src/BusinessLogic/ShippingMethod/Models/ShippingPricePolicy.php
index 9a909ddb..480b0898 100644
--- a/src/BusinessLogic/ShippingMethod/Models/ShippingPricePolicy.php
+++ b/src/BusinessLogic/ShippingMethod/Models/ShippingPricePolicy.php
@@ -113,20 +113,6 @@ class ShippingPricePolicy extends FrontDto
'increase',
);
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* Transforms raw array data to this entity instance.
*
diff --git a/src/BusinessLogic/ShippingMethod/Models/ShippingService.php b/src/BusinessLogic/ShippingMethod/Models/ShippingService.php
index 23af356a..0f10c872 100644
--- a/src/BusinessLogic/ShippingMethod/Models/ShippingService.php
+++ b/src/BusinessLogic/ShippingMethod/Models/ShippingService.php
@@ -93,7 +93,7 @@ public function __construct(
*/
public static function fromArray($data)
{
- return new self(
+ return new static(
$data['serviceId'],
$data['serviceName'],
$data['departure'],
@@ -113,7 +113,7 @@ public static function fromArray($data)
*/
public static function fromServiceDetails(ShippingServiceDetails $shippingServiceDetails)
{
- return new self(
+ return new static(
$shippingServiceDetails->id,
$shippingServiceDetails->serviceName,
$shippingServiceDetails->departureCountry,
diff --git a/src/BusinessLogic/ShippingMethod/PackageTransformer.php b/src/BusinessLogic/ShippingMethod/PackageTransformer.php
index b2da6e9a..1f666847 100644
--- a/src/BusinessLogic/ShippingMethod/PackageTransformer.php
+++ b/src/BusinessLogic/ShippingMethod/PackageTransformer.php
@@ -42,18 +42,6 @@ protected function __construct()
$this->configuration = ServiceRegister::getService(Configuration::CLASS_NAME);
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Transforms array of packages into one grouped package.
*
diff --git a/src/BusinessLogic/ShippingMethod/ShippingMethodService.php b/src/BusinessLogic/ShippingMethod/ShippingMethodService.php
index c2928d3e..728688ac 100644
--- a/src/BusinessLogic/ShippingMethod/ShippingMethodService.php
+++ b/src/BusinessLogic/ShippingMethod/ShippingMethodService.php
@@ -59,18 +59,6 @@ protected function __construct()
$this->shippingMethodRepository = $this->getRepository(ShippingMethod::CLASS_NAME);
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Returns all shipping methods for current user.
*
diff --git a/src/BusinessLogic/Tasks/BatchTaskCleanupTask.php b/src/BusinessLogic/Tasks/BatchTaskCleanupTask.php
index 31124391..978ad6d3 100644
--- a/src/BusinessLogic/Tasks/BatchTaskCleanupTask.php
+++ b/src/BusinessLogic/Tasks/BatchTaskCleanupTask.php
@@ -84,7 +84,7 @@ public function toArray()
*/
public static function fromArray(array $array)
{
- return new self($array['taskStatuses'], $array['taskTypes']);
+ return new static($array['taskStatuses'], $array['taskTypes']);
}
/**
diff --git a/src/BusinessLogic/Tasks/GetDefaultParcelAndWarehouseTask.php b/src/BusinessLogic/Tasks/GetDefaultParcelAndWarehouseTask.php
index 987505bb..da69f38f 100644
--- a/src/BusinessLogic/Tasks/GetDefaultParcelAndWarehouseTask.php
+++ b/src/BusinessLogic/Tasks/GetDefaultParcelAndWarehouseTask.php
@@ -22,7 +22,7 @@ class GetDefaultParcelAndWarehouseTask extends Task
*/
public static function fromArray(array $array)
{
- return new self();
+ return new static();
}
/**
diff --git a/src/BusinessLogic/Tasks/SendDraftTask.php b/src/BusinessLogic/Tasks/SendDraftTask.php
index 00b1aa63..89de2557 100644
--- a/src/BusinessLogic/Tasks/SendDraftTask.php
+++ b/src/BusinessLogic/Tasks/SendDraftTask.php
@@ -67,7 +67,7 @@ public function __construct($orderId)
*/
public static function fromArray(array $array)
{
- return new self($array['order_id']);
+ return new static($array['order_id']);
}
/**
diff --git a/src/BusinessLogic/Tasks/TaskCleanupTask.php b/src/BusinessLogic/Tasks/TaskCleanupTask.php
index 5c94e3f1..b472d386 100644
--- a/src/BusinessLogic/Tasks/TaskCleanupTask.php
+++ b/src/BusinessLogic/Tasks/TaskCleanupTask.php
@@ -69,7 +69,7 @@ public function __construct($taskType, array $taskStatuses, $taskAge)
*/
public static function fromArray(array $array)
{
- return new self(
+ return new static(
$array['task_type'],
!empty($array['task_statuses']) ? $array['task_statuses'] : array(),
$array['task_age']
diff --git a/src/BusinessLogic/Tasks/UpdateShipmentDataTask.php b/src/BusinessLogic/Tasks/UpdateShipmentDataTask.php
index 8e191d5b..c050cc11 100644
--- a/src/BusinessLogic/Tasks/UpdateShipmentDataTask.php
+++ b/src/BusinessLogic/Tasks/UpdateShipmentDataTask.php
@@ -88,7 +88,7 @@ public function __construct(array $orderStatuses = array())
*/
public static function fromArray(array $array)
{
- $entity = new self();
+ $entity = new static();
$entity->progress = $array['progress'];
$entity->progressStep = $array['progress_step'];
diff --git a/src/BusinessLogic/Tasks/UpdateShippingServicesTask.php b/src/BusinessLogic/Tasks/UpdateShippingServicesTask.php
index ecc5fc97..5c60bb7e 100644
--- a/src/BusinessLogic/Tasks/UpdateShippingServicesTask.php
+++ b/src/BusinessLogic/Tasks/UpdateShippingServicesTask.php
@@ -37,7 +37,7 @@ class UpdateShippingServicesTask extends Task
*/
public static function fromArray(array $array)
{
- return new self();
+ return new static();
}
/**
diff --git a/src/BusinessLogic/Tax/TaxClass.php b/src/BusinessLogic/Tax/TaxClass.php
index d2e1115b..aff907e4 100644
--- a/src/BusinessLogic/Tax/TaxClass.php
+++ b/src/BusinessLogic/Tax/TaxClass.php
@@ -43,18 +43,4 @@ class TaxClass extends FrontDto
* @var array
*/
protected static $requiredFields = array('label', 'value');
-
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
}
diff --git a/src/BusinessLogic/User/UserAccountService.php b/src/BusinessLogic/User/UserAccountService.php
index 89b34f05..60173890 100644
--- a/src/BusinessLogic/User/UserAccountService.php
+++ b/src/BusinessLogic/User/UserAccountService.php
@@ -56,18 +56,6 @@ class UserAccountService extends BaseService
*/
private $brandConfigurationService;
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Validates provided API key and initializes user's data.
*
diff --git a/src/BusinessLogic/Warehouse/Warehouse.php b/src/BusinessLogic/Warehouse/Warehouse.php
index 15b1b57c..814071a9 100644
--- a/src/BusinessLogic/Warehouse/Warehouse.php
+++ b/src/BusinessLogic/Warehouse/Warehouse.php
@@ -127,20 +127,6 @@ class Warehouse extends FrontDto
'email',
);
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* Transforms raw array data to its DTO.
*
diff --git a/src/BusinessLogic/Warehouse/WarehouseService.php b/src/BusinessLogic/Warehouse/WarehouseService.php
index 67d02da1..cc60bb61 100644
--- a/src/BusinessLogic/Warehouse/WarehouseService.php
+++ b/src/BusinessLogic/Warehouse/WarehouseService.php
@@ -30,18 +30,6 @@ class WarehouseService extends BaseService
*/
protected static $instance;
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Gets a warehouse.
*
diff --git a/src/BusinessLogic/WebHook/WebHookEventHandler.php b/src/BusinessLogic/WebHook/WebHookEventHandler.php
index b3af0c04..e319692b 100644
--- a/src/BusinessLogic/WebHook/WebHookEventHandler.php
+++ b/src/BusinessLogic/WebHook/WebHookEventHandler.php
@@ -38,18 +38,6 @@ class WebHookEventHandler extends BaseService
'shipment.delivered',
);
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Validates input and handles Packlink webhook event.
*
diff --git a/src/DemoUI/src/Services/BusinessLogic/ConfigurationService.php b/src/DemoUI/src/Services/BusinessLogic/ConfigurationService.php
index 940e636e..1c889621 100644
--- a/src/DemoUI/src/Services/BusinessLogic/ConfigurationService.php
+++ b/src/DemoUI/src/Services/BusinessLogic/ConfigurationService.php
@@ -28,18 +28,6 @@ class ConfigurationService extends Configuration
*/
protected static $instance;
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Gets max inactivity period for a task in seconds.
* After inactivity period is passed, system will fail such task as expired.
diff --git a/src/Infrastructure/AutoTest/AutoTestLogger.php b/src/Infrastructure/AutoTest/AutoTestLogger.php
index a2727220..5ead78ed 100644
--- a/src/Infrastructure/AutoTest/AutoTestLogger.php
+++ b/src/Infrastructure/AutoTest/AutoTestLogger.php
@@ -21,18 +21,6 @@ class AutoTestLogger extends Singleton implements ShopLoggerAdapter
*/
protected static $instance;
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Logs a message in system.
*
diff --git a/src/Infrastructure/AutoTest/AutoTestTask.php b/src/Infrastructure/AutoTest/AutoTestTask.php
index 103dc5d2..78a42f19 100644
--- a/src/Infrastructure/AutoTest/AutoTestTask.php
+++ b/src/Infrastructure/AutoTest/AutoTestTask.php
@@ -40,7 +40,7 @@ public function __construct($data)
*/
public static function fromArray(array $array)
{
- return new self($array['data']);
+ return new static($array['data']);
}
/**
diff --git a/src/Infrastructure/Configuration/ConfigEntity.php b/src/Infrastructure/Configuration/ConfigEntity.php
index 27aa5f56..e2c74a5e 100644
--- a/src/Infrastructure/Configuration/ConfigEntity.php
+++ b/src/Infrastructure/Configuration/ConfigEntity.php
@@ -42,20 +42,6 @@ class ConfigEntity extends Entity
*/
protected $fields = array('id', 'name', 'value', 'systemId');
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* Returns entity configuration object.
*
diff --git a/src/Infrastructure/Data/DataTransferObject.php b/src/Infrastructure/Data/DataTransferObject.php
index 4f0819a5..44410ebd 100644
--- a/src/Infrastructure/Data/DataTransferObject.php
+++ b/src/Infrastructure/Data/DataTransferObject.php
@@ -22,7 +22,7 @@ abstract class DataTransferObject
*/
public static function fromArray(array $data)
{
- return null;
+ throw new RuntimeException('Method from array not implemented');
}
/**
diff --git a/src/Infrastructure/Http/CurlHttpClient.php b/src/Infrastructure/Http/CurlHttpClient.php
index cb0fa954..6b2ff3c8 100644
--- a/src/Infrastructure/Http/CurlHttpClient.php
+++ b/src/Infrastructure/Http/CurlHttpClient.php
@@ -89,6 +89,8 @@ protected function sendHttpRequest($method, $url, $headers = array(), $body = ''
* request body is '1' to ensure minimal request data in case of POST, PUT, PATCH methods. This will ensure
* that we have the upload progress and enable the async request termination as soon as the upload is finished
* without waiting for a response (without downloading a body or relaying on a fixed request timeout).
+ *
+ * @return bool|string
*/
protected function sendHttpRequestAsync($method, $url, $headers = array(), $body = '1')
{
@@ -96,7 +98,7 @@ protected function sendHttpRequestAsync($method, $url, $headers = array(), $body
$this->setCurlSessionOptionsForAsynchronousRequest();
$this->setCurlOptions();
- $this->executeAsynchronousRequest();
+ return $this->executeAsynchronousRequest();
}
/**
diff --git a/src/Infrastructure/Http/DTO/Options.php b/src/Infrastructure/Http/DTO/Options.php
index 5aaeae75..89a5131e 100644
--- a/src/Infrastructure/Http/DTO/Options.php
+++ b/src/Infrastructure/Http/DTO/Options.php
@@ -78,6 +78,6 @@ public function toArray()
*/
public static function fromArray(array $raw)
{
- return new self($raw['name'], $raw['value']);
+ return new static($raw['name'], $raw['value']);
}
}
diff --git a/src/Infrastructure/Logger/LogData.php b/src/Infrastructure/Logger/LogData.php
index 57f03a67..bc2985cb 100644
--- a/src/Infrastructure/Logger/LogData.php
+++ b/src/Infrastructure/Logger/LogData.php
@@ -94,20 +94,6 @@ public function __construct(
}
}
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* Returns entity configuration object.
*
diff --git a/src/Infrastructure/Logger/Logger.php b/src/Infrastructure/Logger/Logger.php
index 5b9b1d23..a18c25ff 100644
--- a/src/Infrastructure/Logger/Logger.php
+++ b/src/Infrastructure/Logger/Logger.php
@@ -61,18 +61,6 @@ protected function __construct()
$this->timeProvider = ServiceRegister::getService(TimeProvider::CLASS_NAME);
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Logs error message.
*
diff --git a/src/Infrastructure/Logger/LoggerConfiguration.php b/src/Infrastructure/Logger/LoggerConfiguration.php
index 8196a084..5a687c77 100644
--- a/src/Infrastructure/Logger/LoggerConfiguration.php
+++ b/src/Infrastructure/Logger/LoggerConfiguration.php
@@ -52,18 +52,6 @@ class LoggerConfiguration extends Singleton
*/
private $integrationName;
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Set default logger status (turning on/off).
*
diff --git a/src/Infrastructure/ORM/Entity.php b/src/Infrastructure/ORM/Entity.php
index 9eb09294..cc11d5b8 100644
--- a/src/Infrastructure/ORM/Entity.php
+++ b/src/Infrastructure/ORM/Entity.php
@@ -30,20 +30,6 @@ abstract class Entity extends DataTransferObject
*/
protected $fields = array('id');
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return null;
- }
-
/**
* Returns full class name.
*
@@ -63,7 +49,7 @@ public static function getClassName()
*/
public static function fromArray(array $data)
{
- $instance = static::create($data);
+ $instance = new static();
$instance->inflate($data);
return $instance;
diff --git a/src/Infrastructure/Singleton.php b/src/Infrastructure/Singleton.php
index ec0bb3a8..929c3b75 100644
--- a/src/Infrastructure/Singleton.php
+++ b/src/Infrastructure/Singleton.php
@@ -2,8 +2,6 @@
namespace Logeecom\Infrastructure;
-use RuntimeException;
-
/**
* Base class for all singleton implementations.
* Every class that extends this class MUST have its own protected static field $instance!
@@ -12,13 +10,6 @@
*/
abstract class Singleton
{
- /**
- * Singleton instance of this class.
- *
- * @var static
- */
- protected static $instance;
-
/**
* Hidden constructor.
*/
@@ -34,28 +25,16 @@ protected function __construct()
public static function getInstance()
{
if (static::$instance === null) {
- static::$instance = static::create();
+ static::$instance = new static();
}
if (!(static::$instance instanceof static)) {
- throw new RuntimeException('Wrong static instance of a singleton class.');
+ throw new \RuntimeException('Wrong static instance of a singleton class.');
}
return static::$instance;
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return null;
- }
-
/**
* Resets singleton instance. Required for proper tests.
*/
diff --git a/src/Infrastructure/TaskExecution/AsyncProcessStarterService.php b/src/Infrastructure/TaskExecution/AsyncProcessStarterService.php
index 67a74f84..36da14b9 100644
--- a/src/Infrastructure/TaskExecution/AsyncProcessStarterService.php
+++ b/src/Infrastructure/TaskExecution/AsyncProcessStarterService.php
@@ -68,18 +68,6 @@ protected function __construct()
$this->processRepository = RepositoryRegistry::getRepository(Process::CLASS_NAME);
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Starts given runner asynchronously (in new process/web request or similar).
*
diff --git a/src/Infrastructure/TaskExecution/CompositeTask.php b/src/Infrastructure/TaskExecution/CompositeTask.php
index c27d4c06..46b264eb 100644
--- a/src/Infrastructure/TaskExecution/CompositeTask.php
+++ b/src/Infrastructure/TaskExecution/CompositeTask.php
@@ -62,19 +62,6 @@ public function __construct(array $subTasks, $initialProgress = 0)
}
}
- /**
- * Creates instance of this class.
- *
- * @param array $subTasks
- * @param $initialProgress
- *
- * @return CompositeTask
- */
- public static function create(array $subTasks, $initialProgress)
- {
- return null;
- }
-
/**
* Transforms array into an serializable object,
*
@@ -91,7 +78,7 @@ public static function fromArray(array $array)
$tasks[] = Serializer::unserialize($task);
}
- $entity = static::create($tasks, $array['initial_progress']);
+ $entity = new static($tasks, $array['initial_progress']);
$entity->taskProgressMap = $array['task_progress_map'];
$entity->tasksProgressShare = $array['tasks_progress_share'];
diff --git a/src/Infrastructure/TaskExecution/Process.php b/src/Infrastructure/TaskExecution/Process.php
index 0cdfd8b3..f84be06c 100644
--- a/src/Infrastructure/TaskExecution/Process.php
+++ b/src/Infrastructure/TaskExecution/Process.php
@@ -31,20 +31,6 @@ class Process extends Entity
*/
protected $runner;
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* Sets raw array data to this entity instance properties.
*
diff --git a/src/Infrastructure/TaskExecution/QueueItem.php b/src/Infrastructure/TaskExecution/QueueItem.php
index 800bb1cc..8e0b4297 100644
--- a/src/Infrastructure/TaskExecution/QueueItem.php
+++ b/src/Infrastructure/TaskExecution/QueueItem.php
@@ -184,20 +184,6 @@ class QueueItem extends Entity
*/
private $timeProvider;
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
-
/**
* QueueItem constructor.
*
diff --git a/src/Infrastructure/TaskExecution/QueueItemStarter.php b/src/Infrastructure/TaskExecution/QueueItemStarter.php
index 402f70c3..b856e299 100644
--- a/src/Infrastructure/TaskExecution/QueueItemStarter.php
+++ b/src/Infrastructure/TaskExecution/QueueItemStarter.php
@@ -54,7 +54,7 @@ public function __construct($queueItemId)
*/
public static function fromArray(array $array)
{
- return new self($array['queue_item_id']);
+ return new static($array['queue_item_id']);
}
/**
diff --git a/src/Infrastructure/TaskExecution/TaskRunnerStarter.php b/src/Infrastructure/TaskExecution/TaskRunnerStarter.php
index 3c78ae13..563c2ec2 100644
--- a/src/Infrastructure/TaskExecution/TaskRunnerStarter.php
+++ b/src/Infrastructure/TaskExecution/TaskRunnerStarter.php
@@ -65,7 +65,7 @@ public function __construct($guid)
*/
public static function fromArray(array $array)
{
- return new self($array['guid']);
+ return new static($array['guid']);
}
/**
diff --git a/src/Infrastructure/Utility/Events/EventBus.php b/src/Infrastructure/Utility/Events/EventBus.php
index 25c49df5..74a71f64 100644
--- a/src/Infrastructure/Utility/Events/EventBus.php
+++ b/src/Infrastructure/Utility/Events/EventBus.php
@@ -34,7 +34,7 @@ private function __construct()
public static function getInstance()
{
if (static::$instance === null) {
- static::$instance = new self();
+ static::$instance = new static();
}
return static::$instance;
diff --git a/src/Infrastructure/Utility/GuidProvider.php b/src/Infrastructure/Utility/GuidProvider.php
index a36c82b6..94a76c1e 100644
--- a/src/Infrastructure/Utility/GuidProvider.php
+++ b/src/Infrastructure/Utility/GuidProvider.php
@@ -36,7 +36,7 @@ private function __construct()
public static function getInstance()
{
if (static::$instance === null) {
- static::$instance = new self();
+ static::$instance = new static();
}
return static::$instance;
diff --git a/src/Infrastructure/Utility/TimeProvider.php b/src/Infrastructure/Utility/TimeProvider.php
index 14e7d225..518edc33 100644
--- a/src/Infrastructure/Utility/TimeProvider.php
+++ b/src/Infrastructure/Utility/TimeProvider.php
@@ -37,7 +37,7 @@ private function __construct()
public static function getInstance()
{
if (static::$instance === null) {
- static::$instance = new self();
+ static::$instance = new static();
}
return static::$instance;
@@ -96,7 +96,7 @@ public function getMicroTimestamp()
*/
public function sleep($sleepTime)
{
- usleep($sleepTime * 1000);
+ sleep($sleepTime);
}
/**
diff --git a/tests/BusinessLogic/Common/TestComponents/Dto/EmptyFrontDto.php b/tests/BusinessLogic/Common/TestComponents/Dto/EmptyFrontDto.php
index d3bf2ba8..e700e38c 100644
--- a/tests/BusinessLogic/Common/TestComponents/Dto/EmptyFrontDto.php
+++ b/tests/BusinessLogic/Common/TestComponents/Dto/EmptyFrontDto.php
@@ -11,17 +11,4 @@
*/
class EmptyFrontDto extends FrontDto
{
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
}
diff --git a/tests/BusinessLogic/Common/TestComponents/Dto/FooDto.php b/tests/BusinessLogic/Common/TestComponents/Dto/FooDto.php
index e87cfafa..0a8d0242 100644
--- a/tests/BusinessLogic/Common/TestComponents/Dto/FooDto.php
+++ b/tests/BusinessLogic/Common/TestComponents/Dto/FooDto.php
@@ -35,18 +35,4 @@ class FooDto extends FrontDto
* @var array
*/
protected static $requiredFields = array('foo', 'bar');
-
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
}
diff --git a/tests/BusinessLogic/Common/TestComponents/Dto/TestCountry.php b/tests/BusinessLogic/Common/TestComponents/Dto/TestCountry.php
index 680cc3ae..2e1fd90d 100644
--- a/tests/BusinessLogic/Common/TestComponents/Dto/TestCountry.php
+++ b/tests/BusinessLogic/Common/TestComponents/Dto/TestCountry.php
@@ -22,18 +22,4 @@ public function __construct()
$this->code = 'MU';
$this->postalCode = '42602';
}
-
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
}
diff --git a/tests/BusinessLogic/Common/TestComponents/Dto/TestWarehouse.php b/tests/BusinessLogic/Common/TestComponents/Dto/TestWarehouse.php
index 776fef63..c8fc03a5 100644
--- a/tests/BusinessLogic/Common/TestComponents/Dto/TestWarehouse.php
+++ b/tests/BusinessLogic/Common/TestComponents/Dto/TestWarehouse.php
@@ -28,18 +28,4 @@ public function __construct()
$this->email = 'default@default.com';
$this->default = true;
}
-
- /**
- * Creates instance of this class.
- *
- * @param array $data
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create(array $data)
- {
- return new self();
- }
}
diff --git a/tests/BusinessLogic/Common/TestComponents/Locations/MockLocationService.php b/tests/BusinessLogic/Common/TestComponents/Locations/MockLocationService.php
index 46c1a759..84243d04 100644
--- a/tests/BusinessLogic/Common/TestComponents/Locations/MockLocationService.php
+++ b/tests/BusinessLogic/Common/TestComponents/Locations/MockLocationService.php
@@ -13,18 +13,6 @@ class MockLocationService extends LocationService
public $callHistory = array();
public $searchLocationsResult = array();
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
public function searchLocations($country, $query)
{
$this->callHistory[] = array('searchLocations' => array($country, $query));
diff --git a/tests/BusinessLogic/Common/TestComponents/Registration/MockCountryService.php b/tests/BusinessLogic/Common/TestComponents/Registration/MockCountryService.php
index 93dbb34c..feb7427e 100644
--- a/tests/BusinessLogic/Common/TestComponents/Registration/MockCountryService.php
+++ b/tests/BusinessLogic/Common/TestComponents/Registration/MockCountryService.php
@@ -11,18 +11,6 @@ class MockCountryService extends CountryService
public $callHistory = array();
public static $supportedCountries = array();
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
public function getSupportedCountries($associative = true)
{
$this->callHistory[] = array('getSupportedCountries' => array($associative));
diff --git a/tests/BusinessLogic/Common/TestComponents/TestShopConfiguration.php b/tests/BusinessLogic/Common/TestComponents/TestShopConfiguration.php
index 9b2ffb6b..73a2374c 100644
--- a/tests/BusinessLogic/Common/TestComponents/TestShopConfiguration.php
+++ b/tests/BusinessLogic/Common/TestComponents/TestShopConfiguration.php
@@ -22,18 +22,6 @@ public function __construct()
static::$instance = $this;
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Returns current system identifier.
*
diff --git a/tests/BusinessLogic/Common/TestComponents/Warehouse/MockWarehouseService.php b/tests/BusinessLogic/Common/TestComponents/Warehouse/MockWarehouseService.php
index b1c5d91e..c8f39b61 100644
--- a/tests/BusinessLogic/Common/TestComponents/Warehouse/MockWarehouseService.php
+++ b/tests/BusinessLogic/Common/TestComponents/Warehouse/MockWarehouseService.php
@@ -19,18 +19,6 @@ public function getWarehouse($createIfNotExist = true)
return $this->getWarehouseResult;
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
public function updateWarehouseData(array $payload)
{
$this->callHistory[] = array('updateWarehouseData' => array($payload));
diff --git a/tests/BusinessLogic/Dto/BaseDtoTest.php b/tests/BusinessLogic/Dto/BaseDtoTest.php
index 735ae926..363e35ba 100644
--- a/tests/BusinessLogic/Dto/BaseDtoTest.php
+++ b/tests/BusinessLogic/Dto/BaseDtoTest.php
@@ -31,10 +31,11 @@ protected function tearDown()
TestFrontDtoFactory::reset();
}
+ /**
+ * @expectedException \RuntimeException
+ */
public function testFromArrayNotImplemented()
{
- $dto = Address::fromArray(array());
-
- self::assertNull($dto);
+ Address::fromArray(array());
}
}
diff --git a/tests/Infrastructure/Common/TestComponents/TestShopConfiguration.php b/tests/Infrastructure/Common/TestComponents/TestShopConfiguration.php
index 3b50d8a8..7be8581f 100644
--- a/tests/Infrastructure/Common/TestComponents/TestShopConfiguration.php
+++ b/tests/Infrastructure/Common/TestComponents/TestShopConfiguration.php
@@ -23,18 +23,6 @@ public function __construct()
static::$instance = $this;
}
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
-
/**
* Returns current system identifier.
*
diff --git a/tests/Infrastructure/Common/TestComponents/Utility/TestGuidProvider.php b/tests/Infrastructure/Common/TestComponents/Utility/TestGuidProvider.php
index 792ebb6b..1c6b6ee4 100644
--- a/tests/Infrastructure/Common/TestComponents/Utility/TestGuidProvider.php
+++ b/tests/Infrastructure/Common/TestComponents/Utility/TestGuidProvider.php
@@ -8,24 +8,6 @@ class TestGuidProvider extends GuidProvider
{
private $guid = '';
- private function __construct()
- {
- }
-
- /**
- * Returns singleton instance of GuidProvider.
- *
- * @return GuidProvider Instance of GuidProvider class.
- */
- public static function getInstance()
- {
- if (static::$instance === null) {
- static::$instance = new self();
- }
-
- return static::$instance;
- }
-
public function generateGuid()
{
if (empty($this->guid)) {
diff --git a/tests/Infrastructure/Singleton/TestAutoTestLogger.php b/tests/Infrastructure/Singleton/TestAutoTestLogger.php
index 3598a04a..f659a781 100644
--- a/tests/Infrastructure/Singleton/TestAutoTestLogger.php
+++ b/tests/Infrastructure/Singleton/TestAutoTestLogger.php
@@ -11,15 +11,4 @@
*/
class TestAutoTestLogger extends AutoTestLogger
{
- /**
- * Creates instance of this class.
- *
- * @return static
- *
- * @noinspection PhpDocSignatureInspection
- */
- public static function create()
- {
- return new self();
- }
}
\ No newline at end of file