Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alies-dev committed Mar 17, 2024
1 parent bfcd819 commit 5f1d4b0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<?php

namespace Illuminate\Contracts\Foundation;
namespace Illuminate\Foundation;

use Illuminate\Contracts\Container\Container;

interface Application extends Container
class Application
{
/**
* Get or check the current application environment.
* @param string|list<string> ...$environments
* @return string|bool
* @psalm-return ($environments is (string|non-empty-array) ? bool : string)
* @psalm-return ($environments is null ? string : bool)
*/
public function environment(...$environments) {}

Expand Down
20 changes: 0 additions & 20 deletions tests/Type/tests/Contracts/ApplicationTest.phpt

This file was deleted.

22 changes: 22 additions & 0 deletions tests/Type/tests/Foundation/ApplicationTest.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--FILE--
<?php declare(strict_types=1);

use \Illuminate\Foundation\Application;

function returns_bool_for_string_arg(Application $application, string $env): bool
{
return $application->environment($env);
}

/** @param non-empty-list<string> $envs */
function returns_bool_for_array_arg(Application $application, array $envs): bool
{
return $application->environment($envs);
}

function returns_string(Application $application): string
{
return $application->environment();
}
?>
--EXPECTF--

0 comments on commit 5f1d4b0

Please sign in to comment.