MediaWiki master
BlockPermissionCheckerFactory.php
Go to the documentation of this file.
1<?php
2
22namespace MediaWiki\Block;
23
27
38
39 private ServiceOptions $options;
40 private BlockTargetFactory $blockTargetFactory;
41
42 public function __construct(
43 ServiceOptions $options,
44 BlockTargetFactory $blockTargetFactory
45 ) {
46 $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
47 $this->options = $options;
48 $this->blockTargetFactory = $blockTargetFactory;
49 }
50
59 $target,
60 Authority $performer
61 ) {
62 $checker = $this->newChecker( $performer );
63 if ( $target !== null ) {
64 $checker->setTarget( $target );
65 }
66 return $checker;
67 }
68
73 public function newChecker( Authority $performer ) {
74 return new BlockPermissionChecker(
75 $this->options,
76 $this->blockTargetFactory,
77 $performer
78 );
79 }
80}
__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:37
Interface for objects representing user identity.