-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Remove extraneous whitespace - #26275 #26285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d9a4bca
Remove extraneous whitespace - #26275
DanielRuf 51f4964
Remove spaces to resolve codestyle warnings
DanielRuf 574f052
Extract some values and helpers
DanielRuf 0edeb06
Shorten lines to resolve codestyle warnings
DanielRuf fb208a8
Fix JavaScript config
DanielRuf c1c363f
Fix indentation
DanielRuf 98e1159
Escape output
DanielRuf 10cc12a
Migrate helper to ViewModel
DanielRuf ff4ead5
Resolve codestyle errors
DanielRuf 535b7c8
Fix class name
DanielRuf 4b86376
Fix codestyle
DanielRuf 3165046
Add lines to resolve codestyle errors
DanielRuf 66a76f3
Fix argument name
DanielRuf ca19b06
Use recommended argument name and magic getter
DanielRuf 60b7f1c
Fix method name
DanielRuf 1eed0f1
Add missing parameter and update DocBlocks
DanielRuf 5958409
Correctly set required street field
DanielRuf 4b9b6fa
Apply review feedback
DanielRuf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Customer\ViewModel; | ||
|
||
use Magento\Directory\Helper\Data as DataHelper; | ||
use Magento\Customer\Helper\Address as AddressHelper; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
use Magento\Framework\View\Element\Block\ArgumentInterface; | ||
|
||
/** | ||
* Custom address view model | ||
*/ | ||
class Address implements ArgumentInterface | ||
{ | ||
/** | ||
* @var DataHelper | ||
*/ | ||
private $helperData; | ||
|
||
/** | ||
* @var AddressHelper | ||
DanielRuf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
private $helperAddress; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param DataHelper $helperData | ||
* @param AddressHelper $helperAddress | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function __construct( | ||
DataHelper $helperData, | ||
AddressHelper $helperAddress | ||
) { | ||
$this->helperData= $helperData; | ||
$this->helperAddress= $helperAddress; | ||
} | ||
|
||
/** | ||
DanielRuf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Get string with frontend validation classes for attribute | ||
* | ||
* @param string $attributeCode | ||
* @return string | ||
DanielRuf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function dataGetAttributeValidationClass($attributeCode) | ||
{ | ||
return $this->helperData->getAttributeValidationClass($attributeCode); | ||
} | ||
|
||
/** | ||
DanielRuf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Get string with frontend validation classes for attribute | ||
* | ||
* @param string $attributeCode | ||
* @return string | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function addressGetAttributeValidationClass($attributeCode) | ||
{ | ||
return $this->helperAddress->getAttributeValidationClass($attributeCode); | ||
} | ||
|
||
/** | ||
* Return Number of Lines in a Street Address for store | ||
* | ||
* @param \Magento\Store\Model\Store|int|string $store | ||
* | ||
* @return int | ||
* @throws NoSuchEntityException | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function addressGetStreetLines() | ||
{ | ||
return $this->helperAddress->getStreetLines(); | ||
} | ||
|
||
/** | ||
* Check if VAT ID address attribute has to be shown on frontend (on Customer Address management forms) | ||
* | ||
* @return boolean | ||
*/ | ||
public function addressIsVatAttributeVisible() | ||
{ | ||
return $this->helperAddress->isVatAttributeVisible(); | ||
} | ||
|
||
/** | ||
* Retrieve regions data json | ||
* | ||
* @return string | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function dataGetRegionJson() | ||
{ | ||
return $this->helperData->getRegionJson(); | ||
} | ||
|
||
/** | ||
* Return ISO2 country codes, which have optional Zip/Postal pre-configured | ||
* | ||
* @param bool $asJson | ||
* @return array|string | ||
*/ | ||
public function dataGetCountriesWithOptionalZip($asJson) | ||
{ | ||
return $this->helperData->getCountriesWithOptionalZip($asJson); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.