/** * {@inheritdoc} */ public function process($elongate = false) { $return = parent::process(false); if (isset($return['type'])) { $return['uri'] = $return['type']; unset($return['type']); } if (isset($return['uri'])) { // http://example.com if (preg_match('/^https?:/i', $return['uri'])) { $return['uri_hint'] = 'url'; if (!isset($return['description'])) { $return['description'] = $return['uri']; } } elseif (preg_match('/[\\w\\._\\-\\+]+@[\\w\\._\\-\\+]+\\./i', $return['uri'])) { $return['uri_hint'] = 'mail'; if (!isset($return['description'])) { $return['description'] = $return['uri']; } } elseif (preg_match('/^(\\w*)((:|@)(\\/\\/)?)(.*)$/', $return['uri'], $m) && ($data = Services::get($m[1], $m[5]))) { $return['uri_hint'] = 'url'; $return['uri'] = $data['uri']; if (!isset($return['description'])) { $return['description'] = $data['long']; } } } return $return; }
/** * {@inheritdoc} */ public function process($elongate = false) { $return = parent::process(true); if (isset($return['type'])) { $return['entity'] = $return['type']; unset($return['type']); } // Property if (preg_match('/(\\w+::)?\\$\\w+/', $return['entity'])) { $return['entity_hint'] = 'property'; } elseif (preg_match('/(\\w+::)?[\\w_]+(\\(\\))/', $return['entity'])) { $return['entity_hint'] = 'method'; } elseif (preg_match('/[\\w_]+/', $return['entity'])) { $return['entity_hint'] = 'class'; } elseif (preg_match('/https?:/', $return['entity'])) { // Used @see when @link was more appropriate $formatter = ConsoleUtil::formatters(); Inconsistency::add('Used @' . $this->tag . ' when @link was more appropriate. => ' . $formatter->gold->apply(SystemStore::get('_.current'))); $return['entity_hint'] = 'uri'; } // Do we need to resolve? if (strpos($return['entity'], '::') !== false) { list($class, $entity) = explode('::', $return['entity']); $class = $this->ancestry->resolveNamespace($class); $return['entity'] = implode('::', array($class, $entity)); } elseif ($return['entity_hint'] === 'method' || $return['entity_hint'] === 'property') { $class = $this->ancestry->getClass(); $return['entity'] = implode('::', array($class, $return['entity'])); } return $return; }
/** * {@inheritdoc} */ public function process($elongate = false) { // Used @var, which is deprecated if (strtolower($this->tag) === 'var') { $formatter = ConsoleUtil::formatters(); Inconsistency::add('The @var keyword is deprecated. Use @type instead. => ' . $formatter->gold->apply(SystemStore::get('_.current'))); } return parent::process(true); }
/** * {@inheritdoc} */ public function process($elongate = false) { $return = parent::process(true); if (isset($return['type'])) { $return['entity'] = $return['type']; unset($return['type']); } // Class if (preg_match('/\\w+/', $return['entity'])) { $return['entity'] = $this->ancestry->resolveNamespace($return['entity']); $return['entity_hint'] = 'class'; } return $return; }
/** * {@inheritdoc} */ public function process($elongate = false) { $return = parent::process(false); if (isset($return['type'])) { // If it starts with a digit, let's assume it's a version number if (preg_match('/^\\d+/', $return['type'])) { $return['version'] = $return['type']; } elseif (isset($return['description'])) { $return['description'] = $return['type'] . ' ' . $return['description']; } unset($return['type']); } return $return; }
/** * {@inheritdoc} */ public function process($elongate = false) { $return = parent::process(false); if (isset($return['type'])) { $return['uri'] = $return['type']; unset($return['type']); } if (isset($return['uri'])) { // http://example.com if (preg_match('/^https?:/i', $return['uri'])) { $return['uri_hint'] = 'url'; if (!isset($return['description'])) { $return['description'] = $return['uri']; } } } return $return; }
/** * {@inheritdoc} */ public function process($elongate = false) { return parent::process(true); }