@param       $data
@param array $blacklisted

@return mixed|null|string
767498
public function markup($data, $blacklisted = [])
    {
        //FILTER_SANITIZE_STRING
        //FILTER_SANITIZE_STRIPPED
        //\IS\HTML;
        //just form casting
        if (strtolower($verb) == 'request') {
            $verb = $this->getVerb();
        }
        $verb = strtolower($verb);
        $input = $this->$verb;
        //Undefined
        if (empty($name) || !isset($input) || !isset($input[$name])) {
            if (isset($default) && !empty($default)) {
                return $default;
            } else {
                return null; //nothing for that name;
            }
        }
        //uhhhnrrr...
        $string = $input[$name];

        //DOMDocument will screw up the encoding so we utf8 encode everything?
        $string = mb_convert_encoding($string, 'utf-8', mb_detect_encoding($string));
        $string = mb_convert_encoding($string, 'html-entities', 'utf-8');

        $doc = new \DOMDocument('1.0', 'UTF-8');
        //$doc->substituteEntities = TRUE;
        $doc->loadHTML($string, LIBXML_COMPACT | LIBXML_HTML_NOIMPLIED); //Load XML here, if you use loadHTML the string will be wrapped in HTML tags. Not good.
        $xpath = new \DOMXPath($doc);
        //@TODO remove tags that are not allowed;
        //Remove attributes
        $nodes = $xpath->query('//*[@style]');

        foreach ($nodes as $node):
            $node->removeAttribute('style'); //Removes the style attribute;
        endforeach;

        //We don't want to wrap in HTML tags
        $original = $xpath->query("body/*");
        if ($original->length > 0) {
            $string = '';
            foreach ($original as $node) {
                $string .= $doc->saveHTML($node);
            }
        }

        $filter = static::FILTER_SPECIAL_CHARS;
        $options = [
            "flags" => FILTER_FLAG_ENCODE_LOW, //or strip?
            "options" => []
        ];

        //if (is_array($html)) $str = strip_tags($str, implode('', $html));
        //elseif (preg_match('|<([a-z]+)>|i', $html)) $str = strip_tags($str, $html);
        //elseif ($html !== true) $str = strip_tags($str);
        //Some tags we really don't need
        $string = $this->filter($string, $filter, $options);

        return $string;
    }
148639
public function initByData( array $data = null )
    {

        if( !$data ) {
            return null;
        }

        // table inheritance - ghetto?
        /*
        if( isset( $data['tableoid'] ) ) {
            if( $data['tableoid'] != static::OID ) {
                $repo = Repository::init( $data['tableoid'] );
                return $repo->initByData( $data );
            }
            unset( $data['tableoid'] );
        }
        */

        $key = call_user_func(
            array( $this->entityClass, 'keyGet' ),
            $data
        );

        // is this already in the cache? Are we initalising something we've already loaded?
        if( isset( $this->instancesPersisted[$key] ) ) {

            // Late loading? Don't need this anymore.
            $obj = $this->instancesPersisted[$key];
            $obj->__construct( $data );
            return $obj;

        }

        $obj = parent::initByData($data);
        $this->instancesPersisted[$key] = $obj;

        return $obj;

    }
243352
private function parseSingleRelationship($data)
    {
        if ($data === null) {
            $result = null;
        } elseif (is_array($data) === true &&
            array_key_exists(DI::KEYWORD_TYPE, $data) === true &&
            array_key_exists(DI::KEYWORD_ID, $data) === true &&
            is_scalar($type = $data[DI::KEYWORD_TYPE]) === true &&
            is_scalar($index = $data[DI::KEYWORD_ID]) === true
        ) {
            $result = [$type => $index];
        } else {
            $result = false;
        }

        return $result;
    }
783856
public function data(array $data = null)
    {
        if (is_null($data)) {
            return $this->data;
        }

        $this->data = $data;

        return $this;
    }
241045
final public static function getInstance($data=null)
    {
        $class = get_called_class();
        if (empty($class)) return null;

        if (!isset(self::$_instance)){
            self::$_instance = new $class($data);
        }

        return self::$_instance;
    }
886422
private function sendGetLabelRequest($data) {
		switch($this->getMayor()) {
			case 1:
				return $this->getSoapClient()->getLabelDD($data);
			case 2:
			default:
				return $this->getSoapClient()->getLabel($data);
		}
	}
1039868
static function decodeElementRawData(string $data): ?array
    {
        $data = json_decode($data, true);
        if (is_array($data) &&
                isset($data['id']) && is_string($data['id']) && strlen($data['id']) > 0 &&
                isset($data['type']) && is_string($data['type']) && strlen($data['type']) > 0 &&
                isset($data['data']) && is_array($data['data'])
        ) {
            return $data;
        }
        return null;
    }
80609
private function httpBuildQuery(array $data): string
    {
        $queryString = http_build_query($data, '', '&');

        return $this->postProcessHttpQueryString($queryString, $data);
    }
1219730
protected function parseTypeAndId(array $data)
    {
        $idx  = $this->getArrayValue($data, DocumentInterface::KEYWORD_ID, null);
        $type = $this->getArrayValue($data, DocumentInterface::KEYWORD_TYPE, null);

        return [$type, $idx];
    }
595060
public function getSelectedBuild($data) {
		if(isset($data['SelectRelease']) && !empty($data[$data['SelectRelease']])) {
			// Filter out the tag/branch name if required
			$array = explode('-', $data[$data['SelectRelease']]);
			return reset($array);
		}
		if(isset($data['FilteredCommits']) && !empty($data['FilteredCommits'])) {
			return $data['FilteredCommits'];
		}
	}
95638
protected function getOxidFromKeyFields($data)
    {
        if (!is_array($this->getKeyFields())) {
            return null;
        }

        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $queryWherePart = [];
        $allKeysExists = true;
        foreach ($this->getKeyFields() as $key) {
            if (array_key_exists($key, $data)) {
                $queryWherePart[] = $key . '=' . $database->quote($data[$key]);
            } else {
                $allKeysExists = false;
            }
        }

        if ($allKeysExists) {
            $query = 'SELECT OXID FROM ' . $this->getTableName() . ' WHERE ' . implode(' AND ', $queryWherePart);

            return $database->getOne($query);
        }

        return null;
    }
759975
public function convertTypeChildren(array $data = null)
    {
        if (empty($data)) {
            return null;
        }

        $result = new TypeDefinitionList();
        $types = [];

        $typesList = $data[JSONConstants::JSON_TYPESLIST_TYPES] ?? [];

        foreach (array_filter($typesList, 'is_array') as $typeData) {
            $type = $this->convertTypeDefinition($typeData);
            if ($type !== null) {
                $types[] = $type;
            }
        }

        $result->setList($types);
        $result->setHasMoreItems((boolean) ($data[JSONConstants::JSON_TYPESLIST_HAS_MORE_ITEMS] ?? false));
        $result->setNumItems($data[JSONConstants::JSON_TYPESLIST_NUM_ITEMS] ?? 0);
        $result->setExtensions($this->convertExtension($data, JSONConstants::getTypesListKeys()));

        return $result;
    }
535982
public static function fromArray(array $data)
    {
        $result = '';
        foreach ($data as $name => $value) {
            $value = StringHelper::toString($value, "'", Serialize::SERIALIZE_JSON);
            $result .= "$name=$value; ";
        }

        return $result === '' ? null : rtrim($result);
    }
583750
private function getQSEncode($data)
    {
        $req = null;
        foreach ($data as $key => $value) {
            $req .= $key . '=' . urlencode(stripslashes($value)) . '&';
        }

        // cut the last '&'
        $req = substr($req, 0, strlen($req) - 1);

        return $req;
    }
1339131
public function update(array $data)
    {
        if (empty($data)) {
            return null;
        }

        if (!array_key_exists('id', $data) || !array_key_exists('email', $data)) {
            return null;
        }

        $data['api_action'] = 'contact_edit';
        $response = $this->request($data, 'POST');

        if ($response === null || $response->getStatusCode() !== 200) {
            return null;
        }

        $json = $response->getBody()->getContents();

        return $this->serializer->deserialize(
            $this->removeResultInformation($json),
            \FondOfPHP\ActiveCampaign\DataTransferObject\Contact::class,
            'json'
        );
    }
201704
public function getDataForJSON($data = null)
    {
        if (is_null($data)) {
            $data = $this->getData();
        }

        $dataForJson = [$this->getEvidence() => $this->objectToID($data)];

        if (!is_null($this->action)) {
            $dataForJson[$this->evidence.'@action'] = $this->action;
            $this->action                           = null;
        }

        if (!is_null($this->filter)) {
            $dataForJson[$this->evidence.'@filter'] = $this->filter;
        }


        foreach ($this->chained as $chained) {
            $chainedData = $chained->getDataForJSON();
            foreach ($chainedData as $chainedItemEvidence => $chainedItemData) {
                if (array_key_exists($chainedItemEvidence, $dataForJson)) {
                    if (is_string(key($dataForJson[$chainedItemEvidence]))) {
                        $dataBackup                          = $dataForJson[$chainedItemEvidence];
                        $dataForJson[$chainedItemEvidence]   = [];
                        $dataForJson[$chainedItemEvidence][] = $dataBackup;
                    }
                    if (array_key_exists(0, $chainedItemData)) {
                        foreach ($chainedItemData as $chainedItem) {
                            $dataForJson[$chainedItemEvidence][] = $chainedItem;
                        }
                    } else {
                        $dataForJson[$chainedItemEvidence][] = $chainedItemData;
                    }
                } else {
                    $dataForJson[$chainedItemEvidence] = $chainedItemData;
                }
            }
        }


        return $dataForJson;
    }
456328
public function data($data = []) {
        if (count($data) == 0) {
            return $this->_data;
        }
        else {
            $this->_data = $data;
        }

        return null;
    }