mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Fix compatibility with Lumen (#1043)
* Fix compatibility with Lumen Fixes https://github.com/barryvdh/laravel-ide-helper/issues/1042 Got broken by https://github.com/barryvdh/laravel-ide-helper/pull/1026 TL;DR: can't use anything in the `Illuminate\Foundation` namespace without safety check, as it doesn't exist in Lumen. * Add helper to check for Laravel * Use helper to check for Laravel
This commit is contained in:
@@ -12,6 +12,9 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Changed
|
### Changed
|
||||||
- Implement DeferrableProvider [\#914 / kon-shou](https://github.com/barryvdh/laravel-ide-helper/pull/914)
|
- Implement DeferrableProvider [\#914 / kon-shou](https://github.com/barryvdh/laravel-ide-helper/pull/914)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Compatibility with Lumen [\#1043 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1043)
|
||||||
|
|
||||||
2020-09-07, 2.8.1
|
2020-09-07, 2.8.1
|
||||||
-----------------
|
-----------------
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper;
|
||||||
|
|
||||||
|
class Helpers
|
||||||
|
{
|
||||||
|
public static function isLaravel(): bool
|
||||||
|
{
|
||||||
|
return class_exists('Illuminate\Foundation\Application');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -110,7 +110,7 @@ class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProv
|
|||||||
{
|
{
|
||||||
$resolver = new EngineResolver();
|
$resolver = new EngineResolver();
|
||||||
$resolver->register('php', function () {
|
$resolver->register('php', function () {
|
||||||
if ((int) Application::VERSION < 8) {
|
if (Helpers::isLaravel() && (int) Application::VERSION < 8) {
|
||||||
return new PhpEngine();
|
return new PhpEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user