public function uninstallFiles(): void
	{
		$isDirEmpty = function ($dir) {
			if (!file_exists($dir) || !is_readable($dir)) {
				return false;
			}
			return count(scandir($dir, SCANDIR_SORT_NONE)) === 2;
		};

		if (!$this->isDevelopmentMode()) {
			foreach ($this->INSTALL_PATHS as $path) {
				$files = $this->getRecursiveFiles($path);
				$dirs = $this->getRecursiveDirs($path);

				foreach ($files as $from => $to) {
					unlink($to);
				}

				foreach ($dirs as $dir) {
					if ($isDirEmpty($dir)) {
						if (!rmdir($dir)) {
							throw new FileDeleteException($dir);
						}
					}
				}
			}
		} else {
			foreach ($this->DEV_LINKS as $link => $target) {
				unlink($link);
			}
		}
	}
public function uninstallFiles(): void
	{
		$isDirEmpty = function ($dir) {
			if (!file_exists($dir) || !is_readable($dir)) {
				return false;
			}
			return count(scandir($dir, SCANDIR_SORT_NONE)) === 2;
		};

		if (!$this->isDevelopmentMode()) {
			foreach ($this->INSTALL_PATHS as $path) {
				$files = $this->getRecursiveFiles($path);
				$dirs = $this->getRecursiveDirs($path);

				foreach ($files as $from => $to) {
					unlink($to);
				}

				foreach ($dirs as $dir) {
					if ($isDirEmpty($dir)) {
						if (!rmdir($dir)) {
							throw new FileDeleteException($dir);
						}
					}
				}
			}
		} else {
			foreach ($this->DEV_LINKS as $link => $target) {
				unlink($link);
			}
		}
	}
public function uninstallFiles ( ) : void { $ isDirEmpty = function ( $ dir ) { if ( ! file_exists ( $ dir ) || ! is_readable ( $ dir ) ) { return false ; } return count ( scandir ( $ dir , SCANDIR_SORT_NONE ) ) === 2 ; } ; if ( ! $ this -> isDevelopmentMode ( ) ) { foreach ( $ this -> INSTALL_PATHS as $ path ) { $ files = $ this -> getRecursiveFiles ( $ path ) ; $ dirs = $ this -> getRecursiveDirs ( $ path ) ; foreach ( $ files as $ from => $ to ) { unlink ( $ to ) ; } foreach ( $ dirs as $ dir ) { if ( $ isDirEmpty ( $ dir ) ) { if ( ! rmdir ( $ dir ) ) { throw new FileDeleteException ( $ dir ) ; } } } } } else { foreach ( $ this -> DEV_LINKS as $ link => $ target ) { unlink ( $ link ) ; } } }
Remove files and symlinks created by module

@throws FileDeleteException
Remove files and symlinks created by module