core icon indicating copy to clipboard operation
core copied to clipboard

PHP 8 named arguments support

Open fadrian06 opened this issue 1 year ago • 4 comments

PHP named arguments helps in some situations for cleaned code, it locks library maintainers to not change the argument names so easily without breaking changes, but php 8 must have support too...

public function test_static_route(): void {
  Flight::request()->url = '/test';

  $route = Flight::route(
    pass_route: true,
    alias: 'testRoute',
    callback: function () {
      echo 'test';
    },
    pattern: '/test'
  );

  self::assertInstanceOf(Route::class, $route);
  self::expectOutputString('test');
  Flight::start();
}

fadrian06 avatar Feb 23 '24 03:02 fadrian06