Clean the cart.

@return bool
761397
public function destroy()
    {
        $cart = $this->getCart();

        $this->event->fire('shopping_cart.destroying', $cart);

        $this->save(null);

        $this->event->fire('shopping_cart.destroyed', $cart);

        return true;
    }
783244
private function cleanPaths()
    {
        $this->output->writeln('');


        if ($this->input->getOption('purge')) {
            $this->output->writeln('<magenta>Purging old cache</magenta>');
            $this->output->writeln('');

            $msg = Cache::purgeJob();
            $this->output->writeln($msg);
        } else {
            $this->output->writeln('<magenta>Clearing cache</magenta>');
            $this->output->writeln('');

            if ($this->input->getOption('all')) {
                $remove = 'all';
            } elseif ($this->input->getOption('assets-only')) {
                $remove = 'assets-only';
            } elseif ($this->input->getOption('images-only')) {
                $remove = 'images-only';
            } elseif ($this->input->getOption('cache-only')) {
                $remove = 'cache-only';
            } elseif ($this->input->getOption('tmp-only')) {
                $remove = 'tmp-only';
            } elseif ($this->input->getOption('invalidate')) {
                $remove = 'invalidate';
            } else {
                $remove = 'standard';
            }

            foreach (Cache::clearCache($remove) as $result) {
                $this->output->writeln($result);
            }
        }
    }
97043
public static function clear()
    {
        $isClearAll = true;
        if ($_COOKIE) {
            foreach ($_COOKIE as $key => $value) {
                $result = self::delete($key);
                if (!$result) {
                    $isClearAll = false;
                }
            }
        }
        return $isClearAll;
    }
944702
public function clean()
    {
        $this->doctype->clean();
        $this->head->clean();
        $this->script->clean();
    }
739481
public function remove()
    {
        $key = $this->request->param('ID');
        $title = "";

        if (!empty($key)) {
            foreach ($this->items as $item) {
                if ($item->Key == $key) {
                    $title = $item->Title;
                    $this->items->remove($item);
                }
            }

            $this->save();
            
            if ($title) {
                $this->setSessionMessage(
                    "bad",
                    _t(
                        "Checkout.RemovedItem",
                        "Removed '{title}' from your cart",
                        "Message to tell user they removed an item",
                        array("title" => $title)
                    )
                );
            }
        }

        return $this->redirectBack();
    }
599099
public function remove()
    {
        $key = $this->request->param('ID');
        $item = null;
        $title = null;

        if (isset($key)) {
            $item = $this
                ->Items()
                ->find("Key", $key);
        }

        if (isset($item)) {
            $title = $item->Title;
            ShoppingCartFactory::create()->removeItem($item);

            $form = $this->CartForm();
            $form->sessionMessage(_t(
                "ShoppingCart.RemovedItem",
                "Removed '{title}' from your cart",
                ["title" => $title]
            ));
        }

        return $this->redirectBack();
    }
1035161
public function clean()
    {
        $dba = $this->dba;
        $key = dba_firstkey($dba);

        while ($key !== false && $key !== null) {
            $this->retrieve($key);
            $key = dba_nextkey($dba);
        }

        return dba_optimize($dba);
    }
741174
public function clear(): bool
    {
        $pattern = $this->path . '/' . $this->prefix . '*' . $this->extension;

        foreach (glob($pattern) as $file) {
            if (!is_dir($file)) {
                if (unlink($file) === false) {
                    return false;
                }
            }
        }

        return true;
    }
488285
public function clean()
    {
        $jobFiles = glob($this->getLocation() . '*.js');
        foreach ($jobFiles as $file) {
            unlink($file);
        }
    }
75728
public function clean() {
		if ( ! $this->enabled ) {
			return false;
		}

		$ttl      = $this->ttl;
		$max_size = $this->max_size;

		// unlink expired files
		if ( $ttl > 0 ) {
			try {
				$expire = new \DateTime();
			} catch ( \Exception $e ) {
				\WP_CLI::error( $e->getMessage() );
			}
			$expire->modify( '-' . $ttl . ' seconds' );

			$finder = $this->get_finder()->date( 'until ' . $expire->format( 'Y-m-d H:i:s' ) );
			foreach ( $finder as $file ) {
				unlink( $file->getRealPath() );
			}
		}

		// unlink older files if max cache size is exceeded
		if ( $max_size > 0 ) {
			$files = array_reverse( iterator_to_array( $this->get_finder()->sortByAccessedTime()->getIterator() ) );
			$total = 0;

			foreach ( $files as $file ) {
				if ( ( $total + $file->getSize() ) <= $max_size ) {
					$total += $file->getSize();
				} else {
					unlink( $file->getRealPath() );
				}
			}
		}

		return true;
	}
1041928
public function clear()
    {
        $patternKey = $this->fixKey('*');
        $list = glob($patternKey);
        foreach ($list as $file) {
            unlink($file);
        }
        return true;
    }
199182
public function trashed()
    {
        $field = $this->getDeleteTimeField();

        if ($field && !empty($this->getOrigin($field))) {
            return true;
        }

        return false;
    }
142603
public function clean()
    {
        foreach ($this->data as $key => $data) {
            if (empty($data)) {
                unset($this->data[$key]);
            }
        }

        return $this;
    }
970299
public function clear(){
		$result = false;
		$path_json = $this->exdb->conf()->path_cache_dir.'/table_definition.json';
		if(is_file($path_json)){
			unlink($path_json);
		}
		$result = !is_file($path_json);
		return $result;
	}
1124160
protected function cleanCache()
    {
        if ($this->cleanCount < 1) {
            ++$this->cleanCount;
            if (is_object($this->phpCache)) {
                $this->phpCache->clean();
            }
        }
    }
532818
public function cleanup()
    {
        ezpEvent::getInstance()->notify( 'session/cleanup', array() );
        $db = eZDB::instance();
        eZSession::triggerCallback( 'cleanup_pre', array( $db ) );
        eZSession::triggerCallback( 'cleanup_post', array( $db ) );
        return true;
    }
66583
public function purge() {
        $this->get_store()->purge();
        if ($this->get_loader()) {
            $this->get_loader()->purge();
        }
        return true;
    }