PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.2.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.2.1
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / vendor / typisttech / imposter-plugin / src / Transformer.php

Transformer.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.2.1, at vendor/typisttech/imposter-plugin/src/Transformer.php

54 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace TypistTech\Imposter\Plugin;
6
7 use Composer\IO\IOInterface;
8 use TypistTech\Imposter\ImposterFactory;
9
10 class Transformer
11 {
12 public static function run(IOInterface $io): void
13 {
14 // Print an empty line to separate imposter outputs.
15 $io->write('', true);
16 $io->write('', true);
17 $io->write('<info>Running Imposter...</info>', true);
18 $io->write('<info>======================</info>', true);
19 $io->write('Loading package information from <comment>' . getcwd() . '/composer.json</comment>', true);
20
21 $imposter = ImposterFactory::forProject(getcwd(), ['typisttech/imposter-plugin']);
22
23 $autoloads = $imposter->getAutoloads();
24 $count = count($autoloads);
25 $index = 1;
26 foreach ($autoloads as $autoload) {
27 $io->write(" - <comment>$index/$count</comment>: Transforming $autoload", true);
28 $imposter->transform($autoload);
29 $index++;
30 }
31
32 $io->write('<info>Success: Imposter transformed vendor files.</info>', true);
33
34 $invalidAutoloads = $imposter->getInvalidAutoloads();
35 if (! empty($invalidAutoloads)) {
36 $invalidAutoloadsCount = count($invalidAutoloads);
37 $io->writeError('', true);
38 $io->writeError(
39 // phpcs:ignore Generic.Files.LineLength.TooLong
40 "<warning>Warning: Imposter failed to transformed $invalidAutoloadsCount of the autoload path(s).</warning>",
41 true
42 );
43
44 foreach ($invalidAutoloads as $invalidAutoload) {
45 $io->writeError(" - $invalidAutoload", true);
46 }
47 }
48
49 // Print empty lines to separate imposter outputs.
50 $io->write('', true);
51 $io->write('', true);
52 }
53 }
54