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

Process output refactor #1118

Merged
merged 1 commit into from Apr 7, 2015
Merged

Process output refactor #1118

merged 1 commit into from Apr 7, 2015

Conversation

SpacePossum
Copy link
Contributor

  • Move process output writer to dedicated class
  • Write process output to STDERR
  • Add colored output to process and legend
  • Move event representation out of the event class itself

* @var array
*/
private static $eventStatusMap = array(
FixerFileProcessedEvent::STATUS_UNKNOWN => array('symbol' => '?', 'format' => '%s', 'description' => 'unknown'),
Copy link
Contributor

Choose a reason for hiding this comment

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

These shouldn't be aligned.

Copy link
Contributor

Choose a reason for hiding this comment

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

Symfony's coding style is to not align arrays.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeh. It was wrong already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok :) I changed it, hope I didn't mess it up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GrahamCampbell is there a fixer for this?

$this->output->write("\n");
}

public function close()
Copy link
Member

Choose a reason for hiding this comment

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

destructor ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, do you me to call it explicit in the FixerCommand?

Copy link
Member

Choose a reason for hiding this comment

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

I see no need for that on the first look. And you?

Copy link
Contributor

Choose a reason for hiding this comment

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

I already suggested that. I assume my comments on this method were lost when the code changed last.

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'll change this, sorry @GrahamCampbell I don know how I made your comments disappear, that shouldn't be possible on github (at least for a mortal like me ;) ) right?

Copy link
Member

Choose a reason for hiding this comment

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

probably one of outdated

@keradus
Copy link
Member

keradus commented Mar 31, 2015

Please fix project itself ;)

}

$symbols[] = $symbol;
$this->output->write(sprintf(' %s-%s,', $symbol, $status['description']));
Copy link
Member

Choose a reason for hiding this comment

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

is this a comma after last element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, will fix

@keradus
Copy link
Member

keradus commented Apr 6, 2015

👍

@keradus keradus added this to the v2.0 milestone Apr 6, 2015
@keradus
Copy link
Member

keradus commented Apr 7, 2015

Thank you @SpacePossum.

@keradus keradus merged commit 2bc83ad into PHP-CS-Fixer:master Apr 7, 2015
keradus added a commit that referenced this pull request Apr 7, 2015
This PR was merged into the 2.0-dev branch.

Discussion
----------

Process output refactor

- Move process output writer to dedicated class
- Write process output to STDERR
- Add colored output to process and legend
- Move event representation out of the event class itself

Commits
-------

2bc83ad Move process outputter to logic to dedicated class, output process to STDERR, add color output to process output
@SpacePossum
Copy link
Contributor Author

Thanks @keradus, nice to see this made it :)

@SpacePossum SpacePossum deleted the Process_output_refactor branch April 9, 2015 09:17
@keradus
Copy link
Member

keradus commented Apr 11, 2015

I am really interesting in that output-classes (xml, json, etc.) @SpacePossum ;)

$this->fixer->setEventDispatcher($this->eventDispatcher);
$this->eventDispatcher->addListener(FixerFileProcessedEvent::NAME, $fileProcessedEventListener);
$progressOutput = new ProcessOutput($this->eventDispatcher);
Copy link
Contributor

Choose a reason for hiding this comment

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

why process in the class name and progress in the variable name ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair point, I'll rename this in a new PR (about the output classes)

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

4 participants