File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class Url implements TrustedCallbackInterface {
13
13
}
14
14
15
15
/**
16
- * @return ($return_as_object ? \Drupal\Core\Access\AccessResultInterface : bool)
16
+ * @return ($return_as_object is true ? \Drupal\Core\Access\AccessResultInterface : bool)
17
17
*/
18
18
public function access(?\Drupal\Core\Session\AccountInterface $account = NULL, bool $return_as_object = FALSE): \Drupal\Core\Access\AccessResultInterface|bool {
19
19
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace DrupalUrl ;
4
4
5
+ use Drupal \Core \Access \AccessResultInterface ;
5
6
use Drupal \Core \Url ;
6
7
use Symfony \Component \HttpFoundation \Request ;
7
8
use function PHPStan \Testing \assertType ;
24
25
assertType ('Drupal\Core\GeneratedUrl ' , Url::fromUri ('the_uri ' )->toString (TRUE ));
25
26
assertType ('Drupal\Core\GeneratedUrl ' , Url::fromUserInput ('user_input ' )->toString (TRUE ));
26
27
assertType ('Drupal\Core\GeneratedUrl ' , Url::createFromRequest (new Request ())->toString (TRUE ));
28
+ assertType ('bool ' , (new Url ('route_name ' ))->access ());
29
+ assertType (AccessResultInterface::class, (new Url ())->access (return_as_object: TRUE ));
30
+ assertType ('bool ' , (new Url ())->access (return_as_object: FALSE ));
You can’t perform that action at this time.
0 commit comments