mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Merge pull request #8492 from HypeMC/consistent-docs-examples
Make template constraints examples in docs consistent
This commit is contained in:
commit
89b034acaf
@ -229,7 +229,7 @@ Templated types aren't limited to key-value pairs, and you can re-use templates
|
||||
```php
|
||||
<?php
|
||||
/**
|
||||
* @template T0 as array-key
|
||||
* @template T0 of array-key
|
||||
*
|
||||
* @template-implements IteratorAggregate<T0, int>
|
||||
*/
|
||||
|
@ -18,7 +18,7 @@ Let's suppose we want to make a userland implementation of PHP's numeric additio
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @template T as int|float
|
||||
* @template T of int|float
|
||||
* @param T $a
|
||||
* @param T $b
|
||||
* @return int|float
|
||||
@ -57,7 +57,7 @@ class A {
|
||||
const TYPE_INT = 1;
|
||||
|
||||
/**
|
||||
* @template T as int
|
||||
* @template T of int
|
||||
* @param T $i
|
||||
* @psalm-return (
|
||||
* T is self::TYPE_STRING
|
||||
|
@ -6,7 +6,7 @@ Emitted when using the `@extends`/`@implements` annotation to extend a class tha
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @template T as object
|
||||
* @template T of object
|
||||
*/
|
||||
class Base {}
|
||||
|
||||
|
@ -42,7 +42,7 @@ You can either broaden the type or you could, in certain situations, use templat
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @template T as string|null
|
||||
* @template T of string|null
|
||||
*/
|
||||
abstract class A {
|
||||
/** @var T */
|
||||
|
Loading…
Reference in New Issue
Block a user