Skip to content

Commit

Permalink
Remove offical support for Lumen (barryvdh#1425)
Browse files Browse the repository at this point in the history
I'm proposing to drop official suport for Lumen for the following reasons:
- Lumen itself is dead, per [1]
  > **Note:** In the years since releasing Lumen, PHP has made a variety of wonderful performance improvements. For this reason, along with the availability of [Laravel Octane](https://laravel.com/docs/octane), we no longer recommend that you begin new projects with Lumen. Instead, we recommend always beginning new projects with [Laravel](https://laravel.com).

  Laravel Octact is just Laravel and no one using ide-helper with it
  needs anything special.
- For now, the change is mostly on the logistics side (readme, run tests,
  issues). In the past we had some special code but over time this was
  already removed.
  For now people still can use it and nothing will break out of the blue,
  but eventually it might

There are a only a few Lumen related issues open currently which would
be closed by this (barryvdh#1105, barryvdh#1069, barryvdh#438).

[1] laravel/lumen@69b2657

Co-authored-by: Barry vd. Heuvel <barry@fruitcake.nl>
  • Loading branch information
2 people authored and d3v2a committed Feb 16, 2024
1 parent b882f79 commit b84bee8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 133 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ labels: bug
### Versions:
- ide-helper Version: #.#.#
- Laravel Version: #.#.# <!-- remove if not applicable -->
- Lumen Version: #.#.# <!-- remove if not applicable -->
- PHP Version: #.#.#

### Description:
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/3_Support_question.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ labels: question
### Versions:
- ide-helper Version: #.#.#
- Laravel Version: #.#.# <!-- remove if not applicable -->
- Lumen Version: #.#.# <!-- remove if not applicable -->
- PHP Version: #.#.#

### Question:
Expand Down
64 changes: 0 additions & 64 deletions .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,6 @@ on:
- cron: '0 0 * * *'

jobs:
php-lumen-integration-tests:
runs-on: ubuntu-20.04
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
matrix:
php: [8.2, 8.1, 8.0, 7.4, 7.3]
lumen: [8.*]
name: P${{ matrix.php }} - Lumen${{ matrix.lumen }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: src

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install dependencies
run: |
composer create-project --prefer-dist laravel/lumen:${{ matrix.lumen }} --no-progress sample
cd sample
composer config minimum-stability dev
composer require "league/flysystem:^1" --no-update --no-progress
composer update --prefer-stable --prefer-dist --no-progress
- name: Add package from source
run: |
cd sample
sed -e 's|"type": "project",|&\n"repositories": [ { "type": "path", "url": "../src" } ],|' -i composer.json
composer require --dev "barryvdh/laravel-ide-helper:*"
- name: Insert service provider
run: sed -e 's|// \$app->register(App\\\Providers\\\EventServiceProvider::class);|&\n$app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);|' -i sample/bootstrap/app.php

- name: Execute generate run
run: |
cd sample
php artisan ide-helper:generate
- name: Execute meta run
run: |
cd sample
php artisan ide-helper:meta -v
- name: Check file existence
run: |
ls sample/_ide_helper.php
ls sample/.phpstorm.meta.php
- name: Check logs
run: |
if [ `ls -1q "sample/storage/logs/" | wc -l` -gt 0 ]; then
for logfile in sample/storage/logs/*; do
echo "-- $logfile --"
cat $logfile
done
exit 1
fi
php-laravel-integration-tests:
runs-on: ubuntu-20.04
timeout-minutes: 15
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ All notable changes to this project will be documented in this file.
[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v2.13.0...master)
--------------

### Changed
- Official support for Lumen has been dropped [#1425 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1425)
- Refactor resolving of null information for custom casted attribute types [#1330 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1330)

### Fixed
- Add support for attribute accessors marked as protected. [#1339 / pindab0ter](https://github.com/barryvdh/laravel-ide-helper/pull/1339)

### Added
- Add support for `immutable_date:*` and `immutable_datetime:*` casts. [#1380 / thekonz](https://github.com/barryvdh/laravel-ide-helper/pull/1380)

### Changed
- Refactor resolving of null information for custom casted attribute types [#1330 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1330)

2023-02-04, 2.13.0
------------------

Expand Down
64 changes: 0 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ It supports Laravel 8+ and PHP 7.3+
- [Automatic PHPDocs generation for Laravel Fluent methods](#automatic-phpdocs-generation-for-laravel-fluent-methods)
- [Auto-completion for factory builders](#auto-completion-for-factory-builders)
- [PhpStorm Meta for Container instances](#phpstorm-meta-for-container-instances)
- [Usage with Lumen](#usage-with-lumen)
- [Enabling Facades](#enabling-facades)
- [Adding the Service Provider](#adding-the-service-provider)
- [Adding Additional Facades](#adding-additional-facades)
- [License](#license)

## Installation
Expand Down Expand Up @@ -404,66 +400,6 @@ app(App\SomeClass::class);
You can change the generated filename via the config `meta_filename`. This can be useful for cases where you want to take advantage of PhpStorm's support of the _directory_ `.phpstorm.meta.php/`: all files placed there are parsed, should you want to provide additional files to PhpStorm.

## Usage with Lumen

This package is focused on Laravel development, but it can also be used in Lumen with some workarounds.
Because Lumen works a little different, as it is like a bare bone version of Laravel and the main configuration
parameters are instead located in `bootstrap/app.php`, some alterations must be made.

### Enabling Facades

While Laravel IDE Helper can generate automatically default Facades for code hinting,
Lumen doesn't come with Facades activated. If you plan in using them, you must enable
them under the `Create The Application` section, uncommenting this line:

```php
// $app->withFacades();
```

From there, you should be able to use the `create_alias()` function to add additional Facades into your application.

### Adding the Service Provider

You can install Laravel IDE Helper in `app/Providers/AppServiceProvider.php`,
and uncommenting this line that registers the App Service Providers, so it can properly load.

```php
// $app->register(App\Providers\AppServiceProvider::class);
```

If you are not using that line, that is usually handy to manage gracefully multiple Laravel/Lumen installations,
you will have to add this line of code under the `Register Service Providers` section of your `bootstrap/app.php`.

```php
if ($app->environment() !== 'production') {
$app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
```

After that, Laravel IDE Helper should work correctly. During the generation process,
the script may throw exceptions saying that some Class(s) doesn't exist or there are some undefined indexes.
This is normal, as Lumen has some default packages stripped away, like Cookies, Storage and Session.
If you plan to add these packages, you will have to add them manually and create additional Facades if needed.

### Adding Additional Facades

Currently, Lumen IDE Helper doesn't take into account additional Facades created under `bootstrap/app.php` using `create_alias()`,
so you need to create a `config/app.php` file and add your custom aliases under an `aliases` array again, like so:

```php
return [
'aliases' => [
'CustomAliasOne' => Example\Support\Facades\CustomAliasOne::class,
'CustomAliasTwo' => Example\Support\Facades\CustomAliasTwo::class,
//...
]
];
```

After you run `php artisan ide-helper:generate`, it's recommended (but not mandatory) to rename `config/app.php` to something else,
until you have to re-generate the docs or after passing to production environment.
Lumen 5.1+ will read this file for configuration parameters if it is present, and may overlap some configurations if it is completely populated.

## License

The Laravel IDE Helper Generator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
Expand Down

0 comments on commit b84bee8

Please sign in to comment.