Skip to content

Commit

Permalink
Merge pull request #6 from sidz/add-model-stub-with-find-count-method
Browse files Browse the repository at this point in the history
Add Model.stub and define what find('count') returns
  • Loading branch information
sidz authored Apr 29, 2024
2 parents fa4edd9 + 16be682 commit 58bf6ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ parameters:
schemaPaths:
- app/Config/Schema/*.php
stubFiles:
- stubs/Model/Model.stub
- stubs/Routing/Router.stub
- stubs/Utility.stub
services:
Expand Down
12 changes: 12 additions & 0 deletions stubs/Model/Model.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

class Model
{
/**
* @param string $type
* @param array<string, mixed> $query
*
* @return ($type is 'count' ? int : (array<array-key, mixed>|int|null))
*/
public function find($type = 'first', $query = array()) {}
}

0 comments on commit 58bf6ae

Please sign in to comment.