@@ -50,7 +50,7 @@ public function __construct(array $dataset = [], $length = null)
5050 * @return int
5151 * The number of element
5252 */
53- public function count ()
53+ public function count (): int
5454 {
5555 return count ($ this ->toArray ());
5656 }
@@ -61,7 +61,7 @@ public function count()
6161 * @return mixed[]
6262 * The dataset
6363 */
64- public function getDataset ()
64+ public function getDataset (): array
6565 {
6666 return $ this ->dataset ;
6767 }
@@ -72,7 +72,7 @@ public function getDataset()
7272 * @return int
7373 * The length
7474 */
75- public function getLength ()
75+ public function getLength (): int
7676 {
7777 return (int ) $ this ->length ;
7878 }
@@ -85,7 +85,7 @@ public function getLength()
8585 *
8686 * @return $this
8787 */
88- public function setDataset (array $ dataset = [])
88+ public function setDataset (array $ dataset = []): Combinatorics
8989 {
9090 $ this ->dataset = $ dataset ;
9191
@@ -100,7 +100,7 @@ public function setDataset(array $dataset = [])
100100 *
101101 * @return $this
102102 */
103- public function setLength ($ length = null )
103+ public function setLength ($ length = null ): Combinatorics
104104 {
105105 $ length = $ length ?? $ this ->datasetCount ;
106106 $ this ->length = (abs ($ length ) > $ this ->datasetCount ) ? $ this ->datasetCount : $ length ;
@@ -111,7 +111,7 @@ public function setLength($length = null)
111111 /**
112112 * @return array<int, mixed>
113113 */
114- public function toArray ()
114+ public function toArray (): array
115115 {
116116 return [];
117117 }
@@ -127,7 +127,7 @@ public function toArray()
127127 * @return int
128128 * The factorial of $n
129129 */
130- protected function fact ($ n , $ total = 1 )
130+ protected function fact ($ n , $ total = 1 ): int
131131 {
132132 return (2 > $ n ) ? $ total : $ this ->fact ($ n - 1 , $ total * $ n );
133133 }
0 commit comments