Skip to content
Snippets Groups Projects

Remove broken and unnecessary constructor

Merged Lara requested to merge fix-constructor-bug into 1.0.x
1 file
+ 1
19
Compare changes
  • Side-by-side
  • Inline
@@ -3,7 +3,6 @@
namespace Drupal\regex_redirect\Form;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\Language;
@@ -19,23 +18,6 @@ use Drupal\regex_redirect\Entity\RegexRedirect;
*/
class RegexRedirectForm extends ContentEntityForm {
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a RegexRedirectForm object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*
@@ -269,7 +251,7 @@ class RegexRedirectForm extends ContentEntityForm {
* The source path.
*/
protected function setBlackListErrors(FormStateInterface $form_state, $source_path) {
$blacklisted_source_paths = $this->configFactory->get('regex_redirect.settings')->get('blacklisted_source_paths');
$blacklisted_source_paths = parent::config('regex_redirect.settings')->get('blacklisted_source_paths');
foreach ($blacklisted_source_paths as $path) {
if (strpos($source_path, ltrim($path, '/')) === 0) {
$form_state->setErrorByName('redirect_redirect', $this->t(
Loading