@@ -135,4 +135,64 @@ public function hasMethod(string $method, string $message = ''): self
135135
136136 return $ this ;
137137 }
138+
139+ /**
140+ * Asserts that a variable is of type float.
141+ *
142+ * This method checks if the actual value is a floating-point number.
143+ *
144+ * Example usage:
145+ * fact(3.14)->isFloat(); // Passes
146+ * fact(42)->isFloat(); // Fails
147+ *
148+ * @param string $message Optional custom error message.
149+ *
150+ * @return self Enables fluent chaining of assertion methods.
151+ */
152+ public function isFloat (string $ message = '' ): self
153+ {
154+ Assert::assertIsFloat ($ this ->variable , $ message );
155+
156+ return $ this ;
157+ }
158+
159+ /**
160+ * Asserts that a variable is of type bool.
161+ *
162+ * This method checks if the actual value is a boolean.
163+ *
164+ * Example usage:
165+ * fact(true)->isBool(); // Passes
166+ * fact(1)->isBool(); // Fails
167+ *
168+ * @param string $message Optional custom error message.
169+ *
170+ * @return self Enables fluent chaining of assertion methods.
171+ */
172+ public function isBool (string $ message = '' ): self
173+ {
174+ Assert::assertIsBool ($ this ->variable , $ message );
175+
176+ return $ this ;
177+ }
178+
179+ /**
180+ * Asserts that a variable is of type array.
181+ *
182+ * This method checks if the actual value is an array.
183+ *
184+ * Example usage:
185+ * fact([1, 2])->isArray(); // Passes
186+ * fact('not array')->isArray(); // Fails
187+ *
188+ * @param string $message Optional custom error message.
189+ *
190+ * @return self Enables fluent chaining of assertion methods.
191+ */
192+ public function isArray (string $ message = '' ): self
193+ {
194+ Assert::assertIsArray ($ this ->variable , $ message );
195+
196+ return $ this ;
197+ }
138198}
0 commit comments