Skip to content

Commit

Permalink
Merge pull request #65 from logeecom/dev
Browse files Browse the repository at this point in the history
Release version 3.3.2
  • Loading branch information
mpramon authored Aug 25, 2021
2 parents 878e31d + 767ab1a commit 2f86301
Show file tree
Hide file tree
Showing 110 changed files with 157 additions and 831 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [3.3.2](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.3.1...v3.3.2) - 2021-08-24
### Changed
- Reverted Shopware code review changes.

## [3.3.1](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.3.0...v3.3.1) - 2021-08-23
**BREAKING CHANGES**
### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Brand/DTO/BrandConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function toArray()
*/
public static function fromArray(array $data)
{
$result = new self();
$result = new static();

$result->platformCode = $data['platform_code'];
$result->shippingServiceSource = $data['shipping_service_source'];
Expand Down
14 changes: 0 additions & 14 deletions src/BusinessLogic/Controllers/DTO/DashboardStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,4 @@ class DashboardStatus extends FrontDto
'isWarehouseSet',
'isOrderStatusMappingsSet',
);

/**
* Creates instance of this class.
*
* @param array $data
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create(array $data)
{
return new self();
}
}
14 changes: 0 additions & 14 deletions src/BusinessLogic/Controllers/DTO/ModuleState.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,4 @@ class ModuleState extends FrontDto
protected static $fields = array(
'state',
);

/**
* Creates instance of this class.
*
* @param array $data
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create(array $data)
{
return new self();
}
}
14 changes: 0 additions & 14 deletions src/BusinessLogic/Controllers/DTO/OnboardingState.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,4 @@ class OnboardingState extends FrontDto
protected static $fields = array(
'state',
);

/**
* Creates instance of this class.
*
* @param array $data
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create(array $data)
{
return new self();
}
}
14 changes: 0 additions & 14 deletions src/BusinessLogic/Controllers/DTO/RegistrationResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,4 @@ class RegistrationResponse extends FrontDto
'termsAndConditionsUrl',
'privacyPolicyUrl',
);

/**
* Creates instance of this class.
*
* @param array $data
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create(array $data)
{
return new self();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function toArray()
*/
public static function fromArray(array $raw)
{
$result = new self();
$result = new static();

$result->id = $raw['id'];
$result->activated = (bool)static::getDataValue($raw, 'activated', false);
Expand Down
14 changes: 0 additions & 14 deletions src/BusinessLogic/Country/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,6 @@ class Country extends FrontDto
'postal_code',
);

/**
* 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.
*
Expand Down
12 changes: 0 additions & 12 deletions src/BusinessLogic/Country/CountryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ class CountryService extends BaseService
*/
protected $brandConfigurationService;

/**
* Creates instance of this class.
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create()
{
return new self();
}

/**
* Returns a list of supported country DTOs.
*
Expand Down
12 changes: 0 additions & 12 deletions src/BusinessLogic/Country/WarehouseCountryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ class WarehouseCountryService extends CountryService
*/
protected static $instance;

/**
* Creates instance of this class.
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create()
{
return new self();
}

/**
* Returns a list of supported country DTOs.
*
Expand Down
4 changes: 3 additions & 1 deletion src/BusinessLogic/DTO/BaseDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ abstract public function toArray();
*/
public static function fromArray(array $raw)
{
return null;
throw new \BadMethodCallException(
'Method "fromArray" not implemented! Given array: ' . print_r($raw, true)
);
}

/**
Expand Down
16 changes: 1 addition & 15 deletions src/BusinessLogic/DTO/FrontDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ abstract class FrontDto extends DataTransferObject
*/
protected static $requiredFields = array();

/**
* Creates instance of this class.
*
* @param array $data
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create(array $data)
{
return null;
}

/**
* Transforms raw array data to its DTO.
*
Expand All @@ -57,7 +43,7 @@ public static function fromArray(array $raw)
{
static::validate($raw);

$result = static::create($raw);
$result = new static();
foreach ($raw as $field => $value) {
if (property_exists(static::CLASS_NAME, $field)) {
$result->$field = $value;
Expand Down
14 changes: 0 additions & 14 deletions src/BusinessLogic/DTO/ValidationError.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,4 @@ class ValidationError extends FrontDto
* @var array
*/
protected static $fields = array('code', 'field', 'message');

/**
* Creates instance of this class.
*
* @param array $data
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create(array $data)
{
return new self();
}
}
4 changes: 2 additions & 2 deletions src/BusinessLogic/Http/DTO/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct($weight = 0.0, $width = 0.0, $height = 0.0, $length
*/
public static function defaultPackage()
{
return new self(1, 10, 10, 10);
return new static(1, 10, 10, 10);
}

/**
Expand All @@ -71,7 +71,7 @@ public static function defaultPackage()
*/
public static function fromArray(array $raw)
{
$instance = new self();
$instance = new static();
$instance->weight = static::getDataValue($raw, 'weight', 0.0);
$instance->length = static::getDataValue($raw, 'length', 0.0);
$instance->height = static::getDataValue($raw, 'height', 0.0);
Expand Down
14 changes: 0 additions & 14 deletions src/BusinessLogic/Http/DTO/ParcelInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ public static function defaultParcel()
);
}

/**
* Creates instance of this class.
*
* @param array $data
*
* @return static
*
* @noinspection PhpDocSignatureInspection
*/
public static function create(array $data)
{
return new self();
}

/**
* Generates validation errors for the payload.
*
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/PostalCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PostalCode extends DataTransferObject
*/
public static function fromArray(array $raw)
{
$instance = new self();
$instance = new static();

$instance->zipcode = !empty($raw['zipcode']) ? $raw['zipcode'] : '';
$instance->city = !empty($raw['city']['name']) ? $raw['city']['name'] : '';
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/PostalZone.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PostalZone extends DataTransferObject
*/
public static function fromArray(array $raw)
{
$instance = new self();
$instance = new static();

$instance->id = static::getDataValue($raw, 'id');
$instance->name = static::getDataValue($raw, 'name');
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function toArray()
*/
public static function fromArray(array $raw)
{
$shipment = new self();
$shipment = new static();
$date = static::getDataValue($raw, 'order_date');
if ($date) {
$shipment->orderDate = \DateTime::createFromFormat('Y-m-d', $date);
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/ShipmentLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct($link, $printed = false, $createTimestamp = 0)
*/
public static function fromArray(array $batchRaw)
{
return new self(
return new static(
static::getDataValue($batchRaw, 'link'),
static::getDataValue($batchRaw, 'printed', false),
static::getDataValue($batchRaw, 'createTime', 0)
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/ShippingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function toArray()
*/
public static function fromArray(array $raw)
{
$instance = new self();
$instance = new static();

$instance->id = (int)self::getDataValue($raw, 'service_id');
$instance->enabled = (bool)self::getDataValue($raw, 'enabled');
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/ShippingServiceDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function toArray()
*/
public static function fromArray(array $raw)
{
$instance = new self();
$instance = new static();

$instance->id = self::getDataValue($raw, 'id');
$instance->carrierName = self::getDataValue($raw, 'carrier_name');
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/ShippingServiceSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function toArray()
*/
public static function fromArray(array $raw)
{
$instance = new self();
$instance = new static();

$instance->serviceId = self::getDataValue($raw, 'service_id', null);
$instance->fromCountry = self::getDataValue($raw, 'from[country]');
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/SystemInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SystemInfo extends DataTransferObject
*/
public static function fromArray(array $raw)
{
$instance = new self();
$instance = new static();

$instance->systemId = !empty($raw['system_id']) ? $raw['system_id'] : null;
$instance->systemName = !empty($raw['system_name']) ? $raw['system_name'] : '';
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/Tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function toArray()
*/
public static function fromArray(array $raw)
{
$tracking = new self();
$tracking = new static();
$tracking->timestamp = static::getDataValue($raw, 'timestamp');
$tracking->description = static::getDataValue($raw, 'description');
$tracking->city = static::getDataValue($raw, 'city');
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Http/DTO/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function toArray()
*/
public static function fromArray(array $raw)
{
$user = new self();
$user = new static();

$user->firstName = static::getDataValue($raw, 'name');
$user->lastName = static::getDataValue($raw, 'surname');
Expand Down
12 changes: 0 additions & 12 deletions src/BusinessLogic/Location/LocationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,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();
}

/**
* Returns array of locations for this shipping method.
*
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/Order/Objects/TrackingHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TrackingHistory
*/
public static function fromArray(array $raw)
{
$result = new self();
$result = new static();
$result->setCity($raw['city']);
$result->setDescription($raw['description']);
$result->setTimestamp($raw['timestamp']);
Expand Down
12 changes: 0 additions & 12 deletions src/BusinessLogic/Order/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,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();
}

/**
* Prepares shipment draft object for order with provided unique identifier.
*
Expand Down
Loading

0 comments on commit 2f86301

Please sign in to comment.