Просмотр исходного кода

chore: mark classes as readonly (#8275)

Dariusz Rumiński 2 месяцев назад
Родитель
Сommit
bb7775bf64

+ 2 - 0
src/Cache/Directory.php

@@ -17,6 +17,8 @@ namespace PhpCsFixer\Cache;
 /**
  * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
  *
+ * @readonly
+ *
  * @internal
  */
 final class Directory implements DirectoryInterface

+ 2 - 0
src/Cache/Signature.php

@@ -17,6 +17,8 @@ namespace PhpCsFixer\Cache;
 /**
  * @author Andreas Möller <am@localheinz.com>
  *
+ * @readonly
+ *
  * @internal
  */
 final class Signature implements SignatureInterface

+ 3 - 0
src/Console/Application.php

@@ -47,6 +47,9 @@ final class Application extends BaseApplication
     public const VERSION = '3.65.1-DEV';
     public const VERSION_CODENAME = 'Persian Successor';
 
+    /**
+     * @readonly
+     */
     private ToolInfo $toolInfo;
     private ?Command $executedCommand = null;
 

+ 2 - 0
src/Console/Output/ErrorOutput.php

@@ -22,6 +22,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
 use Symfony\Component\Console\Output\OutputInterface;
 
 /**
+ * @readonly
+ *
  * @internal
  */
 final class ErrorOutput

+ 2 - 0
src/Console/Output/OutputContext.php

@@ -17,6 +17,8 @@ namespace PhpCsFixer\Console\Output;
 use Symfony\Component\Console\Output\OutputInterface;
 
 /**
+ * @readonly
+ *
  * @internal
  */
 final class OutputContext

+ 2 - 0
src/Console/Output/Progress/NullOutput.php

@@ -17,6 +17,8 @@ namespace PhpCsFixer\Console\Output\Progress;
 use PhpCsFixer\Runner\Event\FileProcessed;
 
 /**
+ * @readonly
+ *
  * @internal
  */
 final class NullOutput implements ProgressOutputInterface

+ 2 - 0
src/Console/Output/Progress/PercentageBarOutput.php

@@ -21,6 +21,8 @@ use Symfony\Component\Console\Helper\ProgressBar;
 /**
  * Output writer to show the progress of a FixCommand using progress bar (percentage).
  *
+ * @readonly
+ *
  * @internal
  */
 final class PercentageBarOutput implements ProgressOutputInterface

+ 2 - 0
src/Console/Output/Progress/ProgressOutputFactory.php

@@ -17,6 +17,8 @@ namespace PhpCsFixer\Console\Output\Progress;
 use PhpCsFixer\Console\Output\OutputContext;
 
 /**
+ * @readonly
+ *
  * @internal
  */
 final class ProgressOutputFactory

+ 2 - 0
src/Console/Report/FixReport/CheckstyleReporter.php

@@ -20,6 +20,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
 /**
  * @author Kévin Gomez <contact@kevingomez.fr>
  *
+ * @readonly
+ *
  * @internal
  */
 final class CheckstyleReporter implements ReporterInterface

+ 2 - 0
src/Console/Report/FixReport/GitlabReporter.php

@@ -27,6 +27,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
  *
  * @author Hans-Christian Otto <c.otto@suora.com>
  *
+ * @readonly
+ *
  * @internal
  */
 final class GitlabReporter implements ReporterInterface

Некоторые файлы не были показаны из-за большого количества измененных файлов