public static function remove($directory, $container)
	{
		$isSuccess = false; 

		// if $directory and $container are given
		if ($directory !== null && $container !== null) {
			// if $directory is a string
			if (is_string($directory)) {
				// if $container is a string
				if (is_string($container)) {					
					// if the $directory argument is a dir
					if (is_dir($directory)) {
						// if $directory is writable
						if (is_writable($directory)) {
							// if the $directory is in the $container
							if (\Jstewmc\PhpHelpers\Str::startsWith($directory, $container)) {
								// open the directory
								$dir = opendir($directory);
								// read the first entity
								$entity = readdir($dir);
								// loop through the dir's entities
								while ($entity !== false) {
									// if the entity is not the special chars "." and ".."
									if ($entity != '.' && $entity != '..') {
										// if the entity is a sub-directory
										if (is_dir($directory.DIRECTORY_SEPARATOR.$entity)) {
											// clear and delete the sub-directory
											$isSuccess = self::remove(
												$directory.DIRECTORY_SEPARATOR.$entity, 
												$container
											);
										} else {
											// otheriwse, the entity is a file; delete it
											$isSuccess = unlink($directory.DIRECTORY_SEPARATOR.$entity);
										}
										// if an error occurs, stop
										if ( ! $isSuccess) {
											break;
										}
									} else {
										// there was nothing to remove
										// set $isSuccess true in case the directory is empty
										// if it's not empty, $isSuccess will be overwritten anyway
										//
										$isSuccess = true;
									}
									// advance to the next entity
									$entity = readdir($dir);
								}
								// close and remove the directory
								closedir($dir);
								$isSuccess = rmdir($directory.DIRECTORY_SEPARATOR.$entity);
							} else {
								throw new \InvalidArgumentException(
									__METHOD__."() expects parameter two, container, to contain the directory"
								);
							}
						} else {
							throw new \InvalidArgumentException(
								__METHOD__."() expects parameter one, directory, to be a writable directory"
							);
						}
					} else {
						throw new \InvalidArgumentException(
							__METHOD__."() expects parameter one, directory, to be a valid directory"
						);
					}					
				} else {
					throw new \InvalidArgumentException(
						__METHOD__."() expects the second parameter, container, to be a string"
					);
				}
			} else {
				throw new \InvalidArgumentException(
					__METHOD__."() expects the first parameter, directory, to be a string"
				);
			}
		} else {
			throw new \BadMethodCallException(
				__METHOD__."() expects two string parameters, directory and container"
			);
		}

		return $isSuccess;
	}