protected function _methods($class, $options = []) {
		$defaults = ['name' => null];
		$options += $defaults;

		$map = function($item) {
			if ($item->name[0] === '_') {
				return;
			}
			$modifiers = array_values(Inspector::invokeMethod('_modifiers', [$item]));
			$setAccess = array_intersect($modifiers, ['private', 'protected']) != [];

			if ($setAccess) {
				$item->setAccessible(true);
			}
			$args = [];

			foreach ($item->getParameters() as $arg) {
				$args[] = [
					'name' => $arg->getName(),
					'optional' => $arg->isOptional(),
					'description' => null
				];
			}
			$result = compact('modifiers', 'args') + [
				'docComment' => $item->getDocComment(),
				'name' => $item->getName()
			];
			if ($setAccess) {
				$item->setAccessible(false);
			}
			return $result;
		};

		$methods = Inspector::methods($class)->map($map, ['collect' => false]);
		$results = [];

		foreach (array_filter($methods) as $method) {
			$comment = Docblock::comment($method['docComment']);

			$name = $method['name'];
			$description = trim($comment['description'] . PHP_EOL . $comment['text']);
			$args = $method['args'];
			$return = null;

			foreach ($args as &$arg) {
				if (isset($comment['tags']['params']['$' . $arg['name']])) {
					$arg['description'] = $comment['tags']['params']['$' . $arg['name']]['text'];
				}
				$arg['usage'] = $arg['optional'] ? "[<{$arg['name']}>]" : "<{$arg['name']}>";
			}
			if (isset($comment['tags']['return'])) {
				$return = trim(strtok($comment['tags']['return'], ' '));
			}
			$results[$name] = compact('name', 'description', 'return', 'args');

			if ($name && $name == $options['name']) {
				return [$name => $results[$name]];
			}
		}
		return $results;
	}
protected function _methods($class, $options = []) {
		$defaults = ['name' => null];
		$options += $defaults;

		$map = function($item) {
			if ($item->name[0] === '_') {
				return;
			}
			$modifiers = array_values(Inspector::invokeMethod('_modifiers', [$item]));
			$setAccess = array_intersect($modifiers, ['private', 'protected']) != [];

			if ($setAccess) {
				$item->setAccessible(true);
			}
			$args = [];

			foreach ($item->getParameters() as $arg) {
				$args[] = [
					'name' => $arg->getName(),
					'optional' => $arg->isOptional(),
					'description' => null
				];
			}
			$result = compact('modifiers', 'args') + [
				'docComment' => $item->getDocComment(),
				'name' => $item->getName()
			];
			if ($setAccess) {
				$item->setAccessible(false);
			}
			return $result;
		};

		$methods = Inspector::methods($class)->map($map, ['collect' => false]);
		$results = [];

		foreach (array_filter($methods) as $method) {
			$comment = Docblock::comment($method['docComment']);

			$name = $method['name'];
			$description = trim($comment['description'] . PHP_EOL . $comment['text']);
			$args = $method['args'];
			$return = null;

			foreach ($args as &$arg) {
				if (isset($comment['tags']['params']['$' . $arg['name']])) {
					$arg['description'] = $comment['tags']['params']['$' . $arg['name']]['text'];
				}
				$arg['usage'] = $arg['optional'] ? "[<{$arg['name']}>]" : "<{$arg['name']}>";
			}
			if (isset($comment['tags']['return'])) {
				$return = trim(strtok($comment['tags']['return'], ' '));
			}
			$results[$name] = compact('name', 'description', 'return', 'args');

			if ($name && $name == $options['name']) {
				return [$name => $results[$name]];
			}
		}
		return $results;
	}
protected function _methods ( $ class , $ options = [ ] ) { $ defaults = [ 'name' => null ] ; $ options += $ defaults ; $ map = function ( $ item ) { if ( $ item -> name [ 0 ] === '_' ) { return ; } $ modifiers = array_values ( Inspector :: invokeMethod ( '_modifiers' , [ $ item ] ) ) ; $ setAccess = array_intersect ( $ modifiers , [ 'private' , 'protected' ] ) != [ ] ; if ( $ setAccess ) { $ item -> setAccessible ( true ) ; } $ args = [ ] ; foreach ( $ item -> getParameters ( ) as $ arg ) { $ args [ ] = [ 'name' => $ arg -> getName ( ) , 'optional' => $ arg -> isOptional ( ) , 'description' => null ] ; } $ result = compact ( 'modifiers' , 'args' ) + [ 'docComment' => $ item -> getDocComment ( ) , 'name' => $ item -> getName ( ) ] ; if ( $ setAccess ) { $ item -> setAccessible ( false ) ; } return $ result ; } ; $ methods = Inspector :: methods ( $ class ) -> map ( $ map , [ 'collect' => false ] ) ; $ results = [ ] ; foreach ( array_filter ( $ methods ) as $ method ) { $ comment = Docblock :: comment ( $ method [ 'docComment' ] ) ; $ name = $ method [ 'name' ] ; $ description = trim ( $ comment [ 'description' ] . PHP_EOL . $ comment [ 'text' ] ) ; $ args = $ method [ 'args' ] ; $ return = null ; foreach ( $ args as & $ arg ) { if ( isset ( $ comment [ 'tags' ] [ 'params' ] [ '$' . $ arg [ 'name' ] ] ) ) { $ arg [ 'description' ] = $ comment [ 'tags' ] [ 'params' ] [ '$' . $ arg [ 'name' ] ] [ 'text' ] ; } $ arg [ 'usage' ] = $ arg [ 'optional' ] ? "[<{$arg['name']}>]" : "<{$arg['name']}>" ; } if ( isset ( $ comment [ 'tags' ] [ 'return' ] ) ) { $ return = trim ( strtok ( $ comment [ 'tags' ] [ 'return' ] , ' ' ) ) ; } $ results [ $ name ] = compact ( 'name' , 'description' , 'return' , 'args' ) ; if ( $ name && $ name == $ options [ 'name' ] ) { return [ $ name => $ results [ $ name ] ] ; } } return $ results ; }
Get the methods for the class.

@param string $class
@param array $options
@return array
Get the methods for the class .