-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Code style (endif endforeach endfor and more) #1035
Code style (endif endforeach endfor and more) #1035
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After 300 files I'd say: LGTM
Few whitespace only changes, but looks good.
Need to discuss: We should change the review workflow for this kind of PR. Nobody want's to review 800 files manually and it's very time consuming (for me: 2 1/2hours for 300 files => estimated 6-7hours for all files)
@luigifab If you applied the change with a command line tool perhaps you could supply the command used so we could easily reproduce it? |
Sorry, no command used, I search all files, open all files, search/replace string with my text editor, save and commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
509/805 files reviewed
still LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally: LGTW
thx @luigifab for this effort
@luigifab Sorry about the conflicts, can you merge the latest to resolve? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, my bad, I rebased the branch from 1.9.4.x instead of merging it :/
I don't understand why there are xmlconnect files in Files changed tab.
@luigifab Please stop to add more commits here ;) I think it would be better to create separate PR for different Code Style changes. |
See discussion about PHPCSFIXER in #947 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so sorry, I rebased and repushed only endxyz changes to get a diff.
I try to apply the diff but no... so I made a script to do the job: <?php
$todo = [
'<?php endfor; ?>' => '<?php endfor ?>',
'<?php endfor;?>' => '<?php endfor ?>',
'<?php else :?>' => '<?php else: ?>',
'<?php else : ?>' => '<?php else: ?>',
'<?php else:?>' => '<?php else: ?>',
'<?php endforeach; ?>' => '<?php endforeach ?>',
'<?php endforeach;?>' => '<?php endforeach ?>',
'<?php endforeach?>' => '<?php endforeach ?>',
'<?php endif; //' => '<?php endif //',
'<?php //endif; ?>' => '<?php //endif ?>',
'<?php endif; ?>' => '<?php endif ?>',
'<?php endif;?>' => '<?php endif ?>',
'<?php endif?>' => '<?php endif ?>',
];
foreach ($todo as $search => $replace) {
echo $search,"\n";
$files = [];
exec('grep -Hlrn "'.$search.'" app/', $files);
foreach ($files as $file) {
echo ' ',$file,"\n";
file_put_contents($file, str_replace($search, $replace, file_get_contents($file)));
// system(git add app/ ; git commit -m "")
}
} |
@luigifab loving this PR as I really didn't like the old syntax :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the PHP script on the same base commit and the result was slightly different but no material differences so I approve so this can get merged sooner than later. Attached is the diff that was generated.
diff.patch.txt
Once this will be released with a new OM version I recommend a revision of the code looking for some parts unchanged. I will do that too. A script (e.g. PHP, bash) will be useful to change any custom theme by everyone interested. I guess the one provided by @luigifab is just fine. |
What is your opinion about Should it be |
@addison74 you've a great eye, I added "break" as a new PR #1577 |
Co-authored-by: Fabrizio Balliano <fabrizio@fabrizioballiano.com>
Description
This PR updates code style of PHP code (#1027).
For express review, perhaps you can:
Then, open all modified files of base/ directory in your text editor, search and replace (case sensitive) in all files (from bottom to top):
Then,
diff -r -U0 base/ changes/
Contribution checklist