Skip to content

Commit

Permalink
🚧 expect test to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-feek committed Jul 19, 2020
1 parent 669d0c0 commit d69377b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/ReturnTypeProvider/PathHelpersReturnTypeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

namespace Psalm\LaravelPlugin\ReturnTypeProvider;

use PhpParser\Node\Expr\MethodCall;
use Psalm\CodeLocation;
use Psalm\Context;
use Psalm\LaravelPlugin\ApplicationHelper;
use Psalm\Plugin\Hook\FunctionReturnTypeProviderInterface;
use Psalm\StatementsSource;
use Psalm\Type\Atomic\TLiteralString;
use Psalm\Type\Atomic\TNamedObject;
use Psalm\Type\Union;

final class PathHelpersReturnTypeProvider implements FunctionReturnTypeProviderInterface
Expand All @@ -20,7 +18,6 @@ final class PathHelpersReturnTypeProvider implements FunctionReturnTypeProviderI

public static function getFunctionIds(): array
{
return ['base_path'];
return array_keys(self::MAP);
}

Expand All @@ -41,6 +38,7 @@ public static function getFunctionReturnType(StatementsSource $statements_source
$argument = $argumentType->value;
}
}

$path = ApplicationHelper::getApp()->{$appMethod}($argument);

if (!$path) {
Expand Down
9 changes: 9 additions & 0 deletions tests/acceptance/PathHelpers.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ Feature: path helpers
When I run Psalm
Then I see these errors
| MissingFile | Cannot find file |

Scenario: basePath can be resolved from application instance
Given I have the following code
"""
require_once app()->basePath('routes/console.php');
"""
When I run Psalm
Then I see these errors
| MissingFile | Cannot find file |

0 comments on commit d69377b

Please sign in to comment.