Skip to content
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

Clean code #18124

Merged
merged 9 commits into from
Dec 12, 2018
Merged

Clean code #18124

merged 9 commits into from
Dec 12, 2018

Conversation

hryvinskyi
Copy link
Member

@hryvinskyi hryvinskyi commented Sep 18, 2018

Description

Just modify some code, and make it cleaner

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @hryvinskyi. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

* @return \Magento\Ui\Component\Listing\Columns\ColumnInterface
*/
/**
* @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, remove extra spaces from doc block

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check comment indentation

@@ -26,15 +26,19 @@ public function __construct($entities)
}

/**
* Get
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a comment that describes service method

}

/**
* List
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a comment that describes service method

/**
* Format price by specified website
*
* @param float $price
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, remove extra spaces from doc block

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check comment indentation

*
* @return string 3-digit currency code
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check comment indentation

* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check comment indentation

*
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check comment indentation

*
* @return $this
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check comment indentation

*
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check comment indentation and remove extra spaces

*
* @return \Magento\Framework\DB\Select
* @throws \Magento\Framework\Exception\LocalizedException
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check comment indentation

@hryvinskyi
Copy link
Member Author

@sidolov done

* {@inheritdoc}
* Get data
*
* @return mixed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, revert changes related to @inheritdoc. Replace {@inheritdoc} with @inheritdoc

@@ -508,207 +508,307 @@ public function getVatRequestSuccess()
}

/**
* {@inheritdoc}
* Set Parent ID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, revert changes related to @inheritdoc. Replace {@inheritdoc} with @inheritdoc

@@ -833,7 +833,11 @@ public function getTransactionId()
}

/**
* {@inheritdoc}
* Set Transaction ID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, revert changes related to @inheritdoc. Replace {@inheritdoc} with @inheritdoc

}

/**
* {@inheritdoc}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, revert changes related to @inheritdoc. Replace {@inheritdoc} with @inheritdoc

@sidolov
Copy link
Contributor

sidolov commented Oct 4, 2018

Hi @hryvinskyi , will you continue progress with PR?

@hryvinskyi
Copy link
Member Author

@sidolov done

@@ -133,82 +133,76 @@ public function setConfigData($config)
}

/**
* {@inheritdoc}
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this annotation will cause static test failures because parameters are not used in the method.

*/
public function getFieldMetaInfo($fieldSetName, $fieldName)
{
return [];
}

/**
* {@inheritdoc}
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this annotation will cause static test failures because parameters are not used in the method.

*/
public function getExtensionAttributes()
{
return $this->_getExtensionAttributes();
}

/**
* {@inheritdoc}
*
* @param \Magento\Sales\Api\Data\OrderAddressExtensionInterface $extensionAttributes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't remove type hints for the method because the parent method has annotation with generic interface

*/
public function setIsClosed($isClosed)
{
return $this->setData(TransactionInterface::IS_CLOSED, $isClosed);
}

/**
* {@inheritdoc}
*
* @return \Magento\Sales\Api\Data\TransactionExtensionInterface|null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't remove type hints for the method because the parent method has annotation with generic interface

*/
public function getScopeType()
{
return ScopeInterface::SCOPE_STORE;
}

/**
* {@inheritdoc}
* @since 100.1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, revert back the @SInCE tag

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please return the deleted phpdoc annotations

@@ -992,10 +992,7 @@ public function getExtensionAttributes()
}

/**
* {@inheritdoc}
*
* @param \Magento\Sales\Api\Data\TransactionExtensionInterface $extensionAttributes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the param and return annotation for phpdoc

*/
public function setVatRequestSuccess($vatRequestSuccess)
{
return $this->setData(OrderAddressInterface::VAT_REQUEST_SUCCESS, $vatRequestSuccess);
}

/**
* {@inheritdoc}
*
* @return \Magento\Sales\Api\Data\OrderAddressExtensionInterface|null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the return annotation for phpdoc

@sivaschenko
Copy link
Member

Hi, @hryvinskyi , please resolve the code review notes, fix the Travis build (static tests fails) and resolve the conflicts on your branch, so that we can process your pull request!

@sivaschenko sivaschenko self-assigned this Nov 21, 2018
@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Nov 26, 2018
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-3567 has been created to process this Pull Request

@magento-engcom-team magento-engcom-team merged commit 09c9d74 into magento:2.3-develop Dec 12, 2018
@magento-engcom-team
Copy link
Contributor

Hi @hryvinskyi. Thank you for your contribution.
We will aim to release these changes as part of 2.3.1.
Please check the release notes for final confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants