Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
308 changes: 154 additions & 154 deletions composer.lock

Large diffs are not rendered by default.

37 changes: 1 addition & 36 deletions lib/Extension/CodeTransformExtra/CodeTransformExtraExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@
namespace Phpactor\Extension\CodeTransformExtra;

use Microsoft\PhpParser\Parser;
use Phpactor\CodeBuilder\Adapter\TolerantParser\StyleProposer\DocblockIndentationProposer;
use Phpactor\CodeBuilder\Adapter\TolerantParser\StyleProposer\IndentationProposer;
use Phpactor\CodeBuilder\Adapter\TolerantParser\StyleProposer\MemberBlankLineProposer;
use Phpactor\CodeBuilder\Adapter\TolerantParser\TolerantStyleFixer;
use Phpactor\CodeBuilder\Adapter\TolerantParser\TolerantUpdater;
use Phpactor\CodeBuilder\Adapter\Twig\TwigExtension;
use Phpactor\CodeBuilder\Adapter\Twig\TwigRenderer;
use Phpactor\CodeBuilder\Adapter\WorseReflection\WorseBuilderFactory;
use Phpactor\CodeBuilder\Domain\TemplatePathResolver\PhpVersionPathResolver;
use Phpactor\CodeBuilder\Domain\Fixer\ChainFixer;
use Phpactor\CodeBuilder\Domain\StyleFixer;
use Phpactor\CodeBuilder\Util\TextFormat;
use Phpactor\CodeTransform\Adapter\Native\GenerateNew\ClassGenerator;
use Phpactor\CodeTransform\Adapter\TolerantParser\ClassToFile\Transformer\ClassNameFixerTransformer;
Expand All @@ -34,7 +28,6 @@
use Phpactor\Container\Container;
use Phpactor\Container\ContainerBuilder;
use Phpactor\Container\Extension;
use Phpactor\Extension\CodeTransformExtra\Command\FixCodeStyleCommand;
use Phpactor\Extension\CodeTransformExtra\Rpc\ImportMissingClassesHandler;
use Phpactor\Extension\CodeTransform\CodeTransformExtension;
use Phpactor\Extension\Core\CoreExtension;
Expand Down Expand Up @@ -73,8 +66,6 @@ class CodeTransformExtraExtension implements Extension
const GENERATE_ACCESSOR_UPPER_CASE_FIRST = 'code_transform.refactor.generate_accessor.upper_case_first';
const APP_TEMPLATE_PATH = '%application_root%/vendor/phpactor/code-builder/templates';

const SERVICE_STYLE_FIXER = 'code_transform.style_fixer';

const PARAM_FIXER_INDENTATION = 'code_transform.fixer.indentation';
const PARAM_FIXER_MEMBER_NEWLINES = 'code_transform.fixer.member_newlines';
const SERVICE_TOLERANT_PARSER = 'code_transform.tolerant_parser';
Expand Down Expand Up @@ -158,12 +149,6 @@ private function registerConsole(ContainerBuilder $container)
$container->get('console.dumper_registry')
);
}, [ ConsoleExtension::TAG_COMMAND => [ 'name' => 'class:inflect' ]]);

$container->register(FixCodeStyleCommand::class, function (Container $container) {
return new FixCodeStyleCommand(
$container->get(self::SERVICE_STYLE_FIXER)
);
}, [ ConsoleExtension::TAG_COMMAND => [ 'name' => 'style:fix' ]]);
}

private function registerTransformers(ContainerBuilder $container)
Expand Down Expand Up @@ -307,8 +292,7 @@ private function registerUpdater(ContainerBuilder $container)
return new TolerantUpdater(
$container->get('code_transform.renderer'),
$container->get(self::SERVICE_TEXT_FORMAT),
$container->get(self::SERVICE_TOLERANT_PARSER),
$container->get(self::SERVICE_STYLE_FIXER)
$container->get(self::SERVICE_TOLERANT_PARSER)
);
});
$container->register('code_transform.builder_factory', function (Container $container) {
Expand All @@ -318,25 +302,6 @@ private function registerUpdater(ContainerBuilder $container)
$container->register(self::SERVICE_TOLERANT_PARSER, function (Container $container) {
return new Parser();
});

$container->register(self::SERVICE_STYLE_FIXER, function (Container $container) {
$proposers = [];

if ($container->getParameter(self::PARAM_FIXER_MEMBER_NEWLINES)) {
$proposers[] = new MemberBlankLineProposer($container->get(self::SERVICE_TEXT_FORMAT));
}

if ($container->getParameter(self::PARAM_FIXER_INDENTATION)) {
$proposers[] = new IndentationProposer($container->get(self::SERVICE_TEXT_FORMAT));
$proposers[] = new DocblockIndentationProposer($container->get(self::SERVICE_TEXT_FORMAT));
}

return new TolerantStyleFixer(
$proposers,
$container->get(self::SERVICE_TOLERANT_PARSER),
$container->getParameter(self::PARAM_FIXER_TOLERANCE)
);
});
}

private function registerRpc(ContainerBuilder $container)
Expand Down
47 changes: 0 additions & 47 deletions lib/Extension/CodeTransformExtra/Command/FixCodeStyleCommand.php

This file was deleted.

18 changes: 18 additions & 0 deletions lib/Extension/Core/Command/ConfigSetCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Phpactor\Extension\Core\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class ConfigSetCommand extends Command
{
protected function configure()
{
}

protected function execute(InputInterface $input, OutputInterface $output)
{
}
}
1 change: 0 additions & 1 deletion plugin/tests/add_missing_assignments.vader
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Expect php (assignments to be added):
* @var Phpactor
*/
private $phpactor;

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interface CarnivorousInterface
public function testInflectClassExistingAndForce()
{
$filePath = 'lib/Badger/Carnivorous.php';
$process = $this->phpactor('class:inflect '.$filePath. ' ' . $filePath . ' interface');
$process = $this->phpactor('class:inflect '.$filePath. ' ' . $filePath . ' interface --no-interaction');
$this->assertSuccess($process);
$this->assertContains('exists:true', $process->getOutput());
$this->assertNotContains('interface', file_get_contents($filePath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function provideSmokeSuccess()

yield 'Glob' => [
'class:transform "lib/*.php" --transform=implement_contracts',
'2 files affected',
'1 files affected',
];

yield 'Dry run' => [
Expand Down

This file was deleted.