psr-1

Are parentheses required in PSR-2 PHP ternary syntax?

旧巷老猫 提交于 2019-12-21 07:55:56
问题 Question: are parentheses required in PSR-2 PHP ternary syntax? Looking for which (if either) of the following ternary statement's syntax is compliant with PSR-2 - I also need to be pointed to documentation or some authority link: $error = ($error_status) ? 'Error' : 'No Error'; OR $error = $error_status ? 'Error' : 'No Error'; Note: php.net it shows the syntax with the parentheses, but I could not find this in any of the 'official PSR-2' docs. Conclusion If there is no PSR-2 standard on this

Basic Coding Standard for HTML and CSS [closed]

╄→尐↘猪︶ㄣ 提交于 2019-12-09 04:00:35
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I was wondering if their is a Basic Coding Standard for HTML and CSS like PSR-01. I tried googling and searching but didn't find any. 回答1: Have a look at these: Code Guide GitHub StyleGuide Google StyleGuide CSS Tricks StyleGuide SMACSS BEM 回答2: I would suggest looking at

Are parentheses required in PSR-2 PHP ternary syntax?

半城伤御伤魂 提交于 2019-12-04 02:37:25
Question: are parentheses required in PSR-2 PHP ternary syntax? Looking for which (if either) of the following ternary statement's syntax is compliant with PSR-2 - I also need to be pointed to documentation or some authority link: $error = ($error_status) ? 'Error' : 'No Error'; OR $error = $error_status ? 'Error' : 'No Error'; Note: php.net it shows the syntax with the parentheses, but I could not find this in any of the 'official PSR-2' docs. Conclusion If there is no PSR-2 standard on this, which way is the most common convention? The PSR-2 standard specifically omits any opinion on

What is the difference between StudlyCaps and CamelCase?

喜夏-厌秋 提交于 2019-12-03 09:19:24
问题 PSR suggests, method names MUST be declared in camelCase and class names MUST be declared in StudlyCaps. 回答1: StudlyCaps, also known as PascalCase, implies that the first capital of each subword is capitalized. camelCase implies, like a camel, that the humps are in the middle, therefore the first letter is not capitalized. Compare Microsoft's standards for .NET. Other well known capitalization styles are snake_case, where all words are concatenated in lowercase with underscores, and kebab

Basic Coding Standard for HTML and CSS [closed]

て烟熏妆下的殇ゞ 提交于 2019-12-02 13:43:50
I was wondering if their is a Basic Coding Standard for HTML and CSS like PSR-01. I tried googling and searching but didn't find any. Have a look at these: Code Guide GitHub StyleGuide Google StyleGuide CSS Tricks StyleGuide SMACSS BEM I would suggest looking at something like W3C standards. They have code checkers on the site that you can run CSS and HTML through. You can also check SMACSS - https://smacss.com/ it's not official or something but it's very useful architecture for building your websites. There is also methodology called BEM - https://en.bem.info/method/ 来源: https:/