1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

!!! Deprecate \Psalm\Plugin\RegistrationInterface methods

Following \Psalm\Plugin\RegistrationInterface methods are deprecated
+ addFileTypeScanner
+ addFileTypeAnalyzer

Following \Psalm\PluginRegistrationSocket methods are deprecated
+ addFileTypeScanner
+ getAdditionalFileTypeScanners
+ addFileTypeAnalyzer
+ getAdditionalFileTypeAnalyzers
+ getAdditionalFileExtensions
+ addFileExtension

Mentioned methods will be removed in Psalm v5.0, corresponding
functionality will be provided by following new interfaces and classes
+ \Psalm\Plugin\FileExtensionsInterface
+ \Psalm\PluginFileExtensionsSocket

Related: #6788
This commit is contained in:
Oliver Hader 2022-01-21 14:44:42 +01:00
parent f9ea2756f9
commit c34e32f60e
No known key found for this signature in database
GPG Key ID: C19FAFD699012A5A
2 changed files with 8 additions and 0 deletions

View File

@ -17,12 +17,14 @@ interface RegistrationInterface
/**
* @param string $fileExtension e.g. `'html'`
* @param class-string<FileScanner> $className
* @deprecated will be removed in v5.0, use \Psalm\Plugin\FileExtensionsInterface instead (#6788)
*/
public function addFileTypeScanner(string $fileExtension, string $className): void;
/**
* @param string $fileExtension e.g. `'html'`
* @param class-string<FileAnalyzer> $className
* @deprecated will be removed in v5.0, use \Psalm\Plugin\FileExtensionsInterface instead (#6788)
*/
public function addFileTypeAnalyzer(string $fileExtension, string $className): void;
}

View File

@ -143,6 +143,7 @@ class PluginRegistrationSocket implements RegistrationInterface
/**
* @param string $fileExtension e.g. `'html'`
* @param class-string<FileScanner> $className
* @deprecated will be removed in v5.0, use \Psalm\Plugin\FileExtensionsInterface instead (#6788)
*/
public function addFileTypeScanner(string $fileExtension, string $className): void
{
@ -170,6 +171,7 @@ class PluginRegistrationSocket implements RegistrationInterface
/**
* @return array<string, class-string<FileScanner>>
* @deprecated will be removed in v5.0, use \Psalm\PluginFileExtensionsSocket instead (#6788)
*/
public function getAdditionalFileTypeScanners(): array
{
@ -179,6 +181,7 @@ class PluginRegistrationSocket implements RegistrationInterface
/**
* @param string $fileExtension e.g. `'html'`
* @param class-string<FileAnalyzer> $className
* @deprecated will be removed in v5.0, use \Psalm\PluginFileExtensionsSocket instead (#6788)
*/
public function addFileTypeAnalyzer(string $fileExtension, string $className): void
{
@ -206,6 +209,7 @@ class PluginRegistrationSocket implements RegistrationInterface
/**
* @return array<string, class-string<FileAnalyzer>>
* @deprecated will be removed in v5.0, use \Psalm\PluginFileExtensionsSocket instead (#6788)
*/
public function getAdditionalFileTypeAnalyzers(): array
{
@ -214,6 +218,7 @@ class PluginRegistrationSocket implements RegistrationInterface
/**
* @return list<string> e.g. `['html', 'perl']`
* @deprecated will be removed in v5.0, use \Psalm\PluginFileExtensionsSocket instead (#6788)
*/
public function getAdditionalFileExtensions(): array
{
@ -222,6 +227,7 @@ class PluginRegistrationSocket implements RegistrationInterface
/**
* @param string $fileExtension e.g. `'html'`
* @deprecated will be removed in v5.0, use \Psalm\PluginFileExtensionsSocket instead (#6788)
*/
private function addFileExtension(string $fileExtension): void
{