-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
3.4.1, 3.5
-
None
-
MOODLE_34_STABLE, MOODLE_35_STABLE
PHP 7.0 onwards support return type declarations which I feel we should encourage in new APIs.
We need to confirm the coding style of these.
Examples:
public static function get_reason() : string {
|
}
|
|
public static function get_reason(): string {
|
}
|
|
public static function get_reason():string {
|
}
|
|
public static function get_reason() :string {
|
}
|
My personal preference is for the first example, which has one space before, and one space after the colon.
- duplicates
-
MDLSITE-5667 Coding style ruling about function/method return types and nullables
-
- Closed
-