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

Improve docs in relation to PhpStan failure #10

Merged
merged 4 commits into from
Mar 6, 2018
Merged

Conversation

tomasfejfar
Copy link
Contributor

Fixes #8

@tomasfejfar
Copy link
Contributor Author

What do you think, @jakubbartel?

@tomasfejfar tomasfejfar self-assigned this Mar 5, 2018
@tomasfejfar tomasfejfar requested a review from odinuv March 5, 2018 12:33
@jakubbartel
Copy link
Contributor

Great!

Just for note: when I use php-component as a composer dependency I need to use only the first of ignoreErrors in my project's phpstan.neon, but I hope this will be clear for developers (not to use all of ignored errors from php-component project).


class MyConfigDefinition extends \Keboola\Component\Config\BaseConfigDefinition
{
/**
* @return ArrayNodeDefinition|NodeDefinition
*/
Copy link
Member

Choose a reason for hiding this comment

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

do we need ArrayNodeDefinition here? parameters is also always an object (or should be normalized to), so NodeDefinition should be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that I think about it... is should be always ArrayNodeDefinition. Because the parameters are always array. If it were NodeDefinition, it would fail because children() is does not exist there :(

Copy link
Member

Choose a reason for hiding this comment

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

ok, i always mix the classes, but the point is that only one of them is sufficient

@ondrejhlavacek
Copy link
Member

I also came across this - #10 (comment)

It's easy to fix, no rocket science, but blind copy & paste of phpstan.neon won't work.

@tomasfejfar
Copy link
Contributor Author

tomasfejfar commented Mar 5, 2018

I changed it little bit more. As @odinuv noted, the issue was partly with intersection typehint (which was a reminiscence from earlier version). When I removed it the PhpStan errors are gone. So I replaced the note with a more general note.

@tomasfejfar tomasfejfar requested a review from odinuv March 5, 2018 15:59
@tomasfejfar tomasfejfar merged commit b1c0cef into master Mar 6, 2018
@tomasfejfar tomasfejfar deleted the improve-docs branch March 6, 2018 10:29
@tomasfejfar
Copy link
Contributor Author

Ještě zvažuju, jak to udělat s tagnutím nové verze. Tím, že se to srovnalo a přibyly typehinty, tak to není zpětně kompatibilní. Ale nevím, jestli kvuli tomu hned vydávat novou major verzi. Zatím to používáme stejně jen my a @jakubbartel ne? Ale formálně správně by bylo asi 2.0.0. Co myslíte?

@ondrejhlavacek
Copy link
Member

Klidně novou major verzi.

@tomasfejfar
Copy link
Contributor Author

OK, done.

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

Successfully merging this pull request may close these issues.

None yet

4 participants