Skip to content

Commit

Permalink
Add links to custom types
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Dec 23, 2024
1 parent f593e6a commit b74b077
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>tests/Ticket/*.php</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectAnnotationsGroup">
<exclude-pattern>src/Schema/Blueprint.php</exclude-pattern>
</rule>
</ruleset>
12 changes: 10 additions & 2 deletions src/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use function key;

/**
* @link https://www.mongodb.com/docs/atlas/atlas-search/define-field-mappings/#std-label-fts-field-mappings
* @phpstan-type TypeSearchIndexField array{
* type: 'boolean'|'date'|'dateFacet'|'objectId'|'stringFacet'|'uuid',
* } | array{
Expand Down Expand Up @@ -51,6 +52,7 @@
* multi?: array<string, array<mixed>>,
* norms?: 'include'|'omit',
* }
* @link https://www.mongodb.com/docs/atlas/atlas-search/analyzers/character-filters/
* @phpstan-type TypeSearchIndexCharFilter array{
* type: 'icuNormalize'|'persian',
* } | array{
Expand All @@ -60,25 +62,30 @@
* type: 'mapping',
* mappings?: array<string, string>,
* }
* @link https://www.mongodb.com/docs/atlas/atlas-search/analyzers/token-filters/
* @phpstan-type TypeSearchIndexTokenFilter array{type: string, ...}
* @link https://www.mongodb.com/docs/atlas/atlas-search/analyzers/custom/
* @phpstan-type TypeSearchIndexAnalyzer array{
* name: string,
* charFilters?: TypeSearchIndexCharFilter,
* tokenizer: array{type: string},
* tokenFilters?: TypeSearchIndexTokenFilter,
* }
* @link https://www.mongodb.com/docs/atlas/atlas-search/stored-source-definition/#std-label-fts-stored-source-definition
* @phpstan-type TypeSearchIndexStoredSource bool | array{
* includes: array<string>,
* } | array{
* excludes: array<string>,
* }
* @link https://www.mongodb.com/docs/manual/reference/command/createSearchIndexes/#std-label-search-index-definition-create
* @phpstan-type TypeSearchIndexDefinition array{
* analyser?: string,
* analyzers?: TypeSearchIndexAnalyzer[],
* searchAnalyzer?: string,
* mappings: array{dynamic: true} | array{dynamic?: bool, fields: array<string, TypeSearchIndexField>},
* storedSource?: TypeSearchIndexStoredSource,
* }
* @link https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/#atlas-vector-search-index-fields
* @phpstan-type TypeVectorSearchIndexField array{
* type: 'vector',
* path: string,
Expand All @@ -89,6 +96,7 @@
* type: 'filter',
* path: string,
* }
* @link https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/#atlas-vector-search-index-fields
* @phpstan-type TypeVectorSearchIndexDefinition array{
* fields: array<string, TypeVectorSearchIndexField>,
* }
Expand Down Expand Up @@ -383,7 +391,7 @@ public function sparse_and_unique($columns = null, $options = [])
/**
* Create an Atlas Search Index.
*
* @see https://www.mongodb.com/docs/manual/reference/command/createSearchIndexes/
* @see https://www.mongodb.com/docs/manual/reference/command/createSearchIndexes/#std-label-search-index-definition-create
*
* @phpstan-param TypeSearchIndexDefinition $definition
*/
Expand All @@ -397,7 +405,7 @@ public function searchIndex(array $definition, string $name = 'default'): static
/**
* Create an Atlas Vector Search Index.
*
* @see https://www.mongodb.com/docs/atlas/atlas-vector-search/
* @see https://www.mongodb.com/docs/manual/reference/command/createSearchIndexes/#std-label-vector-search-index-definition-create
*
* @phpstan-param TypeVectorSearchIndexDefinition $definition
*/
Expand Down

0 comments on commit b74b077

Please sign in to comment.