Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update functionality of code examples#8336

Merged
SenseException merged 1 commit into
doctrine:2.7from
SenseException:test-example
Nov 24, 2020
Merged

Update functionality of code examples#8336
SenseException merged 1 commit into
doctrine:2.7from
SenseException:test-example

Conversation

@SenseException
Copy link
Copy Markdown
Member

No description provided.

greg0ire
greg0ire previously approved these changes Nov 22, 2020
@greg0ire
Copy link
Copy Markdown
Member

We might even want to use type declarations here, WDYT?

@SenseException
Copy link
Copy Markdown
Member Author

@greg0ire I've added types to the methods. Do you think I should add those to properties too? It looks weitd that addEntry has a return type too.

Copy link
Copy Markdown
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

Do you think I should add those to properties too?

Yes, I think we should promote modern code.

Comment thread docs/en/cookbook/aggregate-fields.rst Outdated

namespace Bank\Entities;

use use Doctrine\ORM\Mapping as ORM;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
use use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping as ORM;

Comment thread docs/en/cookbook/aggregate-fields.rst Outdated
class Account
{
public function addEntry($amount)
public function addEntry(int $amount): Entry
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That does look weird, not sure where it comes from.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't see any usage of the return value so I removed it.

@greg0ire
Copy link
Copy Markdown
Member

SenseException requested a review from greg0ire 2 hours ago

What about adding types to properties?

@SenseException
Copy link
Copy Markdown
Member Author

SenseException commented Nov 24, 2020

I can add those too. PHP 7.3 is close to the end of bugfix support and adding property types would have been part of another PR for all docs, but sure: why not start now?

@SenseException SenseException merged commit 011d3c2 into doctrine:2.7 Nov 24, 2020
@SenseException SenseException deleted the test-example branch November 24, 2020 21:39
}

public function getAmount()
public function getAmount(): Amount
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the return value should be int instead of Amount

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.

3 participants