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

[HttpFoundation][DX] MockArraySessionStorage: phpdocs update #22139

Merged
merged 1 commit into from Mar 24, 2017

Conversation

MacDada
Copy link
Contributor

@MacDada MacDada commented Mar 24, 2017

Q A
Branch? 2.7
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

@MacDada MacDada changed the title [HttpFoundation] UX: MockArraySessionStorage: phpdocs update [HttpFoundation] DX: MockArraySessionStorage: phpdocs update Mar 24, 2017
@MacDada MacDada changed the title [HttpFoundation] DX: MockArraySessionStorage: phpdocs update [HttpFoundation][DX] MockArraySessionStorage: phpdocs update Mar 24, 2017
@@ -58,13 +58,11 @@ class MockArraySessionStorage implements SessionStorageInterface
protected $metadataBag;

/**
* @var array
* @var array|SessionBagInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems wrong. It's more like SessionBagInterface[].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess there is no perfect solution. It is an array, so the first type declaration is true. And it can be treated as list of SessionBagInterface, so the other one is also true.

In such cases, I prefer to have both types defined, as both are useful. But I could delete array if you consider it unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, right, nvm, I'm blind ;)

@@ -75,8 +73,6 @@ public function __construct($name = 'MOCKSESSID', MetadataBag $metaBag = null)
}

/**
* Sets the session data.
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

@MacDada MacDada Mar 24, 2017

Choose a reason for hiding this comment

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

As the commit message says:

remove phpdoc title that says nothing more than method name

The title duplicates what's being said in the name of the function. It doesn't add any value to the developer.

Copy link
Member

Choose a reason for hiding this comment

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

But then the @param below can be removed as well... and thousands of other phpdocs. Let's not do that. A good time will be when we can really get rid of the vast majority of current phpdocs (but on all the code base at once). Right now, that would a lot of work that does not beings value and will give the core team a lot of work when merging branches. So, I'm 👎 for these changes.

Copy link
Contributor Author

@MacDada MacDada Mar 24, 2017

Choose a reason for hiding this comment

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

But then the @param below can be removed as well...

Yep, I would remove it.

and thousands of other phpdocs.

Probably, yeah.

A good time will be when we can really get rid of the vast majority of current phpdocs (but on all the code base at once).

I guess, with php7 and scalar typehinting?

I'm 👎 for these changes.

You mean this one change or other changes as well? I can rewrite the PR of course.

Copy link
Member

Choose a reason for hiding this comment

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

I would only keep the @var array|SessionBagInterface[] change, which adds value.

@MacDada MacDada force-pushed the MockArraySessionStorage_phpdocs_update branch from f5631de to 967f7a7 Compare March 24, 2017 14:14
@nicolas-grekas nicolas-grekas added this to the 2.7 milestone Mar 24, 2017
@fabpot
Copy link
Member

fabpot commented Mar 24, 2017

Thank you @MacDada.

@fabpot fabpot merged commit 967f7a7 into symfony:2.7 Mar 24, 2017
fabpot added a commit that referenced this pull request Mar 24, 2017
…date (MacDada)

This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation][DX] MockArraySessionStorage: phpdocs update

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Commits
-------

967f7a7 MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
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.

None yet

5 participants