DomainRegistrationPattern.php in Restrict Domain Registration 8
File
src/DomainRegistrationPattern.php
View source
<?php
namespace Drupal\domain_registration;
use Drupal\Core\Config\ConfigFactoryInterface;
class DomainRegistrationPattern implements DomainRegistrationPatternInterface {
protected $configFactory;
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
public function getPatterns() {
if ($domains = $this->configFactory
->get('domain_registration.settings')
->get('pattern')) {
$domains = explode("\r\n", $domains);
}
return $domains ?: [];
}
}