2016-08-26
@return array(string|null)
422241
private function customerNameA() {return dfc($this, function() {
		/** @var O $o */ $o = $this->o();
		/** @var OA $ba */ $ba = $this->addressB();
		/** @var C|DFCustomer $c */
		/** @var string|null $f */
		return ($f = $o->getCustomerFirstname()) ? [$f, $o->getCustomerLastname()] : (
			($c = $o->getCustomer()) && ($f = $c->getFirstname()) ? [$f, $c->getLastname()] : (
				$f = $ba->getFirstname() ? [$f, $ba->getLastname()] : (
					($sa = $this->addressS()) && ($f = $sa->getFirstname()) ? [$f, $sa->getLastname()] :
						[null, null]
				)
			)
		);
	});}
1327190
public function toArray(): array
    {
        return [
            'type' => $this->type,
            'configuration' => $this->configuration,
            'weight' => $this->weight,
            'score_mode' => $this->scoreMode,
            'filter' => ($this->filter instanceof Filter
                ? $this
                    ->filter
                    ->toArray()
                : null),
        ];
    }
317488
private function getValuesAsArray()
    {
        if ($this->value === null) {
            return is_array($this->defaultValue) 
                ? $this->defaultValue 
                : [ $this->defaultValue ];
        }
        return $this->value;
    }
1209882
public function toArray()
	{
		$result = parent::toArray();

		if (isset($result['activated']))
		{
			$result['activated'] = $this->getActivatedAttribute($result['activated']);
		}
		if (isset($result['permissions']))
		{
			$result['permissions'] = $this->getPermissionsAttribute($result['permissions']);
		}
		if (isset($result['suspended_at']))
		{
			$result['suspended_at'] = $result['suspended_at']->format('Y-m-d H:i:s');
		}

		return $result;
	}
644429
public function toArray() : array {
        return [
            'command'   => $this->getCommand(),
            'running'   => $this->isRunning(),
            'info'      => $this->getInfo() ? $this->getInfo()->toArray() : null,
        ];
    }
1052877
public function jsonSerialize()
    {
        return array_filter(
            [
                'click_tracking' => $this->getClickTracking(),
                'open_tracking' => $this->getOpenTracking(),
                'subscription_tracking' => $this->getSubscriptionTracking(),
                'ganalytics' => $this->getGanalytics()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
1259216
public function getUploadParams()
    {
        if ($this->type === self::TYPE_URL) {
            return [
                'json' => array_merge($this->getAdditionalAttributes(), ['file' => $this->file]),
            ];
        }

        if ($this->type === self::TYPE_MULTIPART) {
            $params[] = [
                'name' => 'file',
                'contents' => fopen($this->file, 'r'),
            ];

            foreach ($this->getAdditionalAttributes() as $key => $value) {
                $params[] = [
                    'name' => $key,
                    'contents' => $value,
                ];
            }

            return [
                'multipart' => $params
            ];
        }

        return null;
    }
383464
private function _getResultData()
    {
        $def = $this->actionChain->getCurrentAction();
        $result = $def['result'];
        if (is_string($result)) {
            return $this->getAttribute($result);
        } elseif (is_array($result)) {
            return array_pop($result);
        } else {
            return null;
        }
    }
52252
public function getValue()
    {
        $val = $this->base['value'];

        if (is_array($val)) {
            $posts = array();

            foreach ($val as $p) {
                $posts[] = $this->postFactory->create($this->getPostObject($p));
            }

            return $posts;
        } elseif (strlen($val)) {
            return $this->postFactory->create($this->getPostObject($val));
        } else {
            if (isset($this->base['multiple']) && $this->base['multiple']) {
                return array();
            } else {
                return null;
            }
        }
    }
1341287
public function getAllAttributes()
    {
        if ($this->node->hasAttributes()) {
            $attributes = [];
            foreach ($this->node->attributes as $attr) {
                $attributes[$attr->name] = $attr->value;
            }

            return $attributes;
        }

        return null;
    }
356938
public function toArray() {
        $arr = array_filter(
                array(
                    'v' => $this->getValueForArray(),
                    'f' => $this->f,
                    'p' => $this->p,
                ), function ($val) { return !is_null($val);}
        );
        // mm, some charts don't work if 'v' is not present
        if (!isset($arr['v'])) {
            $arr['v'] = null;
        }
        return $arr;
    }
760128
public function toArray() : ?array
    {
        if (null === $this->stmt || false === $this->stmt) {
            return null;
        }
        return $this->stmt->toArray();
    }
1351901
public function toArray()
    {
        return array(
            'name'   => $this->name,
            'value'  => $this->value,
            'path'   => $this->path,
            'domain' => $this->domain,
            'secure' => $this->isSecure,
            'expiry' => null === $this->expiry ? null : $this->expiry->getTimestamp()
        );
    }
274218
public function jsonSerialize()
    {
        return array_filter(
            [
                'group_id' => $this->getGroupId(),
                'groups_to_display' => $this->getGroupsToDisplay()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
597487
public function getCode()
    {
        if (!$this->isSuccessful() && isset($this->data['error']) && isset($this->data['error']['code'])) {
            return $this->data['error']['code'];
        }

        return null;
    }
405935
private function getOptions(): ?array
    {
        $requestOptions = $this->requestStack->getCurrentRequest()->get('options');

        if (is_null($requestOptions)) {
            return null;
        }

        $requestOptions = explode(',', $requestOptions);
        $options = [];
        foreach ($requestOptions as $requestOption) {
            $requestOption = explode('|', $requestOption);
            $fieldHandle = array_shift($requestOption);
            $options[$fieldHandle] = [];
            foreach ($requestOption as $option) {
                $keyValue = explode(':', $option);
                $options[$fieldHandle][$keyValue[0]] = $keyValue[1];
            }
        }

        return $options;
    }
1172265
public function current()
    {
        $part  = substr($this->string, ($this->index * $this->count), $this->count);
        $chars = array_pad(str_split($part), $this->count, 0);

        return [
            'r' => $chars[0],
            'g' => $chars[1],
            'b' => $chars[2],
        ];
    }