@param $item

@return Swift_Message
544280
public function getPreSendMessage($item)
    {
        if (empty($this->preSendMessages[$item])) {
            return null;
        }
        return $this->preSendMessages[$item];
    }
891484
protected function inflateItem ($item)
    {
        if (isset($item->sub_button) & count($item->sub_button) > 0) {
            $object = new MenuItem($item->name, MenuItem::KEYWORD);
            foreach ($item->sub_button as $subItem) {
                $object = $object->withItem($this->inflateItem($subItem));
            }
        } else {
            if (isset($item->url)) {
                $object = new MenuItem($item->name, $item->type, $item->url);
            } elseif (isset($item->key)) {
                $object = new MenuItem($item->name, $item->type, $item->key);
            } else {
                $object = new MenuItem($item->name, $item->type);
            }
        }

        return $object;
    }
898948
public static function delete($item)
	{
		if (isset(static::$itemcache[$item]))
		{
			unset(static::$itemcache[$item]);
		}
		return \Arr::delete(static::$items, $item);
	}
862152
protected function label(Parameter $item)
    {
        $name = $item->name();

        if ($item instanceof Option) {
            $name = $item->short() . '|' . $item->long();
        }

        $variad = $item->variadic() ? '...' : '';

        if ($item->required()) {
            return "<$name$variad>";
        }

        return "[$name$variad]";
    }
102408
private function processItem($item) : JsonRpcResponse
    {
        try {
            if ($item instanceof \Exception) {
                // Exception will be caught just below and converted to response
                throw $item;
            }

            return $this->jsonRpcRequestHandler->processJsonRpcRequest($item);
        } catch (\Exception $exception) {
            return $this->exceptionHandler->getJsonRpcResponseFromException(
                $exception,
                $item instanceof JsonRpcRequest ? $item : null
            );
        }
    }
843975
private function getText($item, $safe = false) {
            // safe allows to execute PHP code..
            // Language::get should be used instead
            $ret = "";
            $ret = $this->filters($item, null, $safe);
            return Language::get($ret);
        }
969098
protected function convertItem($item)
    {
        foreach ($item as $key => $value) {
            if (!isset($this->converters[$key])) {
                continue;
            }

            foreach ($this->converters[$key] as $converter) {
                $item[$key] = call_user_func($converter, $item[$key]);
            }
        }

        return $item;
    }
571679
private function absolutePath($item) {

		// Sanity Check
		if (!is_string($item) && !$item instanceOf Model) throw new \UnexpectedValueException('Path should be a string or object.');

		// Item is already a fully-qualified URL
		if ((strpos($item, 'https://') !== false)) return $item;

		// Else, build URL
		$url  = $this->host;

		// Path from Item
		if (is_string($item)) $path = ltrim($item, '/');
		if ($item instanceOf Model) $path = strtolower(get_class($item)).'s/'.self::getId($item);

		// Return URL
		$auth = (!empty($this->token)) ? '?'.http_build_query(['auth' => $this->token]) : '';
		return $url.$path.'.json'.$auth;
	}
764824
private function _autoFilter($item)
	{
		# NULL
		if(null === $item) { return null; }

		# WHAT ELSE
		if(is_object($item) || is_resource($item)) {
			return $item;
		}

		# BOOL
		if(is_bool($item) || $item === 'false' || $item === 'true') {
			if($item === 'false') { $item = false; }
			elseif($item === 'true') { $item = true; }
			return $item;
		}

		# ARRAY
		if(is_array($item)) {
			foreach ($item as $k => $v) {
				$item[$k] = $this->_autoFilter($v);
			}
			return $item;
		}

		# INT
		$int = filter_var($item, FILTER_VALIDATE_INT);
		if($int !== false) { return $int; }

		# FLOAT
		if(preg_match('#^([\+\-])?(?!0[0-9]+)[0-9]+\.[0-9]+$#', $item)) {
			return floatval($item);
		}

		# STRING
		return filter_var($item, FILTER_SANITIZE_SPECIAL_CHARS);
	}
426143
public static function point(array $item): string
    {
        if (empty($item['file'])) {
            $result = '[internal function]';
        } else {
            $result = $item['file'];
            if (!empty($item['line'])) {
                $result .= '('.$item['line'].')';
            }
        }
        return $result;
    }
459992
protected function doClean(Item $item)
    {
        $item->setIntro(strip_tags($item->getIntro(), $this->allowedTags['intro']));
        $item->setContent(strip_tags($item->getContent(), $this->allowedTags['content']));

        return $item;
    }
844895
public function push($item)
    {
        if (!is_array($item)) {
            $this->items = array_merge($this->items, [$item]);
            return $this;
        }
        $this->items = array_merge($this->items, $item);
        return $this;
    }
136182
public function importItem(Item $item)
    {
        foreach ($this->data as $templateData) {
            foreach ($item->getData() as $itemData) {
                if ($itemData->getName() === $templateData->getName()) {
                    $templateData->setName($itemData->getName());
                    $templateData->setValue($itemData->getValue());
                    $templateData->setPrompt($itemData->getPrompt());
                }
            }
        }

        return $this;
    }
603454
protected function handleItemsCount($item)
    {
        if ($item->route
            && 'scaffold.index' === array_get($item->route, 0)
            && $module = array_get($item->route, '1.module')
        ) {
            $module = app('scaffold.module.'.$module);

            if ($count = $module->appendCount()) {
                $item->count = $count;
            }
        }

        return $item;
    }
1308297
public static function checkType($item)
    {
        if (is_string($item)) {
            // Item is a string; check to see if it's a URL or filepath
            if (filter_var($item, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
                // Item is a URL
                return Type::URL;
            } elseif (is_file(config('filer.path.absolute') . "/{$item}")) {
                // Item is a filepath
                return Type::FILEPATH;
            }
        } elseif (is_a($item, 'SplFileInfo')) {
            // Item is a file object
            return Type::FILE;
        }

        // Throw an exception if item doesn't match any known types
        throw new Exception('Unknown item type');
    }
1235651
public function prepare($item)
    {
        $prepared = array();

        foreach($item as $key => $value) {
            //if it's null
            if($value === null) {
                //set it and continue
                $prepared[$key] = null;
                continue;
            }

            //if is array
            if(is_array($value)) {
                //recursive
                $prepared[$key] = $this->prepare($value);
                continue;
            }

            //if it can be converted
            if(is_scalar($value)) {
                $prepared[$key] = (string) $value;
                continue;
            }

            //we tried our best ...
            $prepared[$key] = $value;
        }

        return $prepared;
    }
425253
protected function _objectToRDF($item) {
    $object = new stdClass();

    if(self::_isValue($item)) {
      $object->type = 'literal';
      $value = $item->{'@value'};
      $datatype = property_exists($item, '@type') ? $item->{'@type'} : null;

      // convert to XSD datatypes as appropriate
      if(is_bool($value)) {
        $object->value = ($value ? 'true' : 'false');
        $object->datatype = $datatype ? $datatype : self::XSD_BOOLEAN;
      } else if(is_double($value) || $datatype == self::XSD_DOUBLE) {
        // canonical double representation
        $object->value = preg_replace(
          '/(\d)0*E\+?/', '$1E', sprintf('%1.15E', $value));
        $object->datatype = $datatype ? $datatype : self::XSD_DOUBLE;
      } else if(is_integer($value)) {
        $object->value = strval($value);
        $object->datatype = $datatype ? $datatype : self::XSD_INTEGER;
      } else if(property_exists($item, '@language')) {
        $object->value = $value;
        $object->datatype = $datatype ? $datatype : self::RDF_LANGSTRING;
        $object->language = $item->{'@language'};
      } else {
        $object->value = $value;
        $object->datatype = $datatype ? $datatype : self::XSD_STRING;
      }
    } else {
      // convert string/node object to RDF
      $id = is_object($item) ? $item->{'@id'} : $item;
      $object->type = (strpos($id, '_:') === 0) ? 'blank node' : 'IRI';
      $object->value = $id;
    }

    // skip relative IRIs
    if($object->type === 'IRI' && !self::_isAbsoluteIri($object->value)) {
      return null;
    }

    return $object;
  }