Skip to content

Commit d50c2a2

Browse files
authored
Add BaseYii stub (#28)
Co-authored-by: Thomas Gnandt <thomas.gnandt@mayflower.de>
1 parent 37e2fa1 commit d50c2a2

File tree

3 files changed

+18
-87
lines changed

3 files changed

+18
-87
lines changed

extension.neon

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
parameters:
22
yii2:
33
config_path: null
4+
stubFiles:
5+
- stubs/BaseYii.stub
46

57
parametersSchema:
68
yii2: structure([
@@ -38,8 +40,5 @@ services:
3840
-
3941
class: Proget\PHPStan\Yii2\Type\ContainerDynamicMethodReturnTypeExtension
4042
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
41-
-
42-
class: Proget\PHPStan\Yii2\Type\YiiDynamicStaticMethodReturnTypeExtension
43-
tags: [phpstan.broker.dynamicStaticMethodReturnTypeExtension]
4443

4544
- Proget\PHPStan\Yii2\ServiceMap(%yii2.config_path%)

src/Type/YiiDynamicStaticMethodReturnTypeExtension.php

Lines changed: 0 additions & 84 deletions
This file was deleted.

stubs/BaseYii.stub

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace yii;
4+
5+
6+
class BaseYii
7+
{
8+
/**
9+
* @template T
10+
* @param class-string<T>|array{class: class-string<T>}|callable(): T $type
11+
* @param array<mixed> $params
12+
*
13+
* @return T
14+
*/
15+
public static function createObject($type, array $params = []);
16+
}

0 commit comments

Comments
 (0)