Need both ends clear ok

{@inheritDoc}
977609
public function clear()/*# : bool */
    {
        $ends = [ $this->front, $this->back ];
        foreach ($ends as $end) {
            if (!$end->clear()) {
                return $this->falseAndSetError(
                    $end->getError(),
                    $end->getErrorCode()
                );
            }
        }
        return $this->trueAndFlushError();
    }
1255592
public function checkEndsWith($value, $end)
    {
        if (!Type::isStringable($value)) {
            return false;
        }

        return Helper::endsWith("$value", $end);
    }
485538
public function persistAndFlush($entities, $clearAfterPush = false)
    {
        if (0 === func_num_args()) {
            throw new \LogicException('Missing arguments');
        }

        $persists = [];
        $entities = func_get_args();
        $clearAfterPush = false;

        foreach ($entities as $entity) {
            if (true === $entity || true === is_string($entity)) {
                $clearAfterPush = $entity;

                continue;
            }

            if (true === is_array($entity)) {
                $persists = array_merge($persists, $entity);
            } else {
                $persists[] = $entity;
            }
        }

        foreach ($persists as $persist) {
            $this->getDoctrineManager()->persist($persist);
        }

        $this->getDoctrineManager()->flush();

        /* Clear after push */
        if (false !== $clearAfterPush) {
            if (true === $clearAfterPush) {
                $this->getDoctrineManager()->clear();

                return $this;
            }

            $this->getDoctrineManager()->clear($clearAfterPush);
        }

        return $this;
    }
1374015
function clear()
    {
        $index['index'] = $this->config->index;
        $index['type'] = $this->config->type;
        $index['body']['query']['bool']['must']= [
            ['match_phrase'=>[ '__meta.sid'=>$this->sid, ]]
        ];
        $this->client->deleteByQuery($index);
    }
924060
function end() {
  var group = stack.pop();
  if (!requests) return;
  var data = JSON.stringify(requests);
  var dest = path.join(options.fixtures, group + '.json');
  fs.writeFileSync(dest, data, 'utf8');
  requests = null;
}
1088410
public function clearDoublettes() {
		/** @var array $x */
		$x = $this->_connection->query('SELECT max(id) as id FROM `' . $this->getTable() . '`
	WHERE completed is NULL
	GROUP BY data
	HAVING COUNT(id) > 1');

		$start = 0;
		$x = array_keys($x);
		$numX = count($x);
		while ($start <= $numX) {
			$this->deleteAll([
				'id' => array_slice($x, $start, 10),
			]);
			$start = $start + 100;
		}
	}
20632
public function clear(): CollectionInterface
    {
        foreach ($this->indexes as $index) {
            $index->clear();
        }

        return parent::clear();
    }
514411
protected function _section_end()
    {
        $last = array_pop($this->_last_section);
        $this->_section_extend($last, ob_get_clean());

        return $last;
    }
749634
public function clear(): void
    {
        if (!$this->overwrite) {
            return;
        }

        if (null === $this->format) {
            $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
        }

        $this->overwrite('');
    }
880880
public static function end(){
		$script = ob_get_clean();
		$widget = parent::end();
		
		if(preg_match("/^\\s*\\<script\\>(.*)\\<\\/script\\>\\s*$/s", $script, $matches)){
			$script = $matches[1];
		}
		
		$widget->view->registerJs($script, $widget->position, $widget->key);
		
	}
1368292
function clear() {
		$Finder = new \FilesystemIterator($this->dirname,
			\FilesystemIterator::KEY_AS_FILENAME
			| \FilesystemIterator::CURRENT_AS_FILEINFO
			| \FilesystemIterator::SKIP_DOTS);
		foreach ( $Finder as $key => $value ) {
			if ( pathinfo($key,PATHINFO_EXTENSION)=='json' ) {
				unlink($value->getRealPath());
			}
		}
	}
219986
private function EndToken( $s = null )
	{
		$this->m_length = is_null( $s )
			? $this->getPosition() - $this->m_anchor
			: strlen( $s );
	}
1077034
public function end(array $options = array())
    {
        if (null === $this->currentBundleOptions) {
            throw new \RuntimeException('end() is called without a start() call.');
        }

        $options = array_merge($this->currentBundleOptions, $options);

        $captured = ob_get_clean();

        if ($options['bypass']) {
            echo $captured;
        } else {
            $this->extractFiles($captured, $options['docroot']);
        }

        $this->currentBundleOptions = null;

        return $this;
    }
622291
protected void end() {
        if ( subSolver != null && subSolver.subSolver == null ) {
            if ( type == OperatorDescrType.AND ) {
                if ( possibilityLists.isEmpty() ) {
                    possibilityLists.add( new HashSet<VerifierComponent>() );
                }

                List<Set<VerifierComponent>> newPossibilities = new ArrayList<Set<VerifierComponent>>();

                List<Set<VerifierComponent>> sets = subSolver.getPossibilityLists();
                for ( Set<VerifierComponent> possibilityList : possibilityLists ) {

                    for ( Set<VerifierComponent> set : sets ) {
                        Set<VerifierComponent> newSet = new HashSet<VerifierComponent>();
                        newSet.addAll( possibilityList );
                        newSet.addAll( set );
                        newPossibilities.add( newSet );
                    }
                }
                possibilityLists = newPossibilities;

            } else if ( type == OperatorDescrType.OR ) {

                possibilityLists.addAll( subSolver.getPossibilityLists() );

            }

            subSolver = null;

        } else if ( subSolver != null && subSolver.subSolver != null ) {

            subSolver.end();
        }

    }
730402
public function clear()
	{
		// Initialize confirm
		$confirm = 'no';

		if (!$this->output->isInteractive() && !$this->arguments->getOpt('f'))
		{
			$this->output->addLine('To forcibly clear all terms of use agreements for all users, please provide the -f flag. This action is irreversable.', 'warning');
			return;
		}
		else if (!$this->output->isInteractive() && $this->arguments->getOpt('f'))
		{
			$confirm = 'yes';
		}
		else if ($this->output->isInteractive())
		{
			// Confirm clearing
			$confirm = $this->output->getResponse('Are you sure you want to clear Terms of Use for all users? This will also require users to agree to new terms with next login? (yes/no)');
		}

		// Did we get a yes?
		if (strtolower($confirm) == 'yes' || strtolower($confirm) == 'y')
		{
			// Get db object
			$dbo = App::get('db');

			// Update registration config value to require re-agreeing upon next login
			$params = \Component::params('com_members');
			$currentTOU = $params->get('registrationTOU', 'RHRH');
			$newTOU     = substr_replace($currentTOU, 'R', 3);
			$params->set('registrationTOU', $newTOU);

			// Update registration param in db
			$query = "UPDATE `#__extensions` SET `params`=" . $dbo->quote($params->toString()) . " WHERE `name`='com_members'";
			$dbo->setQuery($query);
			if (!$dbo->query())
			{
				$this->output->error('Unable to set registration field TOU to required on next update.');
			}

			// Clear all old TOU states
			if ($dbo->tableExists('#__users') && $dbo->tableHasField('#__users', 'usageAgreement'))
			{
				$dbo->setQuery("UPDATE `#__users` SET `usageAgreement`=0;");
				if (!$dbo->query())
				{
					$this->output->error('Unable to clear users terms of use.');
				}
			}

			if ($dbo->tableExists('#__xprofiles') && $dbo->tableHasField('#__xprofiles', 'usageAgreement'))
			{
				$dbo->setQuery("UPDATE `#__xprofiles` SET `usageAgreement`=0;");
				if (!$dbo->query())
				{
					$this->output->error('Unable to clear xprofiles terms of use.');
				}
			}

			// Output message to let admin know everything went well
			$this->output->addLine('Terms of Use successfully cleared & registration param updated!', 'success');
		}
		else
		{
			$this->output->addLine('Operation aborted.');
		}
	}
1093334
public function closeFilterForm() {
		$type = 'get';
		if ($this->_getFlagUsePost()) {
			$type = 'post';
		}

		$this->ExtBs3Form->requestType = $type;
		$result = $this->ExtBs3Form->end();

		return $result;
	}
1108653
function end()
    {
        $data = ob_get_contents();
        ob_end_clean();
        $id = array_pop($this->nestedIds);
        $group = array_pop($this->nestedGroups);
        $this->save($data, $id, $group);
		return $data;
    }