Lines Matching refs:value

160     foreach ($options as $key => $value) {
162 $Spyc->$key = $value;
190 foreach ($options as $key => $value) {
192 $Spyc->$key = $value;
270 foreach ($array as $key => $value) {
272 $string .= $this->_yamlize($key,$value,0,$previous_key, $first_key, $array);
287 …private function _yamlize($key,$value,$indent, $previous_key = -1, $first_key = 0, $source_array =… argument
288 if(is_object($value)) $value = (array)$value;
289 if (is_array($value)) {
290 if (empty ($value))
298 $string .= $this->_yamlizeArray($value,$indent);
299 } elseif (!is_array($value)) {
301 $string = $this->_dumpNode($key, $value, $indent, $previous_key, $first_key, $source_array);
317 foreach ($array as $key => $value) {
319 $string .= $this->_yamlize($key, $value, $indent, $previous_key, $first_key, $array);
336 …private function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key = 0, $source_arra… argument
338 …if (is_string ($value) && ((strpos($value,"\n") !== false || strpos($value,": ") !== false || strp…
339value,"*") !== false || strpos($value,"#") !== false || strpos($value,"<") !== false || strpos($va…
340value,"[") !== false || strpos($value,"]") !== false || strpos($value,"{") !== false || strpos($va…
341 substr ($value, -1, 1) == ':')
343 $value = $this->_doLiteralBlock($value,$indent);
345 $value = $this->_doFolding($value,$indent);
348 if ($value === array()) $value = '[ ]';
349 if ($value === "") $value = '""';
350 if (self::isTranslationWord($value)) {
351 $value = $this->_doLiteralBlock($value, $indent);
353 if (trim ($value) != $value)
354 $value = $this->_doLiteralBlock($value,$indent);
356 if (is_bool($value)) {
357 $value = $value ? "true" : "false";
360 if ($value === null) $value = 'null';
361 if ($value === "'" . self::REMPTY . "'") $value = null;
368 $string = $spaces.'- '.$value."\n";
373 $string = rtrim ($spaces.$key.': '.$value)."\n";
385 private function _doLiteralBlock($value,$indent) { argument
386 if ($value === "\n") return '\n';
387 if (strpos($value, "\n") === false && strpos($value, "'") === false) {
388 return sprintf ("'%s'", $value);
390 if (strpos($value, "\n") === false && strpos($value, '"') === false) {
391 return sprintf ('"%s"', $value);
393 $exploded = explode("\n",$value);
417 private function _doFolding($value,$indent) { argument
420 if ($this->_dumpWordWrap !== 0 && is_string ($value) && strlen($value) > $this->_dumpWordWrap) {
423 $wrapped = wordwrap($value,$this->_dumpWordWrap,"\n$indent");
424 $value = ">\n".$indent.$wrapped;
426 if ($this->setting_dump_force_quotes && is_string ($value) && $value !== self::REMPTY)
427 $value = '"' . $value . '"';
428 if (is_numeric($value) && is_string($value))
429 $value = '"' . $value . '"';
433 return $value;
436 private function isTrueWord($value) { argument
438 return in_array($value, $words, true);
441 private function isFalseWord($value) { argument
443 return in_array($value, $words, true);
446 private function isNullWord($value) { argument
448 return in_array($value, $words, true);
451 private function isTranslationWord($value) { argument
453 self::isTrueWord($value) ||
454 self::isFalseWord($value) ||
455 self::isNullWord($value)
466 private function coerceValue(&$value) { argument
467 if (self::isTrueWord($value)) {
468 $value = true;
469 } else if (self::isFalseWord($value)) {
470 $value = false;
471 } else if (self::isNullWord($value)) {
472 $value = null;
616 * @param string $value
619 private function _toType($value) { argument
620 if ($value === '') return "";
622 if ($this->setting_empty_hash_as_object && $value === '{}') {
626 $first_character = $value[0];
627 $last_character = substr($value, -1, 1);
631 if (!$value) break;
638 $value = str_replace('\n', "\n", $value);
640 return strtr(substr ($value, 1, -1), array ('\'\'' => '\'', '\\\''=> '\''));
641 return strtr(substr ($value, 1, -1), array ('\\"' => '"', '\\\''=> '\''));
644 if (strpos($value, ' #') !== false && !$is_quoted)
645 $value = preg_replace('/\s+#(.+)$/','',$value);
649 $innerValue = trim(substr ($value, 1, -1));
653 $value = array();
655 $value[] = $this->_toType($v);
657 return $value;
660 if (strpos($value,': ')!==false && $first_character != '{') {
661 $array = explode(': ',$value);
664 $value = trim(implode(': ',$array));
665 $value = $this->_toType($value);
666 return array($key => $value);
670 $innerValue = trim(substr ($value, 1, -1));
688 if ($value == 'null' || $value == 'NULL' || $value == 'Null' || $value == '' || $value == '~') {
692 if ( is_numeric($value) && preg_match ('/^(-|)[1-9]+[0-9]*$/', $value) ){
693 $intvalue = (int)$value;
695 $value = $intvalue;
696 return $value;
699 if ( is_string($value) && preg_match('/^0[xX][0-9a-fA-F]+$/', $value)) {
701 return hexdec($value);
704 $this->coerceValue($value);
706 if (is_numeric($value)) {
707 if ($value === '0') return 0;
708 if (rtrim ($value, 0) === $value)
709 $value = (float)$value;
710 return $value;
713 return $value;
777 foreach ($explode as $key => $value) {
778 if (strpos($value,'YAMLSeq') !== false) {
780 $explode[$key] = str_replace(('YAMLSeq'.$seqk.'s'),$seq,$value);
781 $value = $explode[$key];
789 foreach ($explode as $key => $value) {
790 if (strpos($value,'YAMLMap') !== false) {
792 $explode[$key] = str_replace(('YAMLMap'.$mapk.'s'), $map, $value);
793 $value = $explode[$key];
802 foreach ($explode as $key => $value) {
803 while (strpos($value,'YAMLString') !== false) {
804 $explode[$key] = preg_replace('/YAMLString/',$saved_strings[$stringi],$value, 1);
807 $value = $explode[$key];
815 foreach ($explode as $key => $value) {
816 while (strpos($value,'YAMLEmpty') !== false) {
817 $explode[$key] = preg_replace('/YAMLEmpty/', '', $value, 1);
818 $value = $explode[$key];
824 foreach ($explode as $key => $value) {
825 if (strpos($value,'YAMLSeq') !== false) {
828 if (strpos($value,'YAMLMap') !== false) {
831 if (strpos($value,'YAMLString') !== false) {
834 if (strpos($value,'YAMLEmpty') !== false) {
859 $value = $this->result;
861 $value = $value[$k];
864 return $value;
886 $value = isset($incoming_data[$key]) ? $incoming_data[$key] : null;
891 $this->result[$key] = $value;
893 $this->result[] = $value; end ($this->result); $key = key ($this->result);
909 $value = $this->referenceContentsByAlias($this->_containsGroupAlias);
918 $_arr = array_merge ($_arr, $value);
921 $_arr = array ($key=>$value);
923 $_arr[$key] = $value;
925 if (!is_array ($_arr)) { $_arr = array ($value); $key = 0; }
926 else { $_arr[] = $value; end ($_arr); $key = key ($_arr); }
942 if (is_array ($value)) {
943 $k = key ($value);
1062 private static function unquote ($value) { argument
1063 if (!$value) return $value;
1064 if (!is_string($value)) return $value;
1065 if ($value[0] == '\'') return trim ($value, '\'');
1066 if ($value[0] == '"') return trim ($value, '"');
1067 return $value;
1082 private function checkKeysInValue($value) { argument
1083 if (strchr('[{"\'', $value[0]) === false) {
1084 if (strchr($value, ': ') !== false) {
1085 throw new Exception('Too many keys: '.$value);
1117 $value = trim(str_replace($matches[1],'',$line));
1123 $value = trim(implode(': ', $explode));
1124 $this->checkKeysInValue($value);
1127 $value = $this->_toType($value);
1130 $array[$key] = $value;
1142 $value = trim(substr($line,1));
1143 $value = $this->_toType($value);
1144 if ($this->isArrayElement($value)) {
1145 $value = $this->returnArrayElement($value);
1147 $array[] = $value;