Apply Faker dummy values.

@param  mixed $attribute
@return array|string
167568
protected function runFaker($attribute)
    {
        if ($attribute instanceof Closure) {
            $attribute = $attribute();
        }

        // It's possible that the called Faker method returned an array.
        // If that is the case, we'll implode it for the user.

        if (is_array($attribute)) {

            // If we're dealing with an associative array...

            if (array_values($attribute) !== $attribute) {
                return array_map([$this, 'runFaker'], $attribute);
            }

            return implode(' ', $attribute);
        }

        return $attribute;
    }
1069025
public function filePresetAfterUpload($attribute)
    {
        $preset = $this->fileOption($attribute, 'applyPresetAfterUpload', []);
        if (is_string($preset) && $preset === '*') {
            return array_keys($this->fileOption($attribute, 'preset', []));
        }
        return $preset;
    }
615814
private function getAttributeValues($attribute, $attributeValues)
    {
        $values = [];
        foreach ($attributeValues as $attributeValue) {
            if ($attribute['id'] == $attributeValue['attributeId']) {
                $values[] = $attributeValue;
            }
        }

        return $values;
    }
1047031
protected function getAttribute($attribute)
	{
		// The developer may dynamically specify the array of custom attributes
		// on this Validator instance. If the attribute exists in this array
		// it takes precedence over all other ways we can pull attributes.
		if (isset($this->customAttributes[$attribute]))
		{
			return $this->customAttributes[$attribute];
		}

		$key = "validation.attributes.{$attribute}";

		// We allow for the developer to specify language lines for each of the
		// attributes allowing for more displayable counterparts of each of
		// the attributes. This provides the ability for simple formats.
		if (($line = $this->translator->trans($key)) !== $key)
		{
			return $line;
		}

		// If no language line has been specified for the attribute all of the
		// underscores are removed from the attribute name and that will be
		// used as default versions of the attribute's displayable names.
		return str_replace('_', ' ', snake_case($attribute));
	}
1079554
public function getSingleRemoverCodeDocumentationParameterLines(PHPAttribute $attribute)
    {
        $lines = [];

        $lines[] = '@param ' . $attribute->getPhpSingleTypeBase() /*. ($attribute->getEntity()->getProject()->getBase() ? 'Base' : '')*/ . ' $' . $attribute->getSingleName();

        return $lines;
    }
802661
public function getAttribute($attribute) {
		if (isset($this->_attributes[$attribute])) {
			return $this->_attributes[$attribute];
		}

		return null;
	}
664440
public function attribute($attribute) {
		if(!is_array($attribute))
			$attribute = explode('.', $attribute);

		$next = array_shift($attribute);
		if(count($attribute) === 0) {
			if(!isset($this->attributes[$next]))
				return (new static(null))->setParent($this);
			else
				return $this->attributes[$next];
		}

		if($next === '<')
			return $this->parent()->attribute($attribute);
		else {
			if(!isset($this->attributes[$next]))
				return (new static(null))->setParent($this);
			else
				return $this->attributes[$next]->attribute($attribute);
		}
	}
1363916
protected function applyDefaultAttrValues(array $attributes = [])
    {
        // Set defaults for each attribute.
        foreach ($this->getMetadata()->getAttributes() as $key => $attrMeta) {
            if (!isset($attrMeta->defaultValue) || isset($attributes[$key])) {
                continue;
            }
            $attributes[$key] = $this->convertAttributeValue($key, $attrMeta->defaultValue);
        }
        return $attributes;
    }
281101
public function getSingleAdderCodeDocumentationParameterLines(PHPAttribute $attribute)
    {
        $lines = [];

        $lines[] = '@param ' . $attribute->getPhpSingleTypeBase() . ' $' . $attribute->getSingleName();
        $lines[] = '@param bool $_allowRepeatedValues';

        return $lines;
    }
478614
static public function attributes($attributes)
    {
        $compiled = '';
        foreach($attributes as $key => $value) {
            if ($value === NULL) {
                // Skip attributes that have NULL values
                continue;
            }
            if (is_numeric($key)) {
                // Assume non-associative keys are mirrored attributes
                $key = $value;
            }
            // Add the attribute value
            $compiled .= ' '.$key.'="' . htmlspecialchars( (string) $value, ENT_QUOTES, self::$charset, true) . '"';
        }
        return $compiled;
    }
1050551
public function sync_original_attribute( $attribute ) {
		if ( array_key_exists( $attribute, $this->attributes ) ) {
			$this->original[ $attribute ] = $this->attributes[ $attribute ];
		}

		return $this;
	}
40433
public function get($attribute, $fallback = null)
    {
        $value = $this->{$attribute};
        if (!is_null($value)) {
            return $attribute . '="' . $value . '"';
        } elseif (!is_null($fallback)) {
            return $attribute . '="' . $fallback . '"';
        }
    }
1224578
protected function getDateAttribute($attribute)
        {
            switch ($attribute) {
                case 'Day':
                    return $this->format('d');
                    break;
                case 'Month':
                    return $this->format('m');
                    break;
                case 'Year':
                    return $this->format('Y');
                    break;
                case 'Hour':
                    return $this->format('G');
                    break;
                case 'Minute':
                    return $this->format('i');
                    break;
                case 'Second':
                    return $this->format('s');
                    break;
                case 'DayOfWeek':
                    return $this->format('l');
                    break;
                case 'DayOfWeekAsNumeric':
                    return $this->format('w');
                    break;
                case 'DaysInMonth':
                    return $this->format('t');
                    break;
                case 'DayOfYear':
                    return $this->format('z');
                    break;
                case 'DaySuffix':
                    return $this->format('S');
                    break;
                case 'LeapYear':
                    return (bool) $this->format('L');
                    break;
                case 'AmOrPm':
                    return $this->format('A');
                    break;
                case 'DaylightSavings':
                    return (bool) $this->format('I');
                    break;
                case 'GmtDifference':
                    return $this->format('O');
                    break;
                case 'SecondsSinceEpoch':
                    return $this->format('U');
                    break;
                case 'TimezoneName':
                    return $this->getTimezone()->getName();
                    break;
            }

            throw new \InvalidArgumentException('The date attribute [' . $attribute . '] could not be found.');
        }
1229243
public function forgetAttribute($attribute)
    {
        if ($attribute === 'class') {
            $this->classes = [];

            return $this;
        }

        if (isset($this->attributes[$attribute])) {
            unset($this->attributes[$attribute]);
        }

        return $this;
    }
833622
protected function getAttributeType($attribute)
    {
        // We assume that the attributes present in the file array are files so that
        // means that if the attribute does not have a numeric rule and the files
        // list doesn't have it we'll just consider it a string by elimination.
        if ($this->hasRule($attribute, $this->numericRules)) {
            return 'numeric';
        } else if ($this->hasRule($attribute, array('Array'))) {
            return 'array';
        } else if (array_key_exists($attribute, $this->files)) {
            return 'file';
        }

        return 'string';
    }
825063
protected function buildAttributeConditions($attribute)
    {
        $attributes = [];
        foreach (array_merge([''], static::$filterConditions) as $condition) {
            $attributes[] = $attribute . ($condition === '' ? '' : "_$condition");
        }

        return $attributes;
    }
49373
protected function getValue($attribute)
    {
        if (!is_null($value = array_get($this->data, $attribute))) {
            return $value;
        } elseif (!is_null($value = array_get($this->files, $attribute))) {
            return $value;
        }
    }