The style rules herein are derived from commonalities among the various member projects. When various authors collaborate across multiple projects, it helps to have one set of guidelines to be used among all those projects. Thus, the benefit of this guide is not in the rules themselves, but in the sharing of those rules.

N.b.: Using only spaces, and not mixing spaces with tabs, helps to avoid problems with diffs, patches, history, and annotations. The use of spaces also makes it easy to insert fine-grained sub-indentation for inter-line alignment.

Lists of implementsMAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one interface per line.

Method names MUSTNOT be declared with a space after the method name. The opening brace MUST go on its own line, and the closing brace MUST go on the next line following the body. There MUSTNOT be a space after the opening parenthesis, and there MUSTNOT be a space before the closing parenthesis.

메서드 선언은 다음과 같습니다. 괄호, 쉼표, 스페이스, 중괄호의 배치에 조심해서 사용합니다:

A method declaration looks like the following. Note the placement of parentheses, commas, spaces, and braces:

Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.

4.6. 메서드와 펑션 사용

When making a method or function call, there MUSTNOT be a space between the method or function name and the opening parenthesis, there MUSTNOT be a space after the opening parenthesis, and there MUSTNOT be a space before the closing parenthesis. In the argument list, there MUSTNOT be a space before each comma, and there MUST be one space after each comma.

Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.

<?php$foo->bar($longArgument,$longerArgument,$muchLongerArgument);

5. 제어문

제어문에 대한 일반적인 스타일 규칙은 다음과 같습니다:

The general style rules for control structures are as follows:

[MUST] 제어문 키워드 다음에 스페이스가 하나 있어야 합니다.

There MUST be one space after the control structure keyword

[MUSTNOT] 여는 괄호 뒤에 스페이스가 있어서는 안 됩니다.

There MUSTNOT be a space after the opening parenthesis

[MUSTNOT] 닫는 괄호 앞에 스페이스가 있어서는 안 됩니다.

There MUSTNOT be a space before the closing parenthesis

[MUST] 닫는 괄호와 여는 중괄호 사이에 스페이스가 하나 있어야 합니다.

There MUST be one space between the closing parenthesis and the opening brace

A switch structure looks like the following. Note the placement of parentheses, spaces, and braces. The case statement MUST be indented once from switch, and the break keyword (or other terminating keyword) MUST be indented at the same level as the case body. There MUST be a comment such as // no break when fall-through is intentional in a non-empty case body.

Argument lists and variable lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument or variable per line.

When the ending list (whether of arguments or variables) is split across multiple lines, the closing parenthesis and opening brace MUST be placed together on their own line with one space between them.

다음은 인수 목록이 있거나 없는 클로저의 예와 여러 줄로 표현된 변수 목록에 대한 예제입니다.

The following are examples of closures with and without argument lists and variable lists split across multiple lines.