Awesome
<!-- Plugin description --> <p align="center"> <img src="https://github.com/olivernybroe/collector-intellij/blob/main/art/header.png?raw=1" alt="collector header"> <p align="center"> <a href="https://github.com/olivernybroe/collections-intellij"><img alt="GitHub Workflow Status (master)" src="https://github.com/olivernybroe/collections-intellij/workflows/Build/badge.svg"></a> <a href="https://plugins.jetbrains.com/plugin/15246"><img alt="Total Downloads" src="https://img.shields.io/jetbrains/plugin/d/15246"></a> <a href="https://plugins.jetbrains.com/plugin/15246"><img alt="Latest Version" src="https://img.shields.io/jetbrains/plugin/v/15246"></a> </p> </p>Collector - A collection's plugin for PhpStorm
This plugin adds support for Laravel Collections.
It contains a bunch of handy refactorings for making your collections better. It can also convert normal PHP statements into collections.
Installation
The plugin has no stable version, only manual and EAP is possible.
-
Using IDE built-in plugin system:
<kbd>Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "Collector"</kbd> > <kbd>Install Plugin</kbd>
-
Manually:
Download the latest release and install it manually using <kbd>Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
Configuration
:warning: The inspections might be disabled by default! Go to preferences for enabling them.
All the features are added as inspections in PhpStorm, this means you can disable the ones you don't like or change how severe the warning are on them.
For example, by default refactoring foreach
to collection is not highlighting the text.
However, if you would like to enforce yourself to never use foreach
, you can change the severity to error.
Features
foreach
to collection
array_map
to collection
map(...)->flatten(1)
to flatMap
Remove nested collections
Closure to arrow functions
where(...)->first()
to firstWhere
where(...)->isNotEmpty()
to contains
Credits
Special thanks to Caneco for the logo ✨
<!-- Plugin description end -->Plugin based on the IntelliJ Platform Plugin Template.