Tests whether the provided data represents an array of resource data, or an array of links to resources.

@param mixed $data
@return bool
335808
private function isArrayResourceData($data)
    {
        if (!is_array($data) || empty($data)) {
            return false;
        }
        foreach ($data as $datum) {
            if (!$this->isResourceData($datum)) {
                return false;
            }
        }

        return true;
    }
753694
public static function isEncoded($data)
    {
        if (!is_string($data)) {
            return false;
        }

        $data = trim($data);
        if ('N;' == $data) {
            return true;
        }

        $match = array();
        if (!preg_match('/^([adObis]):/', $data, $match)) {
            return false;
        }

        switch ($match[1]) {
        case 'a' :
        case 'O' :
        case 's' :
            if (preg_match("/^{$match[1]}:[0-9]+:.*[;}]\$/s", $data)) {
                return true;
            }

            break;
        case 'b' :
        case 'i' :
        case 'd' :
            if (preg_match("/^{$match[1]}:[0-9.E-]+;\$/", $data)) {
                return true;
            }

            break;
        }

        return false;
    }
1167396
private function elementExistsWith($data)
    {
        $found = null;
        array_map(function ($element) use ($data, &$found) {
            if ($element->getData() === $data) {
                $found = $element;
            }
        }, $this->elements);

        return $found !== null;
    }
310474
protected function validateItemCache($data)
    {
        if (!$data || !is_array($data)) {
            return false;
        }
        foreach (['classes', 'interfaces', 'traits'] as $key) {
            // Must be set
            if (!isset($data[$key])) {
                return false;
            }
            // and an array
            if (!is_array($data[$key])) {
                return false;
            }
            // Detect legacy cache keys (non-associative)
            $array = $data[$key];
            if (!empty($array) && is_numeric(key($array))) {
                return false;
            }
        }
        return true;
    }
967293
public function hasLinks($array) {
        if(is_array($array)) {
            foreach($array as $link) {
                if($this->hasLink($link) === false) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }
966801
private function isRemoteImage(array $data)
    {
        return isset($data['image']['file']) && is_string($data['image']['file']) &&
            (!strncasecmp('http://', $data['image']['file'], 7) || !strncasecmp('https://', $data['image']['file'], 8));
    }
657827
public static function is_serialized($data)
    {
        // If it isn't a string, it isn't serialized
        if (!is_string($data)) {
            return false;
        }

        $data = trim($data);

        // Is it the serialized NULL value?
        if ($data === 'N;') {
            return true;
        } elseif ($data === 'b:0;' || $data === 'b:1;') {
            // Is it a serialized boolean?
            return true;
        }

        $length = strlen($data);

        // Check some basic requirements of all serialized strings
        if ($length < 4 || $data[1] !== ':' || ($data[$length - 1] !== ';' && $data[$length - 1] !== '}')) {
            return false;
        }

        return @unserialize($data) !== false;
    }
1314461
protected function isDataValid($data)
    {
        $this->parser->setData($data);
        $this->parser->parseData();

        return $this->parser->isValid();
    }
98747
public function item($resourceKey, array $data)
    {
        $id = $this->getIdFromData($data);

        $resource = [
            'data' => [
                'type' => $resourceKey,
                'id' => "$id",
                'attributes' => $data,
            ],
        ];

        unset($resource['data']['attributes']['id']);

        if(isset($resource['data']['attributes']['links'])) {
            $custom_links = $data['links'];
            unset($resource['data']['attributes']['links']);
        }

        if (isset($resource['data']['attributes']['meta'])){
            $resource['data']['meta'] = $data['meta'];
            unset($resource['data']['attributes']['meta']);
        }

        if(empty($resource['data']['attributes'])) {
            $resource['data']['attributes'] = (object) [];
        }

        if ($this->shouldIncludeLinks()) {
            $resource['data']['links'] = [
                'self' => "{$this->baseUrl}/$resourceKey/$id",
            ];
            if(isset($custom_links)) {
                $resource['data']['links'] = array_merge($resource['data']['links'], $custom_links);
            }
        }

        return $resource;
    }
385913
protected function validateDataFromCache($data): bool
    {
        if (!\is_array($data)) {
            return false;
        }

        foreach (['value', 'ttl'] as $missing) {
            if (!\array_key_exists($missing, $data)) {
                return false;
            }
        }

        return true;
    }
563053
protected function isCollection($data)
    {
        if (is_array($data) || $data instanceof \Illuminate\Support\Collection || $data instanceof Paginator) {
            return true;
        }

        $length = count($this->getCollectionClass());

        for ($i = 0; $i < $length; $i++) {
            $class = \Illuminate\Support\Arr::get($this->getCollectionClass(), $i);

            if ($data instanceof $class) {
                return true;
            }
        }

        return false;
    }
1007930
public function create(array $data)
    {
        if ( $this->validator->with($data)->passes() )
        {
            $data['permissions'] = explode(',', $data['permissions']);
            $this->permission->create($data);
            return true;
        }
        else
        {
            return false;
        }
    }
773476
public function has(VariableWrapper $data)
    {
        foreach ($this->metadatas as $metadata) {
            if ($metadata->supports($data)) {
                return true;
            }
        }

        return false;
    }
987901
private function isProbablySingleIdentity(array $data)
    {
        $isProbablySingle = array_key_exists(DocumentInterface::KEYWORD_TYPE, $data) ||
            array_key_exists(DocumentInterface::KEYWORD_ID, $data);

        return $isProbablySingle;
    }
656940
public function setHeadData($data)
	{
		if (empty($data) || !is_array($data))
		{
			return;
		}

		$this->title        = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : $this->title;
		$this->description  = (isset($data['description']) && !empty($data['description'])) ? $data['description'] : $this->description;
		$this->link         = (isset($data['link']) && !empty($data['link'])) ? $data['link'] : $this->link;

		$this->_metaTags    = (isset($data['metaTags']) && !empty($data['metaTags'])) ? $data['metaTags'] : $this->_metaTags;
		$this->_links       = (isset($data['links']) && !empty($data['links'])) ? $data['links'] : $this->_links;
		$this->_styleSheets = (isset($data['styleSheets']) && !empty($data['styleSheets'])) ? $data['styleSheets'] : $this->_styleSheets;
		$this->_style       = (isset($data['style']) && !empty($data['style'])) ? $data['style'] : $this->_style;
		$this->_scripts     = (isset($data['scripts']) && !empty($data['scripts'])) ? $data['scripts'] : $this->_scripts;
		$this->_script      = (isset($data['script']) && !empty($data['script'])) ? $data['script'] : $this->_script;
		$this->_custom      = (isset($data['custom']) && !empty($data['custom'])) ? $data['custom'] : $this->_custom;

		return $this;
	}
120393
public function link_provider(array $data)
	{
		// do some validation
		if ( ! is_numeric($data['expires']))
		{
			if ($date = \DateTime::createFromFormat(\DateTime::ISO8601, $data['expires']))
			{
				$data['expires'] = $date->getTimestamp();
			}
			elseif ($date = \DateTime::createFromFormat('Y-m-d H:i:s', $data['expires']))
			{
				$data['expires'] = $date->getTimestamp();
			}
			else
			{
				$data['expires'] = time();
			}
		}

		// get rid of old registrations to prevent duplicates
		\DB::delete($this->config['table'])->where('uid', '=', $data['uid'])->where('provider', '=', $data['provider'])->execute(static::$db_connection);

		// insert the new provider UID
		list($insert_id, $rows_affected) = \DB::insert($this->config['table'])->set($data)->execute(static::$db_connection);
		return $rows_affected ? $insert_id : false;
	}
604795
public function isSupported(array $data)
    {
        try {
            new DateTime($data[$this->getProperty()]);
        } catch (Exception $e) {
            return false;
        }

        return true;
    }