@@ -37,6 +37,9 @@ example containing most features described below:
3737 {
3838 const SOME_CONST = 42;
3939
40+ /**
41+ * @var string
42+ */
4043 private $fooBar;
4144
4245 /**
@@ -48,20 +51,30 @@ example containing most features described below:
4851 }
4952
5053 /**
51- * @param string $dummy Some argument description
52- * @param array $options
54+ * Transforms the input given as first argument.
55+ *
56+ * @param bool|string $dummy Some argument description
57+ * @param array $options An options collection to be used within the transformation
5358 *
54- * @return string|null Transformed input
59+ * @return string|null The transformed input
5560 *
56- * @throws \R untimeException
61+ * @throws \R untimeException When an invalid option is provided
5762 */
5863 private function transformText($dummy, array $options = array())
5964 {
65+ $defaultOptions = array(
66+ 'some_default' => 'values',
67+ 'another_default' => 'more values',
68+ );
69+
70+ foreach ($options as $option) {
71+ if (!in_array($option, $defaultOptions)) {
72+ throw new \R untimeException(sprintf('Unrecognized option "%s"', $option));
73+ }
74+ }
75+
6076 $mergedOptions = array_merge(
61- array(
62- 'some_default' => 'values',
63- 'another_default' => 'more values',
64- ),
77+ $defaultOptions,
6578 $options
6679 );
6780
@@ -76,10 +89,16 @@ example containing most features described below:
7689
7790 return ucwords($dummy);
7891 }
79-
80- throw new \R untimeException(sprintf('Unrecognized dummy option "%s"', $dummy));
8192 }
8293
94+ /**
95+ * Performs some basic check for a given value.
96+ *
97+ * @param mixed $value Some value to check against
98+ * @param bool $theSwitch Some switch to control the method's flow
99+ *
100+ * @return bool|null The resultant check if $theSwitch isn't false, null otherwise
101+ */
83102 private function reverseBoolean($value = null, $theSwitch = false)
84103 {
85104 if (!$theSwitch) {
0 commit comments