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

Fix centering ascii art #102

Merged
merged 2 commits into from
May 6, 2018
Merged

Fix centering ascii art #102

merged 2 commits into from
May 6, 2018

Conversation

Lynesth
Copy link
Collaborator

@Lynesth Lynesth commented May 5, 2018

Centering ascii art where some lines have trailing spaces are all messed up. This fixes it.
Example of what doesn't work before the fix (select with mouse to see trailing white space):

$art = <<<ART
        _ __ _        
       / |..| \       
       \/ || \/       
        |_''_|        
      PHP SCHOOL      
LEARNING FOR ELEPHANTS
ART;

// What centering actually outputs in a 76 columns width menu:
                               _ __ _                       
                               / |..| \                       
                               \/ || \/                       
                               |_''_|                       
                              PHP SCHOOL                        
                           LEARNING FOR ELEPHANTS                           

Doesn't affect anything else.

@codecov-io
Copy link

codecov-io commented May 5, 2018

Codecov Report

Merging #102 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #102      +/-   ##
============================================
- Coverage     96.68%   96.68%   -0.01%     
  Complexity      293      293              
============================================
  Files            22       22              
  Lines           905      904       -1     
============================================
- Hits            875      874       -1     
  Misses           30       30
Impacted Files Coverage Δ Complexity Δ
src/MenuItem/AsciiArtItem.php 100% <100%> (ø) 14 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc3a2b7...cbad9d2. Read the comment docs.

@AydinHassan
Copy link
Member

Thanks! could you maybe add the example you gave as a unit test ?

@Lynesth
Copy link
Collaborator Author

Lynesth commented May 5, 2018

Done !

@AydinHassan AydinHassan merged commit 5c0b307 into php-school:master May 6, 2018
@AydinHassan AydinHassan added this to the 3.0 milestone May 7, 2018
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.

3 participants