Replies: 7 comments 4 replies
-
Most important right now: tabs or spaces? how many spaces? possibly different number of spaces for HTML and PHP? Should code in |
Beta Was this translation helpful? Give feedback.
-
I'd say 2 space indentations, like so: <!doctype html>
<html>
<head>
<title>Test</title>
<style>
body {
background-color: #000;
color: #fff;
}
</style>
</head>
<body>
<?php
foreach ($var as $item) {
echo $item;
}
?>
</body>
</html> |
Beta Was this translation helpful? Give feedback.
-
phpcs suggests no parentheses for statements (so |
Beta Was this translation helpful? Give feedback.
-
well require('file.php') looks nicer xD |
Beta Was this translation helpful? Give feedback.
-
Agree with partydragen, for me require() looks nicer RE 7e0e988#diff-59736aecc611cda3c8a10fbb4681b15045c56f8c2a786bd3c154dacdcb03abbb Because HTML can end up with some deep indents, can we keep HTML as 2 space indentations, also indent after |
Beta Was this translation helpful? Give feedback.
-
I would do this for HTML templates that are separated from PHP code, but in this case one file had both and IDEs only support one indentation type per file. It can be done manually if you really want to though. I haven't touched any "real" php / template files yet, I am waiting for party's PR. |
Beta Was this translation helpful? Give feedback.
-
For HTML, use XHTML or HTML syntax? ( |
Beta Was this translation helpful? Give feedback.
-
I'll edit this post with any conclusions drawn in replies.
For HTML:
For php, default phpcs settings with the following differences:
echo("Something")
){
on the same line for classes and functionsTODO: Figure out how to create phpcs.xml configuration file with these settings
How to use on vscode on ubuntu:
Install
phpcs
extension in vscodeFor easy documentation, install the
phpdoc
extension to automatically generate phpdoc comments withctrl
+shift
+i
Beta Was this translation helpful? Give feedback.
All reactions