public function find($key, $filter = null) {
		if (!$this->has($key)) {
			return [];
		}
		
		$annotations = [];
		
		foreach ($this->names[$key] as $index) {
			if (!is_int($filter)) {
				$annotations[] = $this->annotations[$index];
				continue;
			}
			
			$annotation = $this->annotations[$index];
			$flags = 0;
			
			//match value type
			if ($filter & Filter::TYPE_ALL) {
				$value = $annotation->getValue();
				if (is_null($value)) {
					$flags |= Filter::TYPE_NULL;
				}
				elseif (is_string($value)) {
					$flags |= Filter::TYPE_STRING;
				}
				elseif (is_int($value)) {
					$flags |= Filter::TYPE_INTEGER;
				}
				elseif (is_float($value)) {
					$flags |= Filter::TYPE_FLOAT;
				}
				elseif (is_bool($value)) {
					$flags |= Filter::TYPE_BOOLEAN;
				}
				elseif (is_array($value)) {
					$flags |= Filter::TYPE_ARRAY;
				}
				elseif (id_object($value)) {
					$flags |= Filter::TYPE_OBJECT;
				}
			}
			
			//match argument filter
			if ($filter & Filter::HAS_ARGUMENT || $filter & Filter::NOT_HAS_ARGUMENT) {
				if ($annotation->getArgument()) {
					$flags |= Filter::HAS_ARGUMENT;
				}
				else {
					$flags |= Filter::NOT_HAS_ARGUMENT;
				}
			}
			
			//add annotation if it meets all requirements
			if (($flags & $filter) == $flags) {
				$annotations[] = $annotation;
			}
		}
		
		return $annotations;
	}
public function find($key, $filter = null) {
		if (!$this->has($key)) {
			return [];
		}
		
		$annotations = [];
		
		foreach ($this->names[$key] as $index) {
			if (!is_int($filter)) {
				$annotations[] = $this->annotations[$index];
				continue;
			}
			
			$annotation = $this->annotations[$index];
			$flags = 0;
			
			//match value type
			if ($filter & Filter::TYPE_ALL) {
				$value = $annotation->getValue();
				if (is_null($value)) {
					$flags |= Filter::TYPE_NULL;
				}
				elseif (is_string($value)) {
					$flags |= Filter::TYPE_STRING;
				}
				elseif (is_int($value)) {
					$flags |= Filter::TYPE_INTEGER;
				}
				elseif (is_float($value)) {
					$flags |= Filter::TYPE_FLOAT;
				}
				elseif (is_bool($value)) {
					$flags |= Filter::TYPE_BOOLEAN;
				}
				elseif (is_array($value)) {
					$flags |= Filter::TYPE_ARRAY;
				}
				elseif (id_object($value)) {
					$flags |= Filter::TYPE_OBJECT;
				}
			}
			
			//match argument filter
			if ($filter & Filter::HAS_ARGUMENT || $filter & Filter::NOT_HAS_ARGUMENT) {
				if ($annotation->getArgument()) {
					$flags |= Filter::HAS_ARGUMENT;
				}
				else {
					$flags |= Filter::NOT_HAS_ARGUMENT;
				}
			}
			
			//add annotation if it meets all requirements
			if (($flags & $filter) == $flags) {
				$annotations[] = $annotation;
			}
		}
		
		return $annotations;
	}
public function find ( $ key , $ filter = null ) { if ( ! $ this -> has ( $ key ) ) { return [ ] ; } $ annotations = [ ] ; foreach ( $ this -> names [ $ key ] as $ index ) { if ( ! is_int ( $ filter ) ) { $ annotations [ ] = $ this -> annotations [ $ index ] ; continue ; } $ annotation = $ this -> annotations [ $ index ] ; $ flags = 0 ; //match value type if ( $ filter & Filter :: TYPE_ALL ) { $ value = $ annotation -> getValue ( ) ; if ( is_null ( $ value ) ) { $ flags |= Filter :: TYPE_NULL ; } elseif ( is_string ( $ value ) ) { $ flags |= Filter :: TYPE_STRING ; } elseif ( is_int ( $ value ) ) { $ flags |= Filter :: TYPE_INTEGER ; } elseif ( is_float ( $ value ) ) { $ flags |= Filter :: TYPE_FLOAT ; } elseif ( is_bool ( $ value ) ) { $ flags |= Filter :: TYPE_BOOLEAN ; } elseif ( is_array ( $ value ) ) { $ flags |= Filter :: TYPE_ARRAY ; } elseif ( id_object ( $ value ) ) { $ flags |= Filter :: TYPE_OBJECT ; } } //match argument filter if ( $ filter & Filter :: HAS_ARGUMENT || $ filter & Filter :: NOT_HAS_ARGUMENT ) { if ( $ annotation -> getArgument ( ) ) { $ flags |= Filter :: HAS_ARGUMENT ; } else { $ flags |= Filter :: NOT_HAS_ARGUMENT ; } } //add annotation if it meets all requirements if ( ( $ flags & $ filter ) == $ flags ) { $ annotations [ ] = $ annotation ; } } return $ annotations ; }
Retrieves a list of annotations by name
@param string $key
@param int $filter
@return array
Retrieves a list of annotations by name