Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
66.67% |
2 / 3 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| ProviderPluginBase | |
66.67% |
2 / 3 |
|
66.67% |
2 / 3 |
3.33 | |
0.00% |
0 / 1 |
| isSyncOnLogonSupported | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| revocationSupported | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getHandlers | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Drupal\authorization\Provider; |
| 6 | |
| 7 | use Drupal\authorization\Plugin\ConfigurableAuthorizationPluginBase; |
| 8 | |
| 9 | /** |
| 10 | * Base class for Authorization provider plugins. |
| 11 | */ |
| 12 | abstract class ProviderPluginBase extends ConfigurableAuthorizationPluginBase implements ProviderInterface { |
| 13 | |
| 14 | /** |
| 15 | * Defines the type, for example used by getToken(). |
| 16 | * |
| 17 | * @var string |
| 18 | */ |
| 19 | protected $type = 'provider'; |
| 20 | |
| 21 | /** |
| 22 | * List of modules handling this provider. |
| 23 | * |
| 24 | * Can potentially be removed. |
| 25 | * |
| 26 | * @var array |
| 27 | */ |
| 28 | protected $handlers = []; |
| 29 | |
| 30 | /** |
| 31 | * Whether this provider supports sync on user logon. |
| 32 | * |
| 33 | * @var bool |
| 34 | * Sync on logon supported. |
| 35 | */ |
| 36 | protected $syncOnLogonSupported = FALSE; |
| 37 | |
| 38 | /** |
| 39 | * Whether this provider supports revocation. |
| 40 | * |
| 41 | * @var bool |
| 42 | * Revocation supported. |
| 43 | */ |
| 44 | protected $revocationSupported = FALSE; |
| 45 | |
| 46 | /** |
| 47 | * {@inheritdoc} |
| 48 | */ |
| 49 | public function isSyncOnLogonSupported(): bool { |
| 50 | return $this->syncOnLogonSupported; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * {@inheritdoc} |
| 55 | */ |
| 56 | public function revocationSupported(): bool { |
| 57 | return $this->revocationSupported; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Which modules are handling this provider. |
| 62 | * |
| 63 | * Potentially unused. |
| 64 | * |
| 65 | * @return array |
| 66 | * Handlers. |
| 67 | */ |
| 68 | public function getHandlers(): array { |
| 69 | return $this->handlers; |
| 70 | } |
| 71 | |
| 72 | } |