MediaWiki master
BlockPermissionCheckerFactory.php
Go to the documentation of this file.
1<?php
2
8namespace MediaWiki\Block;
9
13
24
25 private ServiceOptions $options;
26 private BlockTargetFactory $blockTargetFactory;
27
28 public function __construct(
29 ServiceOptions $options,
30 BlockTargetFactory $blockTargetFactory
31 ) {
32 $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
33 $this->options = $options;
34 $this->blockTargetFactory = $blockTargetFactory;
35 }
36
45 $target,
46 Authority $performer
47 ) {
48 $checker = $this->newChecker( $performer );
49 if ( $target !== null ) {
50 $checker->setTarget( $target );
51 }
52 return $checker;
53 }
54
59 public function newChecker( Authority $performer ) {
60 return new BlockPermissionChecker(
61 $this->options,
62 $this->blockTargetFactory,
63 $performer
64 );
65 }
66}
__construct(ServiceOptions $options, BlockTargetFactory $blockTargetFactory)
Factory for BlockTarget objects.
A class for passing options to services.
assertRequiredOptions(array $expectedKeys)
Assert that the list of options provided in this instance exactly match $expectedKeys,...
This interface represents the authority associated with the current execution context,...
Definition Authority.php:23
Interface for objects representing user identity.