generated from psalm/psalm-plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b62b26c
commit c406baa
Showing
35 changed files
with
119 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ composer.lock | |
.phpunit.result.cache | ||
.idea | ||
cache | ||
.codebase_patch_applied | ||
.config_patch_applied |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- /dev/null | ||
+++ ../src/Psalm/Codebase.php | ||
@@ -131,7 +131,10 @@ | ||
|
||
public FileReferenceProvider $file_reference_provider; | ||
|
||
- public StatementsProvider $statements_provider; | ||
+ /** | ||
+ * @var StatementsProvider | ||
+ */ | ||
+ public $statements_provider; | ||
|
||
private readonly Progress $progress; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- /dev/null | ||
+++ ../src/Psalm/Config.php | ||
@@ -130,7 +130,7 @@ | ||
* @psalm-suppress PropertyNotSetInConstructor | ||
* @psalm-consistent-constructor | ||
*/ | ||
-final class Config | ||
+class Config | ||
{ | ||
final public const DEFAULT_BASELINE_NAME = 'psalm-baseline.xml'; | ||
private const DEFAULT_FILE_NAMES = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ parameters: | |
- src | ||
- tests | ||
excludePaths: | ||
- tests/data/* | ||
- tests/data/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace PhpStaticAnalysis\PsalmPlugin\Composer; | ||
|
||
use Composer\Composer; | ||
use Composer\EventDispatcher\EventSubscriberInterface; | ||
use Composer\IO\IOInterface; | ||
use Composer\Plugin\PluginInterface; | ||
use Composer\Script\Event; | ||
use PhpStaticAnalysis\Attributes\Returns; | ||
|
||
class Plugin implements PluginInterface, EventSubscriberInterface | ||
{ | ||
public function activate(Composer $composer, IOInterface $io) | ||
{ | ||
} | ||
|
||
public function deactivate(Composer $composer, IOInterface $io) | ||
{ | ||
} | ||
|
||
public function uninstall(Composer $composer, IOInterface $io) | ||
{ | ||
} | ||
|
||
#[Returns('array<string, string>')] | ||
public static function getSubscribedEvents(): array | ||
{ | ||
return [ | ||
'post-install-cmd' => 'onPostInstall', | ||
'post-update-cmd' => 'onPostUpdate' | ||
]; | ||
} | ||
|
||
public static function onPostInstall(Event $event): void | ||
{ | ||
self::applyPatches($event); | ||
} | ||
|
||
public static function onPostUpdate(Event $event): void | ||
{ | ||
self::applyPatches($event); | ||
} | ||
|
||
private static function applyPatches(Event $event): void | ||
{ | ||
/** | ||
* @var string $vendorDir | ||
*/ | ||
$vendorDir = $event->getComposer()->getConfig()->get('vendor-dir'); | ||
|
||
$dependencyPath = $vendorDir . '/vimeo/psalm'; | ||
$patchFile = __DIR__ . '/../../patches/vimeo-psalm-src-psalm-config-php.patch'; | ||
|
||
exec("patch -p1 -d $dependencyPath --forward < $patchFile"); | ||
|
||
$patchFile = __DIR__ . '/../../patches/vimeo-psalm-src-psalm-codebase-php.patch'; | ||
|
||
exec("patch -p1 -d $dependencyPath --forward < $patchFile"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.