Skip to content

Commit

Permalink
Add BaseYii stub (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Gnandt <thomas.gnandt@mayflower.de>
  • Loading branch information
Khartir and Khartir authored May 1, 2020
1 parent 37e2fa1 commit d50c2a2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 87 deletions.
5 changes: 2 additions & 3 deletions extension.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
parameters:
yii2:
config_path: null
stubFiles:
- stubs/BaseYii.stub

parametersSchema:
yii2: structure([
Expand Down Expand Up @@ -38,8 +40,5 @@ services:
-
class: Proget\PHPStan\Yii2\Type\ContainerDynamicMethodReturnTypeExtension
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
-
class: Proget\PHPStan\Yii2\Type\YiiDynamicStaticMethodReturnTypeExtension
tags: [phpstan.broker.dynamicStaticMethodReturnTypeExtension]

- Proget\PHPStan\Yii2\ServiceMap(%yii2.config_path%)
84 changes: 0 additions & 84 deletions src/Type/YiiDynamicStaticMethodReturnTypeExtension.php

This file was deleted.

16 changes: 16 additions & 0 deletions stubs/BaseYii.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php declare(strict_types=1);

namespace yii;


class BaseYii
{
/**
* @template T
* @param class-string<T>|array{class: class-string<T>}|callable(): T $type
* @param array<mixed> $params
*
* @return T
*/
public static function createObject($type, array $params = []);
}

0 comments on commit d50c2a2

Please sign in to comment.