Return the array of custom fields for an annotation.

@param DataService $annotation The Data Service annotation being discovered.

@return DiscoveredCustomField[] An array of custom field definitions.
358437
private function getCustomFields(DataService $annotation): array
    {
        $fields = $this->customFieldManager->getCustomFields();
        $customFields = [];
        if (isset($fields[$annotation->getService()][$annotation->getObjectType()])) {
            $customFields = $fields[$annotation->getService()][$annotation->getObjectType()];
        }

        return $customFields;
    }
1266819
protected function getField($field)
    {
        foreach ($this->getFields() as $annotatedField) {
            if ($annotatedField->name === $field) {
                return $annotatedField;
            }
        }

        return null;
    }
1044243
public function getCustomField(string $name, string $objectType, string $namespace): DiscoveredCustomField
    {
        $services = $this->discovery->getCustomFields();
        if (isset($services[$name][$objectType][$namespace])) {
            return $services[$name][$objectType][$namespace];
        }

        throw new \RuntimeException('Custom field not found.');
    }
170117
public function getAnnotations(\Reflector $Reflection)
    {
        $doc = $Reflection->getDocComment();
        if ($this->cache) {
            $key = $this->cache->getKey($doc);
            $ast = $this->cache->get($key);
            if (! $ast) {
                $ast = $this->parser->parse($doc);
                $this->cache->set($key, $ast);
            }
        } else {
            $ast = $this->parser->parse($doc);
        }

        return new AnnotationsBag($ast);
    }
1031348
private function getParamsFromAnnotationArray(array $annotations)
    {
        $params = array();
        foreach ($annotations as $annotation) {
            if ($annotation instanceof ParamInterface) {
                $params[$annotation->getName()] = $annotation;
            }
        }

        return $params;
    }
1099458
public function getAnnotations($filterFQN = NULL) {
    if (isset($filterFQN)) {
      return array_filter($this->annotations, function ($annotation) use ($filterFQN) {
        return $annotation->getAnnotationName() === $filterFQN;
      });
    }
    
    return $this->annotations;
  }
959967
public static function getFields($object)
    {
        $objectClass = BeanFactory::getObjectClass($object);
        if(!isset(static::$fields[$objectClass]))
        {
            $annotationsSet = AnnotationManager::getPropertiesAnnotations($objectClass, Column::class);
            $fields = [];
            foreach($annotationsSet as $propertyName => $annotations)
            {
                $annotation = $annotations[0];
                $fields[$annotation->name ?? $propertyName] = $annotation;
            }
            static::$fields[$objectClass] = $fields;
        }
        return static::$fields[$objectClass];
    }
984616
protected function createReturnsType(array $types, $annotated = false)
    {
        if (!$types) {
            return null;
        }

        $list = [];

        foreach ($types as $type) {
            $list[] = [
                'type' => $annotated ? 'return-type-annotation' : 'return-type-paramater',
                'data-type' => 'mixed' == $type ? 'variable' : $type,
                'mandatory' => false,
            ];
        }

        return [
            'type' => 'return-type',
            'list' => $list,
            'void' => empty($list),
        ];
    }
291693
public function getAnnotationsByType($type)
    {
        $annotations = [];
        foreach ($this->annotations as $an) {
            if ($an->getName() == $type) {
                $annotations[] = $an;
            }
        }

        return $annotations;
    }
698644
public function getJsonArray($annotation, $default = []) {
        $str = $this->getString($annotation);
        if (is_array($str)) {
            $rst = [];
            foreach ($str as $s) {
                $ss = preg_split('/\s+/', $s, 2);
                if (count($ss) == 2) {
                    list($k, $v) = $ss;
                } else {
                    $k = $ss[0];
                    $v = 1;
                }
                $rst[ $k ] = $v;
            }

            return $rst;
        }
        if ($str) {
            $str = trim($str);
            if (preg_match('#^[\[\{](.*)[\}\]]$#', $str)) {
                $rst = json_decode($str, true);
                if ($rst) {
                    return $rst;
                } else {
                    trigger_error($str . ' ' . json_last_error_msg(), E_USER_WARNING);
                }
            } else {
                @parse_str($str, $rst);
                if ($rst) {
                    return $rst;
                }
                trigger_error($str . ' Syntax error', E_USER_WARNING);
            }
        }

        return $default;
    }
1309612
def get_custom_annotations_for_alias(data_type):
    
    # annotations can only be applied to Aliases, but they can be wrapped in
    # Nullable. also, Aliases pointing to other Aliases don't automatically
    # inherit their custom annotations, so we might have to traverse.
    result = []
    data_type, _ = unwrap_nullable(data_type)
    while is_alias(data_type):
        result.extend(data_type.custom_annotations)
        data_type, _ = unwrap_nullable(data_type.data_type)
    return result
358828
public static function parseName(string $annotation)
	{
		$name = Strings::trim($annotation);
		$name = Strings::length($name) > 0 ? $name : NULL;

		return $name;
	}
98299
public function getMultiValues($annotation, $default = []) {
        $str = $this->getString($annotation);
        if (is_array($str)) {
            return $str;
        }
        if ($str) {
            return [$str];
        }

        return $default;
    }
1027765
public function getCustomFields($object)
    {
        $customFields = [];
        foreach ($object->getCustomFields() as $field) {
            $customFields[$field->getInternalFieldName()] = $field->getValue();
        }

        return $customFields;
    }
140877
public static List<Field> findFields(Class<?> type,
			Class<? extends Annotation> annotation) {
		List<Field> list = new ArrayList<Field>();
		while (type != null) {
			for (Field field : type.getDeclaredFields()) {
				if (field.getAnnotation(annotation) != null) {
					list.add(field);
				}
			}
			type = type.getSuperclass();
		}
		return list;
	}
964521
public function parse() {
		$annotations = [];
		preg_match_all(self::ANNOTATION_PATTERN, $this->rawDocComment, $found);
		foreach ($found[1] as $key => $value) {
			$arg = null;
			if (!empty($found[2][$key])) {
				$arg = substr(trim($found[2][$key]), 1, -1);
			}
			$annotations[] = new Annotation($value, $this->parseValue($found[3][$key]), $arg);
		}
		return $annotations;
	}
154569
public static function parseTimes(string $annotation)
	{
		$times = NULL;
		$annotation = Strings::trim($annotation);
		if (Strings::length($annotation)) {
			if ($values = static::splitMultipleValues($annotation)) {
				$times = [];
				foreach ($values as $time) {
					$times = array_merge($times, static::parseOneTime($time));
				}
				usort($times, function ($a, $b) {
					return $a < $b ? -1 : ($a > $b ? 1 : 0);
				});
			}
		}

		return $times ?: NULL;
	}