Skip to content

[2.7][Console] Make lineLength protected insted of private #14285

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

Closed
wants to merge 1 commit into from

Conversation

barryvdh
Copy link
Contributor

@barryvdh barryvdh commented Apr 9, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT

This way, it can be more easily extended.

For example, I want to extend the SymfonyStyle (see laravel/framework#8338) with just some tweaks to the Symfony style. But because of the private methods, this isn't as easy to use as I would like. I'd need to access the lineLength to use a different block function.

But perhaps there is a better way?

@Tobion
Copy link
Contributor

Tobion commented Apr 9, 2015

Why not just reimplement the logic. It's 3 lines of code...

@barryvdh
Copy link
Contributor Author

barryvdh commented Apr 9, 2015

Well, I do that now, but I'd rather not duplicate logic if it isn't necessary..

@Tobion
Copy link
Contributor

Tobion commented Apr 9, 2015

But protected means another extension point that needs to be maintained. So I think 3 lines of code is less a problem than one more extension point. So it's not worth to provide an extension point here.

@@ -32,10 +32,11 @@ class SymfonyStyle extends OutputStyle
{
const MAX_LINE_LENGTH = 120;

protected $lineLength;
Copy link
Contributor

Choose a reason for hiding this comment

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

also it would need to be documented

@barryvdh barryvdh changed the title Make lineLength protected insted of private [2.7][Console] Make lineLength protected insted of private Apr 9, 2015
@jakzal
Copy link
Contributor

jakzal commented Apr 15, 2015

👎 for reasons Tobion gave

@barryvdh
Copy link
Contributor Author

Ok

@barryvdh barryvdh closed this Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants