Skip to content

Upstream #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8489bf3
Bump dependencies for Laravel 9
laravel-shift Feb 5, 2022
1b88b71
add composer/pcre
pktharindu Feb 10, 2022
a9daff5
Create ClassMapGenerator.php
pktharindu Feb 10, 2022
4969fb5
Replace composer with copy of classmap generator
pktharindu Feb 10, 2022
61c12aa
Merge pull request #8 from laravel-shift/l9-compatibility
Wulfheart Feb 18, 2022
ca0faf2
Merge branch 'ClassMapGenerator'
Wulfheart Feb 18, 2022
c9fa855
WIP
Wulfheart Feb 19, 2022
aa172a6
ActionFactory Test start
Wulfheart Feb 19, 2022
14af5b6
ActionFactory creation
Wulfheart Feb 19, 2022
293a2e4
Expectations
Wulfheart Feb 19, 2022
ce3e658
Creation of classmap from PhpDocumentor Reflection
Wulfheart Feb 19, 2022
25023a3
Fix in ClassMap Lookup
Wulfheart Feb 19, 2022
cd274b2
ActionInfo Cleanup
Wulfheart Feb 19, 2022
c1ab4ed
Unneeded classes removed
Wulfheart Feb 19, 2022
3c5ebea
Tests moved
Wulfheart Feb 19, 2022
32eb825
Tests moved again
Wulfheart Feb 19, 2022
1ff9eff
Updated AsObjectGenerator
Wulfheart Feb 19, 2022
cda6c6e
Updated AsControllerGenerator [do nothing]
Wulfheart Feb 19, 2022
d34d15d
DocBlockGenerator base Find Method Helper
Wulfheart Feb 19, 2022
52b7ebc
Refactored AsObject to FindMethod helper
Wulfheart Feb 19, 2022
a52ebbf
AsJobGenerator tested
Wulfheart Feb 19, 2022
54402f1
AsListenerGenerator and AsCommandGenerator do not need any action
Wulfheart Feb 19, 2022
fa8d1f5
Namespace added
Wulfheart Feb 19, 2022
4c16953
BuildIdeHelper.php reformatted
Wulfheart Feb 19, 2022
6e2b9d5
ActionInfo store FQSEN
Wulfheart Feb 19, 2022
5333b9d
Snapshot testing added
Wulfheart Feb 19, 2022
9363f5a
Command updated
Wulfheart Feb 19, 2022
07a5cf1
ClassMapGenerator.php removed
Wulfheart Feb 19, 2022
567a66b
Test updated
Wulfheart Feb 19, 2022
5aed39f
Update README.md
Wulfheart Feb 19, 2022
d239149
Failing Intersection Type
Wulfheart Feb 19, 2022
d2723bf
Still failing
Wulfheart Feb 20, 2022
24684db
Still failing
Wulfheart Feb 20, 2022
6ed7290
Added default parameters in methods (custom method class)
Wulfheart Feb 20, 2022
cbd867a
Merge remote-tracking branch 'origin/main'
Wulfheart Feb 20, 2022
17f088f
Bump dependencies for Laravel 10
laravel-shift Jan 30, 2023
c2dfd78
Update composer.json
Wulfheart Mar 3, 2023
b3aac52
Merge pull request #16 from laravel-shift/l10-compatibility
Wulfheart Mar 3, 2023
4e23738
Update composer.json
Wulfheart Jun 26, 2023
052e2e3
Add support for PHP 8.2
goper-leo Oct 28, 2023
9013d51
Merge pull request #20 from goper-leo/support-php8.2
Wulfheart Oct 28, 2023
5ead8c5
Bump dependencies for Laravel 11
laravel-shift Mar 1, 2024
b81b0b1
Merge pull request #21 from laravel-shift/l11-compatibility
Wulfheart Mar 15, 2024
62a7fd3
update dependencies
Nezimed Mar 15, 2024
6cc7794
Merge pull request #23 from Nezimed/update-dependencies
Wulfheart Mar 17, 2024
5326a1b
Update README.md
Wulfheart Mar 17, 2024
3f03d39
fix incompatible types with phpdocumentor/reflection-docblock (5.4.0)
olieady Apr 12, 2024
aebcf83
change scripts back to an arra
olieady Apr 12, 2024
cba5026
Merge pull request #24 from olieady/fix-type-issues-with-new-versions…
Wulfheart Apr 12, 2024
97c00b3
Updated Composer JSON structure
edwinvdpol Apr 26, 2024
e1d5b77
Merge pull request #25 from edwinvdpol/patch-1
Wulfheart Apr 26, 2024
c8714b3
Bump phpdocumentor/reflection
nick-potts Aug 27, 2024
48e9d7c
Merge pull request #26 from nick-potts/main
Wulfheart Aug 30, 2024
aaecb90
Bump dependencies for Laravel 12
laravel-shift Feb 16, 2025
b941a73
Merge pull request #27 from laravel-shift/l12-compatibility
Wulfheart Mar 2, 2025
aaf8997
Bump lorisleiva/lody
adrum Mar 2, 2025
fe89650
Merge pull request #28 from adrum/patch-1
Wulfheart Mar 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Laravel Actions IDE Helper

This packages generates IDE helpers for [Laravel Actions v2](https://github.com/lorisleiva/laravel-actions). Currently under development 🚧. Feedback appreciated. Discussion at https://github.com/lorisleiva/laravel-actions/issues/117.
This packages generates IDE helpers for [Laravel Actions v2](https://github.com/lorisleiva/laravel-actions). Feedback appreciated. Discussion at https://github.com/lorisleiva/laravel-actions/issues/117.

## YOLO-ware

As I don't use Laravel Actions anymore I decided to go into `YOLO-mode` with this project. That means:

1. **No guarantees**
2. **Community-powered fixes**: Something doesn't work, you notice it you fix it.
3. **Trust in the community:** I won't test your changes, either they do work or they don't. I just merge them.
4. **Looking for a maintainer:** This situation is less than ideal. Therefore, I am looking for a new maintainer to take over this project.

## Installation

Expand All @@ -11,4 +20,4 @@ composer require --dev wulfheart/laravel-actions-ide-helper
## Usage
```
php artisan ide-helper:actions
```
```
33 changes: 21 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,24 @@
}
],
"require": {
"php": "^8.0",
"illuminate/contracts": "^8.37",
"php": "^8.1|^8.2",
"illuminate/contracts": "^10.0|^11.0|^12.0",
"lorisleiva/laravel-actions": "^2.3",
"lorisleiva/lody": "^0.5.0|^0.6.0",
"phpdocumentor/reflection": "^5.1|^6.0",
"riimu/kit-pathjoin": "^1.2",
"spatie/laravel-package-tools": "^1.4.3"
"spatie/laravel-package-tools": "^1.14"
},
"require-dev": {
"brianium/paratest": "^6.2",
"nunomaduro/collision": "^5.3",
"orchestra/testbench": "^6.15",
"phpunit/phpunit": "^9.3",
"spatie/laravel-ray": "^1.9",
"vimeo/psalm": "^4.4"
"brianium/paratest": "^6.8|^7.4",
"nunomaduro/collision": "^6.1|^8.0",
"orchestra/testbench": "^8.0|^9.0|^10.0",
"pestphp/pest": "^1.22|^2.34|^3.7",
"phpunit/phpunit": "^9.5.10|^10.5|^11.5.3",
"spatie/invade": "^1.1|^2.0",
"spatie/laravel-ray": "^1.32",
"spatie/pest-plugin-snapshots": "^1.1|^2.1",
"vimeo/psalm": "^5.6|^6.6"
},
"autoload": {
"psr-4": {
Expand All @@ -40,10 +46,13 @@
"Wulfheart\\LaravelActionsIdeHelper\\Tests\\": "tests"
}
},
"scripts": {
},
"scripts": [],
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true,
"pestphp/pest-plugin": true
}
},
"extra": {
"laravel": {
Expand Down
58 changes: 21 additions & 37 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="Wulfheart Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Wulfheart Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
49 changes: 15 additions & 34 deletions src/Commands/LaravelActionsIdeHelperCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

namespace Wulfheart\LaravelActionsIdeHelper\Commands;

use Composer\Autoload\ClassMapGenerator;
use Illuminate\Console\Command;
use phpDocumentor\Reflection\Php\Factory\Type;
use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Nullable;
use Illuminate\Support\Str;
use phpDocumentor\Reflection\File\LocalFile;
use PhpParser\BuilderFactory;
use PhpParser\PrettyPrinter\Standard;
use ReflectionClass;
use Riimu\Kit\PathJoin\Path;
use Symfony\Component\Finder\Finder;
use Wulfheart\LaravelActionsIdeHelper\ClassMapGenerator;
use Wulfheart\LaravelActionsIdeHelper\Service\ActionInfo;
use Wulfheart\LaravelActionsIdeHelper\Service\ActionInfoFactory;
use Wulfheart\LaravelActionsIdeHelper\Service\BuildIdeHelper;
use Wulfheart\LaravelActionsIdeHelper\Service\Generator\DocBlock\AsObjectGenerator;

Expand All @@ -24,36 +24,17 @@ class LaravelActionsIdeHelperCommand extends Command

public function handle()
{
$this->traverseFiles();
$this->comment('IDE Helpers generated for Laravel Actions at ./_ide_helper_actions.php');
}

protected function traverseFiles()
{
$finder = Finder::create()
->files()
->in(app_path())
->name('*.php');

$map = collect(ClassMapGenerator::createMap($finder->getIterator()));
// dd($map);
$classes = $map->keys();

$infos = [];

foreach ($classes as $class) {
// Fail gracefully if there is any problem with a reflection class
try {
$reflection = new ReflectionClass($class);
$ai = ActionInfo::createFromReflectionClass($reflection);
if (! is_null($ai)) {
$infos[] = $ai;
}
} catch (\Throwable) {
}
}

$result = BuildIdeHelper::create()->build($infos);
file_put_contents(Path::join([base_path(), '_ide_helper_actions.php']), $result);
$actionsPath = Path::join(app_path() . '/Actions');

$outfile = Path::join(base_path(), '/_ide_helper_actions.php');

$actionInfos = ActionInfoFactory::create($actionsPath);

$result = BuildIdeHelper::create()->build($actionInfos);

file_put_contents($outfile, $result);

$this->comment('IDE Helpers generated for Laravel Actions at ' . Str::of($outfile));
}
}
Loading