Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Phptorm mistake with __invoke function autocomplete and click to go
<?php
namespace App;
use App\InvokeMe;
use App\Dependency2;
class CallMeBaby
{
private $dep2;
private $invokeMe;
public function __construct(
Dependency2 $dep2,
InvokeMe $invokeMe
) {
$this->dep2 = $dep2;
$this->invokeMe = $invokeMe;
}
public function otherAction(): void
{
($this->invokeMe)('I <3 PhpStorm');
$this->dep2->save();
}
}
<?php
namespace App;
use App\Dependency;
class InvokeMe
{
private $dep;
public function __construct(Dependency $dep)
{
$this->dep = $dep;
}
public function __invoke(string $paramerter): void
{
$dep->action();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment