Skip to content

Commit 3227cf2

Browse files
dantleechweaverryan
authored andcommitted
Updated coding standard
Specify using "sprintf" in Exception messages as per @fabpot's recommendation on the mailing list.
1 parent ecea24b commit 3227cf2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

contributing/code/standards.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ example containing most features described below:
7272
} else {
7373
$dummy = ucwords($dummy);
7474
}
75+
} else {
76+
throw new \RuntimeException(sprintf('Unrecognized dummy option "%s"', $dummy));
7577
}
7678

7779
return $dummy;
@@ -100,10 +102,12 @@ Structure
100102

101103
* Declare class properties before methods;
102104

103-
* Declare public methods first, then protected ones and finally private ones.
105+
* Declare public methods first, then protected ones and finally private ones;
104106

105107
* Use parentheses when instantiating classes regardless of the number of
106-
arguments the constructor has.
108+
arguments the constructor has;
109+
110+
* Exception message strings should be concatenated using :phpfunction:`sprintf`.
107111

108112
Naming Conventions
109113
------------------

0 commit comments

Comments
 (0)