|
238 | 238 | final class CalculatorTest extends \PHPUnit\Framework\TestCase |
239 | 239 | { |
240 | 240 | #[DataProvider('subtractionProvider')] |
241 | | - public function testSubtraction(int $minuend, int $subtrahend, int $result): void |
| 241 | + public function testSubtraction( |
| 242 | + int $minuend, |
| 243 | + int $subtrahend, |
| 244 | + int $result |
| 245 | + ): void |
242 | 246 | { |
243 | | - $this->assertSame($result, Calculator::subtract($minuend, $subtrahend)); |
| 247 | + $this->assertSame( |
| 248 | + $result, |
| 249 | + Calculator::subtract($minuend, $subtrahend) |
| 250 | + ); |
244 | 251 | } |
245 | 252 |
|
246 | 253 | public static function subtractionProvider(): iterable |
@@ -272,9 +279,15 @@ final class CalculatorTest |
272 | 279 | yield [0, $i, ($i * -1)]; |
273 | 280 | } |
274 | 281 | })] |
275 | | - public function testSubtraction(int $minuend, int $subtrahend, int $result) |
| 282 | + public function testSubtraction( |
| 283 | + int $minuend, |
| 284 | + int $subtrahend, |
| 285 | + int $result |
| 286 | + ) |
276 | 287 | { |
277 | | - \assert(Calculator::subtract($minuend, $subtrahend) === $result); |
| 288 | + \assert( |
| 289 | + Calculator::subtract($minuend, $subtrahend) === $result |
| 290 | + ); |
278 | 291 | } |
279 | 292 | } |
280 | 293 | PHP |
@@ -349,56 +362,6 @@ $versions = ['PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5']; |
349 | 362 |
|
350 | 363 | var_dump(array_first($versions)); |
351 | 364 | // string(7) "PHP 8.1" |
352 | | -PHP |
353 | | - ); ?> |
354 | | - </div> |
355 | | - </div> |
356 | | - </div> |
357 | | - </div> |
358 | | - |
359 | | - <div class="php8-compare"> |
360 | | - <h2 class="php8-h2" id="deprecated_traits"> |
361 | | - <?= message('deprecated_traits_title', $lang) ?> |
362 | | - <a class="php8-rfc" href="https://wiki.php.net/rfc/deprecated_traits">RFC</a> |
363 | | - </h2> |
364 | | - <div class="php8-compare__main"> |
365 | | - <div class="php8-compare__block example-contents"> |
366 | | - <div class="php8-compare__label">PHP < 8.5</div> |
367 | | - <div class="php8-code phpcode"> |
368 | | - <?php highlight_php_trimmed( |
369 | | - <<<'PHP' |
370 | | -/** |
371 | | -* @deprecated 8.4 use UsePhpVersion instead |
372 | | -*/ |
373 | | -trait UseVersion |
374 | | -{ |
375 | | - public function getVersion(): string |
376 | | - { |
377 | | - return '8.4'; |
378 | | - } |
379 | | -} |
380 | | -PHP |
381 | | - |
382 | | - ); ?> |
383 | | - </div> |
384 | | - </div> |
385 | | - <div class="php8-compare__arrow"></div> |
386 | | - <div class="php8-compare__block example-contents" style="display: table;"> |
387 | | - <div class="php8-compare__label php8-compare__label_new">PHP 8.5</div> |
388 | | - <div class="php8-code phpcode" style="display: table-cell;"> |
389 | | - <?php highlight_php_trimmed( |
390 | | - <<<'PHP' |
391 | | -#[\Deprecated( |
392 | | - message: "use UsePhpVersion instead", |
393 | | - since: "8.5", |
394 | | -)] |
395 | | -trait UseVersion |
396 | | -{ |
397 | | - public function getVersion(): string |
398 | | - { |
399 | | - return '8.5'; |
400 | | - } |
401 | | -} |
402 | 365 | PHP |
403 | 366 | ); ?> |
404 | 367 | </div> |
|
415 | 378 | <li>Property Promotion is now available for <code>final</code></li> |
416 | 379 | <li>Attributes are now available for constants</li> |
417 | 380 | <li>Attribute <code>#[\Override]</code> now works on properties</li> |
| 381 | + <li>Attribute <code>#[\Deprecated]</code> available for traits</li> |
418 | 382 | <li>Asymmetric Visibility for Static Properties</li> |
419 | 383 | <li>New <code>#[\DelayedTargetValidation]</code> attribute is available</li> |
420 | 384 | <li>New <code>get_error_handler()</code>, <code>get_exception_handler()</code> functions, and <code>Closure::getCurrent</code> method are available.</li> |
|
0 commit comments