Skip to content

Commit

Permalink
Stupid trick to make PHPStan detection work
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Sep 12, 2024
1 parent 9c2e491 commit 7e96475
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions MageWire/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@

use Magento\Framework\View\Element\Block\ArgumentInterface;

if (class_exists('\Magewirephp\Magewire\Component')) {
class Component extends \Magewirephp\Magewire\Component
if (false === class_exists('\Magewirephp\Magewire\Component')) {
class Component implements ArgumentInterface
{
public function isHyvaCheckoutEnabled(): bool
{
return true;
return false;
}

public function dispatchBrowserEvent(string $browserEvent, $data)
{
}
}
} else {
class Component implements ArgumentInterface
class Component extends \Magewirephp\Magewire\Component
{
public function isHyvaCheckoutEnabled(): bool
{
return false;
}

public function dispatchBrowserEvent(string $browserEvent, $data)
{
return true;
}
}

}

0 comments on commit 7e96475

Please sign in to comment.