Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[Console] Added more semantic commands to detect verbosity #8640

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
4 participants
Member

lyrixx commented Aug 2, 2013

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

@Tobion Tobion and 1 other commented on an outdated diff Aug 2, 2013

src/Symfony/Component/Console/Output/Output.php
@@ -98,6 +98,31 @@ public function getVerbosity()
return $this->verbosity;
}
+ public function isVerbosityQuiet()
+ {
+ return static::VERBOSITY_QUIET === $this->verbosity;
@Tobion

Tobion Aug 2, 2013

Member

why static?

@lyrixx

lyrixx Aug 2, 2013

Member

I used to use static everywhere ;)

@Tobion

Tobion Aug 2, 2013

Member

there should be a use case to use static

@lyrixx

lyrixx Aug 2, 2013

Member

I changed to self, but Why did you said that ? static is slower than self ?

@Tobion

Tobion Aug 2, 2013

Member

The meaning is different you know. Its like private vs protected.

@lyrixx

lyrixx Aug 2, 2013

Member

I thought it was only for LSB. Can you tell me more about this private vs protected ?

@Tobion

Tobion Aug 2, 2013

Member

Yes when using LSB you indirectly expose an extension point (similar to protected methods instead of private). And I don't see why somebody would want to override these constants in subclasses. So there is no need to expose this extension point without use case.

@fabpot fabpot and 2 others commented on an outdated diff Aug 8, 2013

src/Symfony/Component/Console/Output/Output.php
@@ -98,6 +98,31 @@ public function getVerbosity()
return $this->verbosity;
}
+ public function isVerbosityQuiet()
@fabpot

fabpot Aug 8, 2013

Owner

would have named the method a bit differently:

isQuiet(), isVerbose(), isVeryVerbose(), and isDebug(). The only for which there is no easy name is isNormal().

@stof

stof Aug 8, 2013

Member

I'm not sure we need isVerbosityNormal actually. If you want to write something for the normal verbosity, just write it without checking anything as the write() method already handles the quiet mode

@lyrixx

lyrixx Aug 8, 2013

Member

@fabpot I fixed name. And also remove isNormal as it is useless (I agree with @stof)

lyrixx added some commits Aug 2, 2013

@lyrixx lyrixx [Console] Added more semantic commands to detect verbosity
| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a
fcaddf4
@lyrixx lyrixx Updated CHANGELOG about verbosity method in Output 48842ec

@fabpot fabpot closed this in 041b04f Aug 9, 2013

@lyrixx lyrixx deleted the lyrixx:console-verbosity branch Aug 9, 2013

@lancergr lancergr added a commit to lancergr/symfony that referenced this pull request Sep 12, 2013

@lancergr lancergr | Q | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #8640
| License       | MIT
| Doc PR        |
77c2b85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment