Remove the all the require and optional keys from the $initParams
parameter.

@param  array
@return array
343745
protected function _removeKnownKeys(array $initParams)
    {
        foreach (['core_helper', 'order_helper'] as $key) {
            if (isset($initParams[$key])) {
                unset($initParams[$key]);
            }
        }
        return $initParams;
    }
130495
public function initIndexes()
    {
        // read index definition from collection options
        // if not specified - use defined in property
        $indexDefinition = $this->definition->getOption('index');

        // ensure indexes
        foreach ($indexDefinition as $options) {
            if (empty($options['keys'])) {
                throw new Exception('Keys not specified');
            }

            $keys = $options['keys'];
            unset($options['keys']);

            if (is_string($keys)) {
                $keys = array($keys => 1);
            }

            $this->getMongoCollection()->createIndex($keys, $options);
        }

        return $this;
    }
853275
protected function removeInitializationStatements(&$statements)
    {
        foreach ($statements as $index => $statement) {
            if (!$this->isStatic()) {
                if ($statement['expr']['left']['right']['value'] == $this->name) {
                    unset($statements[$index]);
                }
            } else {
                if ($statement['assignments'][0]['property'] == $this->name) {
                    unset($statements[$index]);
                }
            }
        }
    }
631759
public static function removeEmptyStrings($array)
    {
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $array[$key] = self::removeEmptyStrings($value);
                
                if (empty($array[$key])) {
                    unset($array[$key]);
                }
            } elseif ($value === '') {
                unset($array[$key]);
            }
        }
        
        return $array;
    }
71204
public function getMissingParameterKey(array $parameters, array $requiredKeys = [])
    {
        foreach ($requiredKeys as $key) {
            if (! isset($parameters[$key])) {
                return $key;
            }
        }
    }
447544
protected function clearParams()
    {
        $this->limit      = null;
        $this->limitStart = false;
        $this->limitEnd   = false;
        $this->where      = null;
        $this->orderBy    = null;
        $this->groupBy    = null;
        $this->in         = null;
        $this->params     = [];
        $this->joins      = [];
        $this->query      = '';
    }
192614
public static String[] removeNull(String[] in) {
        if (in == null) {
            return new String[0];
        }
        ArrayList<String> arr = new ArrayList();
        for (int i = 0; i < in.length; i++) {
            if (in[i] != null) {
                arr.add(in[i]);
            }
        }
        if (in.length == arr.size()) {
            return in;
        } else {
            return arr.toArray(new String[0]);
        }
    }
683918
protected function removeRedundantParams(array $data): array
    {
        $data = array_filter($data, function ($item) {
            if ($item instanceof ArrayObject) {
                return $item->count() !== 0;
            }
            return !empty($item);
        });

        foreach ($data as $key => $value) {
            if (is_array($value) || $value instanceof ArrayObject) {
                $data[$key] = $this->removeRedundantParams($value);
            }
        }

        return $data;
    }
26345
private function validateApiParameters($keys = null, $params = null)
    {
        // Assert API has defined an id/endpoint
        $this->assertApiId();

        // Assert API keys array structure is valid
        $this->assertKeysArrayValid($keys);

        // Assert keys array has minimum required optional parameters
        $this->assertKeysHasMinOptParams($keys, $params);

        // Assert and set authentication parameters from Auth object
        $params = $this->setAuthenticationParameters($keys, $params, 'req');
        $params = $this->setAuthenticationParameters($keys, $params, 'opt');

        // Assert required argument parameters exist (non-authentication)
        $this->assertReqParameters($keys, $params);

        // Remove extra parameters not defined in keys array
        $this->removeUnknownParameters($keys, $params);

        return $params;
    }
757879
protected function removeNullElements($array)
    {
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                $array[$key] = $this->removeNullElements($val);
            } elseif (is_null($val)) {
                unset($array[$key]);
            }
        }

        return $array;
    }
658504
protected function prepareParams(array $params)
    {
        foreach ($params as $key => $param) {
            if (gettype($param) === 'boolean') {
                $params[$key] = (string)(($param) ? 'true' : 'false');
            }
        }
        return $params;
    }
775804
protected function removeAjaxQueryParams()
    {
        /** @var \Zend\Stdlib\Parameters */
        $query = $this->request->getQuery();
        if (count($query) > 0) {
            foreach ($this->ajaxQueryParams as $queryParam) {
                $query->set($queryParam, null);
            }
        }
    }
1007715
public static function removeKeys($array, $keys)
    {
        // Loop over the array
        foreach ($array as $key => $value) {
            // Check if we want to remove it...
            if (!is_numeric($key) and in_array($key, $keys)) {
                unset($array[$key]);
                continue;
            }

            // Filter the value if it's an array also
            $array[$key] = is_array($value) ? static::removeKeys($value, $keys) : $value;
        }

        return $array;
    }
1214646
private function organizeQueryParameters($inParameters = null)
    {
        $ctypeParameters = [];
        $metaParameters = [];
        if (is_array($inParameters)) {
            foreach ($inParameters as $key => $value) {
                if (in_array($key, ['page', 'limit', 'offset', 'returnsingle', 'printquery', 'paging', 'order'])) {
                    $metaParameters[$key] = $value;
                } else {
                    $ctypeParameters[$key] = $value;
                }
            }
        }

        return [$metaParameters, $ctypeParameters];
    }
302914
protected function removeNullValuesFromArray($array)
    {
        $result = [];

        foreach ($array as $key => $value) {
            if (isset($value)) {
                if (($value instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage && count($value) > 0) || !($value instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage)) {
                    $result[$key] = $value;
                }
            }
        }

        return $result;
    }
430382
public function without($array)
    {
        $values = func_get_args();
        unset($values[0]);

        if ($values) {
            foreach ($values as $value) {
                unset($array[array_search($value, $array)]);
            }
        }

        return $array;
    }
411282
private function removeConfigArrays()
    {
        $this->info("Removing the 'locales' and 'skip_locales' arrays from config/app.php");
        $this->helper->pregReplaceAndSave($this->config->paths->config->app, $this->regexLocalesString, $this->newLocalesString);
        $this->helper->pregReplaceAndSave($this->config->paths->config->app, $this->regexSkipLocalesString, $this->newSkipLocalesString);
        $this->bar->advance();
    }