2020-12-03 23:46:52 +01:00
|
|
|
<?php
|
2020-12-03 23:56:23 +01:00
|
|
|
namespace Orklah\PsalmInsaneComparison;
|
2020-12-03 23:46:52 +01:00
|
|
|
|
2020-12-04 08:38:19 +01:00
|
|
|
use Orklah\PsalmInsaneComparison\Hooks\InsaneComparisonAnalyzer;
|
2020-12-03 23:46:52 +01:00
|
|
|
use SimpleXMLElement;
|
|
|
|
use Psalm\Plugin\PluginEntryPointInterface;
|
|
|
|
use Psalm\Plugin\RegistrationInterface;
|
|
|
|
|
|
|
|
class Plugin implements PluginEntryPointInterface
|
|
|
|
{
|
|
|
|
/** @return void */
|
|
|
|
public function __invoke(RegistrationInterface $psalm, ?SimpleXMLElement $config = null): void
|
|
|
|
{
|
2020-12-04 08:38:19 +01:00
|
|
|
if(class_exists(InsaneComparisonAnalyzer::class)){
|
|
|
|
$psalm->registerHooksFromClass(InsaneComparisonAnalyzer::class);
|
2020-12-03 23:46:52 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|