@param array     $attributes
@param Assertion $assertion

@return array
435
private function resolveAttributesFromAssertion(array $attributes, Assertion $assertion)
    {
        $attributeStatements = $assertion->getAllAttributeStatements();

        return array_reduce($attributeStatements, [$this, 'resolveAttributesFromAttributeStatement'], $attributes);
    }
311218
protected function skipNullValue(array $attributes)
    {
        $attr = [];

        foreach ($attributes as $key => $value) {
            if (null !== $value) {
                $attr[$key] = \is_array($value)
                    ? $this->skipNullValue($value)
                    : $value;
            }
        }

        return $attr;
    }
632820
protected Assertion buildCasAssertion(final String principal,
                                          final RegisteredService registeredService,
                                          final Map<String, Object> attributes) {
        val p = new AttributePrincipalImpl(principal, attributes);
        return new AssertionImpl(p, DateTimeUtils.dateOf(ZonedDateTime.now(ZoneOffset.UTC)),
            null, DateTimeUtils.dateOf(ZonedDateTime.now(ZoneOffset.UTC)), attributes);
    }
1212250
public function verifyAssertion($assertion)
    {

        /*$url = 'https://verifier.login.persona.org/verify';
        $data = 'assertion='.$assertion.'&audience=http://persona.localhost:80';

        $params = array(
            'http' => array(
                'method' => 'POST',
                'content' => $data
            ),
            'ssl' => array(
                'verify_peer' => true,
                'verify_host' => true
            )
        );
        $context = stream_context_create($params);
        $result = file_get_contents($url, false, $context);

        return $result;*/

        $postdata = 'assertion=' . urlencode($assertion) . '&audience='.$this->guessAudience();

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "https://verifier.login.persona.org/verify");
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
        $response = curl_exec($ch);
        curl_close($ch);



        return json_decode($response);
    }
947819
public function attributes($attributes = null)
    {
        if (null === $attributes) {
            return $this->attributes;
        }

        $this->attributes = $attributes;

        return $this;
    }
89448
private function makeQueueAttributes($attributes){
        $queueAttributes = null;
        if(count($attributes)){
            $args = ['delaySeconds', 'maximumMessageSize', 'messageRetentionPeriod', 'visibilityTimeout', 'pollingWaitSeconds', 'queueName', 'createTime', 'lastModifyTime', 'activeMessages',
                'inactiveMessages', 'delayMessages', 'LoggingEnabled'];
            $excludeArgs = ['queueName', 'createTime', 'lastModifyTime', 'activeMessages', 'inactiveMessages', 'delayMessages'];
            $queueAttributes = $this->makeAttributesObject(QueueAttributes::class, $attributes, $args, $excludeArgs);
        }
        return $queueAttributes;
    }
135348
public static function assert($assertion, string $message = '')
    {
        self::$count += 1;
        assert($assertion, new AssertionError($message));
    }
1085778
public function __toArray($attributes = array()){

        if( empty($attributes) ){
            $data = $this->_data;
        }else{

            $data = array();
            foreach( $attributes as $attribute ){
                if( isset($this->_data[$attribute]) ){
                    $data[$attribute] = $this->_data[$attribute];
                } else {
                    $data[$attribute] = NULL;
                }
            }

        }

        foreach( $data as $key => $item ){
            if( $item instanceof AppObject ){
                $item = $item->toArray();
                $data[$key] = $item;
            }
        }

        return $data;
    }
747082
public function assert($assertion, $message)
    {
        // Increment the assertion count
        $this->test->incrementAssertionCount();

        $assertion = $this->negative ? !((bool) $assertion) : (bool) $assertion;

        if ($assertion === false) {
            return call_user_func_array([$this, 'fail'], $message);
        }

        return true;
    }
307958
public function replicate(array $attributes = [])
    {
        $copy = new static(array_merge($this->toArray(), $attributes));
        $copy->setConstraints(clone $this->getConstraints());
        return $copy;
    }
274158
public function toCamelCase($attributes)
    {
        $convertedAttributes = [];

        foreach ($attributes as $key => $value) {
            $key = $this->getTrueKey($key);
            $convertedAttributes[$key] = $value;
        }

        return $convertedAttributes;
    }
428833
protected function attributes($attributes)
    {
        if (!is_array($attributes)) {
            return $attributes;
        }

        $attr = '';
        foreach ($attributes as $attribute => $value) {
            if (is_int($attribute)) {
                $attribute = $value;
            }
            $attr .= ' ' . $attribute . '="' . $value . '"';
        }

        return $attr;
    }
32853
private static function extractAttributes(array $attributes = []): string
    {
        $extracted = [];
        if (\count($attributes) > 0) {
            foreach ($attributes as $name => $value) {
                if ($name != 'id' || ($name == 'id' && $value != '')) {
                    $extracted[] = sprintf(
                        '%s="%s"',
                        \strtolower($name),
                        \htmlspecialchars((string)$value, ENT_COMPAT | ENT_HTML5)
                    );
                }
            }
            return \sprintf(' %s', \implode(' ', $extracted));
        }
        return '';
    }
19352
private function resolveAttributesFromAttributeStatement(array $attributes, AttributeStatement $attributeStatement)
    {
        $statementAttributes = $attributeStatement->getAllAttributes();

        return array_reduce($statementAttributes, [$this, 'mapAttributeValues'], $attributes);
    }
458914
final public static function parseAttributes($attributes, $ignore = array()) {
        if (!is_array($attributes)) {
            return $attributes;
        }
        $return = "";
        foreach ($attributes as $attr => $value) {
            if (in_array($attr, $ignore))
                continue;
            $return .= $attr . '="' . $value . '" ';
        }

        return $return;
    }
517155
public function createAtAction(Request $request, Assertion $assertion)
    {
        $object = $this->crud->create(
            $this->getClass(),
            $this->decodeRequest($request),
            []
        );

        $object->setAssertion($assertion);
        $this->om->persist($object);
        $this->om->flush();

        if (is_array($object)) {
            return new JsonResponse($object, 400);
        }

        return new JsonResponse(
            $this->serializer->serialize($object, []),
            201
        );
    }
737136
public static function RenderAttrs (array $attributes = []) {
		$result = [];
		foreach ($attributes as $attrName => $attrValue) {
			//if (gettype($attrValue) == 'array') $stop();
			$result[] = $attrName.'="'.$attrValue.'"';
		}
		return implode(' ', $result);
	}