@@ -85,55 +85,26 @@ public static function setProtectedProperty($object, $name, $value)
8585 }
8686
8787 /**
88- * Stub for `assertFileNotExists` to allow compatibility with both PHPUnit 8 and 9.
89- *
90- * @param string $filename
91- * @param string $message
92- * @return void
88+ * Stub for `assertFileNotExists`
9389 */
9490 public static function assertFileNotExists (string $ filename , string $ message = '' ): void
9591 {
96- if (method_exists (Assert::class, 'assertFileDoesNotExist ' )) {
97- Assert::assertFileDoesNotExist ($ filename , $ message );
98- return ;
99- }
100-
101- Assert::assertFileNotExists ($ filename , $ message );
92+ Assert::assertFileDoesNotExist ($ filename , $ message );
10293 }
10394
10495 /**
105- * Stub for `assertRegExp` to allow compatibility with both PHPUnit 8 and 9.
106- *
107- * @param string $pattern
108- * @param string $string
109- * @param string $message
110- * @return void
96+ * Stub for `assertRegExp`
11197 */
11298 public static function assertRegExp (string $ pattern , string $ string , string $ message = '' ): void
11399 {
114- if (method_exists (Assert::class, 'assertMatchesRegularExpression ' )) {
115- Assert::assertMatchesRegularExpression ($ pattern , $ string , $ message );
116- return ;
117- }
118-
119- Assert::assertRegExp ($ pattern , $ string , $ message );
100+ Assert::assertMatchesRegularExpression ($ pattern , $ string , $ message );
120101 }
121102
122103 /**
123- * Stub for `assertObjectHasAttribute` to allow compatibility with both PHPUnit 9 and 10.
124- *
125- * @param string $propertyName
126- * @param object $object
127- * @param string $message
128- * @return void
104+ * Stub for `assertObjectHasAttribute`
129105 */
130106 public static function assertObjectHasAttribute (string $ propertyName , $ object , string $ message = '' ): void
131107 {
132- if (method_exists (Assert::class, 'assertObjectHasProperty ' )) {
133- Assert::assertObjectHasProperty ($ propertyName , $ object , $ message );
134- return ;
135- }
136-
137- Assert::assertObjectHasAttribute ($ propertyName , $ object , $ message );
108+ Assert::assertObjectHasProperty ($ propertyName , $ object , $ message );
138109 }
139110}
0 commit comments