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

fixed phpstan error until level 5 #27

Merged
merged 1 commit into from
Jan 26, 2018
Merged

fixed phpstan error until level 5 #27

merged 1 commit into from
Jan 26, 2018

Conversation

robinlehrmann
Copy link
Contributor

belongs to #26

@@ -532,9 +532,7 @@ protected function prepareTransfers()
}

// remove the checksum
$transfer->setRecipientAddress(
Copy link
Member

Choose a reason for hiding this comment

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

removeChecksum returns a new instance of the address without a checksum.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, you are right. I've fixed it, but I think we should refactor it and don't remove checksum at this point.

@@ -72,7 +72,7 @@ public function setAddresses(array $addresses): self
*/
public function addAddress(Address $address): self
{
$this->addresses[] = $address->removeChecksum();
Copy link
Member

Choose a reason for hiding this comment

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

removeChecksum returns a new instance of the address without a checksum.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See other comment, I prefer to refactor it and put it at an other point of the code.

@Techworker
Copy link
Member

Thanks for that, see my comments related to the removeChecksummethod and the changes you introduced

@@ -72,7 +75,7 @@ public function setAddresses(array $addresses): self
*/
public function addAddress(Address $address): self
{
$this->addresses[] = $address->removeChecksum();
Copy link
Member

Choose a reason for hiding this comment

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

Thats not correct, if someone calls addAddress with an address including the checksum the checksum is not removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Now it's removing it twice when you call setAddresses

Copy link
Member

@Techworker Techworker left a comment

Choose a reason for hiding this comment

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

Looks fine to me, thanks.

@robinlehrmann robinlehrmann merged commit d7db680 into iota-php:master Jan 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants