PHPPSR-2 supplement-php Tutorial

Source: Internet
Author: User
PHPPSR-2 Supplemental documentation PSR-2 Supplemental Documentation
  • Summary

  • This specification aims to develop a series of standardized PHP code rules to reduce the inconvenience caused by different code styles when browsing code of different authors.

    When multiple programmers cooperate in multiple projects, a common coding specification is required,
    The style norms in this article are derived from the common characteristics of different project code styles,
    Therefore, the value of this specification lies in that we all follow this encoding style, not in itself.

  • Vote

    • Voting site:ML

  • Errata

  • 3.1-multiline parameters)

    Using one or more cross-row parameters (such as arrays and anonymous functions) does not need to trigger the single-row rule about the parameter list in Section 4.6,
    Therefore, arrays and anonymous functions in the parameter table can be separately divided into multiple rows.

    The following example is in line with PSR-2 specifications:

     Get ('/hello/{name}', function ($ name) use ($ app) {return 'hello'. $ app-> escape ($ name );});
    3.2-multiline parameters)

    When you need to expand multiple interfaces, The extends specifications are consistent with the implements specifications in Section 4.1.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.