-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from YuriiDorosh/fixes/hot_fixes
Fixes/hot fixes
- Loading branch information
Showing
4 changed files
with
21 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,6 @@ | |
</projectFiles> | ||
|
||
<stubs> | ||
<file name="../psalm/stubs.php" /> | ||
<file name="../psalm/psalm.php" /> | ||
</stubs> | ||
</psalm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
<?php | ||
|
||
/** | ||
* Stub file for Psalm to recognize CodeIgniter framework functions and classes. | ||
* Stub file for Psalm to recognize CodeIgniter framework functions and classes, including the global view function. | ||
*/ | ||
|
||
namespace Psalm\Internal\Codebase; | ||
// Remove the namespace declaration to declare the `view` function in the global namespace. | ||
// Remove the namespace Psalm\Internal\Codebase; | ||
|
||
class InternalCodebase | ||
{ | ||
/** | ||
* Initializes framework functions for Psalm to recognize. | ||
*/ | ||
public function initFunctions(): void | ||
{ | ||
// Fully qualify the namespace when checking for the function's existence | ||
if (!function_exists(__NAMESPACE__ . '\\view')) { | ||
/** | ||
* Declare the stub function within the current namespace. | ||
* @psalm-suppress UndefinedFunction | ||
*/ | ||
function view(string $view, array $options = []): string | ||
{ | ||
return ''; | ||
} | ||
} | ||
} | ||
/** | ||
* A stub for the global `view` function provided by CodeIgniter. | ||
* | ||
* @param string $view Name of the view file to load. | ||
* @param array $options Data to pass to the view. | ||
* @return string Rendered view content as a string. | ||
*/ | ||
function view(string $view, array $options = []): string { | ||
// Mock implementation for Psalm's benefit. | ||
return ''; | ||
} |