Config/Source/LetterCase.php
protected function map() {
		/** @var string|null $sample */
		$sample = $this->f('dfSample');
		/** @var string[] $values */
		$values = [self::_DEFAULT, self::$UCFIRST, self::$UCWORDS, self::$UPPERCASE, self::$LOWERCASE];
		/** @var string[] $labels */
		$labels = [
			'As Is'
			, 'Uppercase first letter'
			, 'Uppercase Each Word\'s First Letter'
			,'UPPERCASE'
			,'lowercase'
		];
		return array_combine(
			$values
			,!$sample
			? $labels
			: array_map(function($value, $label) use($sample) {
				return sprintf('%s (%s)', self::apply($sample, $value), $label);
			}, $values, $labels)
			//: df_map([__CLASS__, 'apply'], $keys, [], $sample)
		);
	}
protected function map() {
		/** @var string|null $sample */
		$sample = $this->f('dfSample');
		/** @var string[] $values */
		$values = [self::_DEFAULT, self::$UCFIRST, self::$UCWORDS, self::$UPPERCASE, self::$LOWERCASE];
		/** @var string[] $labels */
		$labels = [
			'As Is'
			, 'Uppercase first letter'
			, 'Uppercase Each Word\'s First Letter'
			,'UPPERCASE'
			,'lowercase'
		];
		return array_combine(
			$values
			,!$sample
			? $labels
			: array_map(function($value, $label) use($sample) {
				return sprintf('%s (%s)', self::apply($sample, $value), $label);
			}, $values, $labels)
			//: df_map([__CLASS__, 'apply'], $keys, [], $sample)
		);
	}
protected function map ( ) { /** @var string|null $sample */ $ sample = $ this -> f ( 'dfSample' ) ; /** @var string[] $values */ $ values = [ self :: _DEFAULT , self :: $ UCFIRST , self :: $ UCWORDS , self :: $ UPPERCASE , self :: $ LOWERCASE ] ; /** @var string[] $labels */ $ labels = [ 'As Is' , 'Uppercase first letter' , 'Uppercase Each Word\'s First Letter' , 'UPPERCASE' , 'lowercase' ] ; return array_combine ( $ values , ! $ sample ? $ labels : array_map ( function ( $ value , $ label ) use ( $ sample ) { return sprintf ( '%s (%s)' , self :: apply ( $ sample , $ value ) , $ label ) ; } , $ values , $ labels ) //: df_map([__CLASS__, 'apply'], $keys, [], $sample) ) ; }
2015-11-14
@override
@see \Df\Config\Source::map()
@used-by \Df\Config\Source::toOptionArray()
@return array(string => string)
2015 - 11 - 14