@@ -35,11 +35,23 @@ class Modeler implements RestRouteProvider, ToolContributor {
3535 /** @var array<string, Model> */
3636 protected array $ model_list = [];
3737
38+
39+
40+ /**
41+ * Construct the modeler.
42+
43+ * @param ModelFactory $model_factory
44+ */
3845 public function __construct ( ModelFactory $ model_factory ) {
3946 $ this ->model_factory = $ model_factory ;
4047 // should contain a list of loaded models
4148 }
4249
50+ /**
51+ * Initialize the modeler.
52+ *
53+ * @param string $project_path The project path.
54+ */
4355 public function init ( string $ project_path ): void {
4456 $ path = $ this ->get_path ( $ project_path );
4557 if ( ! $ path ) {
@@ -50,6 +62,10 @@ public function init( string $project_path ): void {
5062
5163 /**
5264 * Get custom path
65+ *
66+ * @param string $project_path The project path.
67+ *
68+ * @return string|null The path.
5369 */
5470 protected function get_path ( string $ project_path ): ?string {
5571
@@ -69,7 +85,9 @@ protected function get_path( string $project_path ): ?string {
6985 }
7086
7187 /**
72- * Load Models
88+ * Load Models.
89+ *
90+ * @param string $path The path to the model
7391 */
7492 protected function load ( string $ path ): void {
7593 if ( file_exists ( $ path ) ) {
@@ -176,6 +194,8 @@ protected function create( AbstractConfig $config ): void {
176194
177195 /**
178196 * Adds the model to a list
197+ *
198+ * @param Model $model The model.
179199 */
180200 protected function add ( Model $ model ): void {
181201 $ this ->model_list [ $ model ->get_name () ] = $ model ;
@@ -184,13 +204,17 @@ protected function add( Model $model ): void {
184204 /**
185205 * Return all loaded models.
186206 *
187- * @return array<string, \Saltus\WP\Framework\Models\ Model> Associative array keyed by model name.
207+ * @return array<string, Model> Associative array keyed by model name.
188208 */
189209 public function get_models (): array {
190210 return $ this ->model_list ;
191211 }
192212
193213 /**
214+ * Get rest routes.
215+ *
216+ * @param Modeler $modeler
217+ * @param ModelRestPolicy $policy
194218 * @return list<RestRouteDefinition>
195219 */
196220 public function get_rest_routes ( Modeler $ modeler , ModelRestPolicy $ policy ): array {
@@ -203,6 +227,10 @@ public function get_rest_routes( Modeler $modeler, ModelRestPolicy $policy ): ar
203227 }
204228
205229 /**
230+ * Get MCP tools.
231+ *
232+ * @param Modeler $modeler
233+ * @param ModelRestPolicy|null $policy
206234 * @return list<ToolInterface>
207235 */
208236 public function get_mcp_tools ( Modeler $ modeler , ?ModelRestPolicy $ policy = null ): array {
0 commit comments