@param $permittedIpsInput

@return string[]
341905
private static function formatAllIp(string $permittedIpsInput = null): array
    {
        if (is_null($permittedIpsInput)) {
            $permittedIps = [];
        } else {
            $permittedIpsRaw = explode(self::DELIMITER_COMMA, $permittedIpsInput);
            $permittedIps = [];

            foreach ($permittedIpsRaw as $permittedIp) {
                static::assertIpIsValid($permittedIp);
                $permittedIps[] = trim($permittedIp);
            }
        }

        return $permittedIps;
    }
803098
public function getAllowedStates()
    {
        // Get states from extending object. (ie. Page, DataObject)
        $allowedStates = $this->owner->config()->allowed_states;
        if (is_array($allowedStates) &&
            $allowedStates) {
            return $allowedStates;
        }

        // Get allowed states global. If there are no specific rules on a Page/DataObject
        // fallback to what is configured on this extension
        $allowedStates = Config::inst()->get(__CLASS__, 'allowed_states');
        if (is_array($allowedStates) &&
            $allowedStates) {
            return $allowedStates;
        }
        return [];
    }
676403
def GetIPAddresses(self):
    """"""
    results = []
    for address in self.addresses:
      human_readable_address = address.human_readable_address
      if human_readable_address is not None:
        results.append(human_readable_address)

    return results
1173629
private static function getNotAllowedParams($params, $allowedParams)
    {
        $notAllowedParams = array();
        foreach ($params as $key => $value) {
            if (!isset($allowedParams[$key])) {
                $notAllowedParams[$key] = $value;
            }
        }

        return $notAllowedParams;
    }
1086939
public function sanitize( $input ) {
		$new_input = [];
		foreach ( array_keys( (array) $input ) as $id ) {
			$new_input[ sanitize_file_name( $id ) ] = sanitize_text_field( $input[ $id ] );
		}

		return $new_input;
	}
1337334
private function checkAndReturnExcludedIps($excludedIps)
    {
        if (empty($excludedIps)) {
            return '';
        }

        $ips = explode(',', $excludedIps);
        $ips = array_map('trim', $ips);
        $ips = array_filter($ips, 'strlen');

        foreach ($ips as $ip) {
            if (!$this->isValidIp($ip)) {
                throw new Exception(Piwik::translate('SitesManager_ExceptionInvalidIPFormat', array($ip, "1.2.3.4, 1.2.3.*, or 1.2.3.4/5")));
            }
        }

        $ips = implode(',', $ips);
        return $ips;
    }
395349
public function prepareList_emailDataForInsert($input) {

        $data = [];

        $data['title']         = $input['listID']." ".$input['emailID'];
        $data['list_id']       = $input['listID'];
        $data['email_id']      = $input['emailID'];
        $data['comments']      = "";
        $data['enabled']       = 1;
        $data['created_at']    = Carbon::now();
        $data['created_by']    = $this->userRepository->getFirstAmongEqualsUserID();
        $data['updated_at']    = Carbon::now();
        $data['updated_by']    = $this->userRepository->getFirstAmongEqualsUserID();

        return $data;

    }
346397
protected function getOptions(InputInterface $input)
    {
        return [
            'dir'    => (bool) $input->getOption('fix_dir'),
            'file'   => (bool) $input->getOption('fix_file'),
            'skip'   => (bool) $input->getOption('skip_dir_file'),
            'strict' => (bool) $input->getOption('strict_types'),
        ];
    }
1243029
private function ParseDataFromPhpInput() {
        if (file_get_contents('php://input') == "") {
            return array();
        }
        $jsonDecodedData = json_decode(file_get_contents('php://input'));
        if (is_null($jsonDecodedData)) {
            return array();
        }
        $postData = get_object_vars($jsonDecodedData);
        if (empty($postData)) {
            return array();
        }
        return $postData;
    }
230665
public function parseAuthorizedIps($ips)
    {
        $ips = trim($ips);

        if (is_string($ips) && !empty($ips))
        {
            $ips = explode(PHP_EOL, $ips);
        }

        return $this->filterOutArrayValues(
            $ips, function($val) {
            return preg_match('/^[0-9\.\*]{5,15}$/i', $val);
        }
        );
    }
1144774
public function getAllowedOperations()
    {
        return [
            self::OPERATION_REQUEST,
            self::OPERATION_CANCEL,
            self::OPERATION_APPROVE,
            self::OPERATION_REJECT,
            self::OPERATION_QUERY,
        ];
    }
243088
protected function getEndpoints(InputInterface $input): array
    {
        $endpointsName = $input->getOption('endpoint');
        $endpoints = Endpoints::filter($endpointsName);

        if (count($endpointsName) > count($endpoints)) {
            throw new Exception(sprintf(
                'Endpoint not found. Endpoints available: %s',
                implode(', ', array_keys(Endpoints::all()))
            ));
        }

        return $endpoints;
    }
242861
function trimPermittedDomains(permittedDomains) {
  var trimmedPermittedDomains = [];

  _.each(permittedDomains, function(permittedDomain) {
    trimmedPermittedDomains.push(permittedDomain.trim());
  });

  return trimmedPermittedDomains;
}
1356144
private function getRestrictedContentTypesIdentifiers($hasAccess): array
    {
        if (!is_array($hasAccess)) {
            return [];
        }

        $restrictedContentTypesIds = $this->permissionChecker->getRestrictions($hasAccess, ContentTypeLimitation::class);

        if (empty($restrictedContentTypesIds)) {
            return [];
        }

        $restrictedContentTypesIdentifiers = [];
        foreach ($restrictedContentTypesIds as $restrictedContentTypeId) {
            // TODO: Change to `contentTypeService->loadContentTypeList($restrictedContentTypesIds)` after #2444 will be merged
            try {
                $identifier = $this->contentTypeService->loadContentType($restrictedContentTypeId)->identifier;
                $restrictedContentTypesIdentifiers[] = $identifier;
            } catch (NotFoundException $e) {
            }
        }

        return $restrictedContentTypesIdentifiers;
    }
1115773
protected function getPossibleEmails()
    {
        $this->checkGit();
        $github_email = null;
        $github_email = str_replace(array("\r", "\n"), '', shell_exec('git config user.email'));

        if (filter_var($github_email, FILTER_VALIDATE_EMAIL)) {
            return [ $github_email ];
        } else {
            return [];
        }
    }
1095701
private function fromFlattenedSerializationSignatureToSerialization($input)
    {
        $signature = [
            'signature' => $input['signature'],
        ];
        foreach (['protected', 'header'] as $key) {
            if (array_key_exists($key, $input)) {
                $signature[$key] = $input[$key];
            }
        }

        $temp = [];
        if (!empty($input['payload'])) {
            $temp['payload'] = $input['payload'];
        }
        $temp['signatures'] = [$signature];

        $this->log(LogLevel::INFO, 'JWS in Flattened JSON Serialization mode loaded.');

        return $temp;
    }
553187
private function getRemainingIpnFields()
    {
        $ipnMessage = $this->returnMessage();

        $remainingFields = array(
                            'NotificationReferenceId' =>$ipnMessage['NotificationReferenceId'],
                            'NotificationType' =>$ipnMessage['NotificationType'],
                            'SellerId' =>$ipnMessage['SellerId'],
                            'ReleaseEnvironment' =>$ipnMessage['ReleaseEnvironment'] );

        return $remainingFields;
    }