From ba123084645d1d80cd8efd3bd0a7f1668f1cbc25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=CC=81bor=20Hojtsy?= <gabor@hojtsy.hu>
Date: Wed, 3 Apr 2024 19:34:50 +0200
Subject: [PATCH] =?UTF-8?q?Issue=20#3016061=20by=20Anybody,=20tarunyaduvan?=
 =?UTF-8?q?shi,=20hass,=20apaderno,=20G=C3=A1bor=20Hojtsy,=20GNUMatrix,=20?=
 =?UTF-8?q?saurabh.rocksoul,=20Joshua=5FLim,=20finaukaufusi,=20makbul=5Fkh?=
 =?UTF-8?q?an8:=20Text=20format=20with=20system=20name=20"php=5Fcode"=20is?=
 =?UTF-8?q?=20deleted=20when=20you=20view=20admin/modules/uninstall?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 php.services.yml              |  7 -------
 src/PhpUninstallValidator.php | 34 ----------------------------------
 2 files changed, 41 deletions(-)
 delete mode 100644 php.services.yml
 delete mode 100644 src/PhpUninstallValidator.php

diff --git a/php.services.yml b/php.services.yml
deleted file mode 100644
index fb998b5..0000000
--- a/php.services.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-services:
-  filter.uninstall_validator:
-    class: Drupal\php\PhpUninstallValidator
-    tags:
-      - { name: module_install.uninstall_validator }
-    arguments: ['@plugin.manager.filter', '@entity_type.manager', '@string_translation']
-    lazy: false
diff --git a/src/PhpUninstallValidator.php b/src/PhpUninstallValidator.php
deleted file mode 100644
index 87bbf3f..0000000
--- a/src/PhpUninstallValidator.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-namespace Drupal\php;
-
-use Drupal\filter\FilterUninstallValidator;
-
-/**
- * Remove filter preventing Php uninstall.
- */
-class PhpUninstallValidator extends FilterUninstallValidator {
-
-  /**
-   * {@inheritdoc}
-   */
-  public function validate($module) {
-    $reasons = [];
-    if ($module == 'php') {
-      $this->removeFilterConfig();
-    }
-    return $reasons;
-  }
-
-  /**
-   * Deletes configuration.
-   */
-  protected function removeFilterConfig() {
-    $php_filter = \Drupal::configFactory()->getEditable('filter.format.php_code');
-    $php_filter->delete();
-
-    // Clear cache.
-    drupal_flush_all_caches();
-  }
-
-}
-- 
GitLab