Skip to content

Commit 99acfee

Browse files
committed
MAGETWO-35090: Implement SalesIncrement module
1 parent 4b529b1 commit 99acfee

File tree

15 files changed

+102
-38
lines changed

15 files changed

+102
-38
lines changed

app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\Customer\Block\Address\Renderer;
77

8-
use Magento\Customer\Model\Address\AbstractAddress;
8+
use Magento\Customer\Model\Address\AddressModelInterface;
99
use Magento\Customer\Model\Address\Mapper;
1010
use Magento\Customer\Model\Metadata\ElementFactory;
1111
use Magento\Framework\View\Element\AbstractBlock;
@@ -112,7 +112,7 @@ public function getFormat(AbstractAddress $address = null)
112112
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
113113
* @SuppressWarnings(PHPMD.NPathComplexity)
114114
*/
115-
public function render(AbstractAddress $address, $format = null)
115+
public function render(AddressModelInterface $address, $format = null)
116116
{
117117
$address = $address->getDataModel(0, 0);
118118
return $this->renderArray($this->addressMapper->toFlatArray($address), $format);

app/code/Magento/Customer/Block/Address/Renderer/RendererInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Customer\Block\Address\Renderer;
77

88
use Magento\Directory\Model\Country\Format;
9+
use Magento\Customer\Model\Address\AddressModelInterface;
910

1011
/**
1112
* Address renderer interface
@@ -32,12 +33,12 @@ public function getType();
3233
/**
3334
* Render address
3435
*
35-
* @param \Magento\Customer\Model\Address\AbstractAddress $address
36+
* @param AddressModelInterface $address
3637
* @param string|null $format
3738
* @return mixed
3839
* @deprecated All new code should use renderArray based on Metadata service
3940
*/
40-
public function render(\Magento\Customer\Model\Address\AbstractAddress $address, $format = null);
41+
public function render(AddressModelInterface $address, $format = null);
4142

4243
/**
4344
* Get a format object for a given address attributes, based on the type set earlier.

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @method bool getShouldIgnoreValidation()
3030
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3131
*/
32-
class AbstractAddress extends AbstractExtensibleModel
32+
class AbstractAddress extends AbstractExtensibleModel implements AddressModelInterface
3333
{
3434
/**
3535
* Possible customer address types
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Customer\Model\Address;
8+
9+
/**
10+
* Interface AddressInterface
11+
*/
12+
interface AddressModelInterface
13+
{
14+
/**
15+
* Get steet line by number
16+
*
17+
* @param int $number
18+
* @return string
19+
*/
20+
public function getStreetLine($number);
21+
22+
/**
23+
* Create fields street1, street2, etc.
24+
*
25+
* To be used in controllers for views data
26+
*
27+
* @return $this
28+
*/
29+
public function explodeStreetAddress();
30+
}

app/code/Magento/Payment/Block/Info.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class Info extends \Magento\Framework\View\Element\Template
2525
/**
2626
* Retrieve info model
2727
*
28-
* @return \Magento\Payment\Model\Info
28+
* @return \Magento\Payment\Model\InfoInterface
2929
* @throws \Magento\Framework\Exception\LocalizedException
3030
*/
3131
public function getInfo()
3232
{
3333
$info = $this->getData('info');
34-
if (!$info instanceof \Magento\Payment\Model\Info) {
34+
if (!$info instanceof \Magento\Payment\Model\InfoInterface) {
3535
throw new \Magento\Framework\Exception\LocalizedException(
3636
__('We cannot retrieve the payment info model object.')
3737
);

app/code/Magento/Payment/Helper/Data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Quote\Model\Quote;
1010
use Magento\Store\Model\Store;
1111
use Magento\Payment\Block\Form;
12-
use Magento\Payment\Model\Info;
12+
use Magento\Payment\Model\InfoInterface;
1313
use Magento\Framework\View\Element\Template;
1414
use Magento\Framework\View\LayoutInterface;
1515
use Magento\Framework\View\LayoutFactory;
@@ -186,7 +186,7 @@ public function getMethodFormBlock(MethodInterface $method, LayoutInterface $lay
186186
* @param \Magento\Framework\View\LayoutInterface $layout
187187
* @return Template
188188
*/
189-
public function getInfoBlock(Info $info, LayoutInterface $layout = null)
189+
public function getInfoBlock(InfoInterface $info, LayoutInterface $layout = null)
190190
{
191191
$layout = $layout ?: $this->_layout;
192192
$blockType = $info->getMethodInstance()->getInfoBlockType();

app/code/Magento/Payment/Model/Info.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* Payment information model
1212
*/
13-
class Info extends AbstractExtensibleModel
13+
class Info extends AbstractExtensibleModel implements InfoInterface
1414
{
1515
/**
1616
* Additional information container
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Payment\Model;
8+
9+
interface InfoInterface
10+
{
11+
/**
12+
* Encrypt data
13+
*
14+
* @param string $data
15+
* @return string
16+
*/
17+
public function encrypt($data);
18+
19+
/**
20+
* Decrypt data
21+
*
22+
* @param string $data
23+
* @return string
24+
*/
25+
public function decrypt($data);
26+
}

app/code/Magento/Payment/Model/Method/AbstractMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ public function getInfoBlockType()
497497
public function getInfoInstance()
498498
{
499499
$instance = $this->getData('info_instance');
500-
if (!$instance instanceof \Magento\Payment\Model\Info) {
500+
if (!$instance instanceof \Magento\Payment\Model\InfoInterface) {
501501
throw new \Magento\Framework\Exception\LocalizedException(__('We cannot retrieve the payment information object instance.'));
502502
}
503503
return $instance;

app/code/Magento/Sales/Model/AbstractModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function _setDataByKey($key, $value)
8484
$this->setId($value);
8585
return;
8686
}
87-
if (isset($this->_data[$key]) && $this->_data[$key] != $value) {
87+
if (isset($this->_data[$key]) && $this->getData($key) != $value) {
8888
$this->rawData[$key] = $value;
8989
return;
9090
} else if (!isset($this->_data[$key])) {

0 commit comments

Comments
 (0)