From c2505017696a56f968709fa83c5709f0757d1c95 Mon Sep 17 00:00:00 2001 From: Mathias STRASSER Date: Fri, 22 Dec 2017 21:19:53 +0100 Subject: [PATCH 1/2] Add support for PHP 7.2 Fix https://github.com/memio/spec-gen/issues/7 --- composer.json | 4 ++-- .../InsertGeneratedConstructorListenerSpec.php | 2 +- .../LogGeneratedConstructorListenerSpec.php | 4 ++-- .../GenerateMethod/InsertGeneratedMethodListenerSpec.php | 2 +- .../SpecGen/GenerateMethod/LogGeneratedMethodListenerSpec.php | 4 ++-- .../GenerateConstructor/GenerateConstructorHandler.php | 4 ++-- src/Memio/SpecGen/GenerateMethod/GenerateMethodHandler.php | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 00df8aa..e680853 100644 --- a/composer.json +++ b/composer.json @@ -29,9 +29,9 @@ "memio/memio": "^2.0", "memio/linter": "^2.0", "memio/validator": "^2.0", - "memio/model": "^2.0", + "memio/model": "^2.0.1", "memio/pretty-printer": "^2.0", - "memio/twig-template-engine": "^2.0", + "memio/twig-template-engine": "^2.0.1", "php": "^7.0", "phpspec/phpspec": "^4.0", "symfony/event-dispatcher": "^2.7 || ^3.0 || ^4.0" diff --git a/spec/Memio/SpecGen/GenerateConstructor/InsertGeneratedConstructorListenerSpec.php b/spec/Memio/SpecGen/GenerateConstructor/InsertGeneratedConstructorListenerSpec.php index 47e068b..cb4b741 100644 --- a/spec/Memio/SpecGen/GenerateConstructor/InsertGeneratedConstructorListenerSpec.php +++ b/spec/Memio/SpecGen/GenerateConstructor/InsertGeneratedConstructorListenerSpec.php @@ -14,7 +14,7 @@ use Memio\Model\File as FileModel; use Memio\Model\FullyQualifiedName as FullyQualifiedNameModel; use Memio\Model\Method as MethodModel; -use Memio\Model\Object as ObjectModel; +use Memio\Model\Objekt as ObjectModel; use Memio\Model\Property as PropertyModel; use Memio\SpecGen\CodeEditor\CodeEditor; use Memio\SpecGen\CodeEditor\InsertConstructor; diff --git a/spec/Memio/SpecGen/GenerateConstructor/LogGeneratedConstructorListenerSpec.php b/spec/Memio/SpecGen/GenerateConstructor/LogGeneratedConstructorListenerSpec.php index 86c3193..cd49b68 100644 --- a/spec/Memio/SpecGen/GenerateConstructor/LogGeneratedConstructorListenerSpec.php +++ b/spec/Memio/SpecGen/GenerateConstructor/LogGeneratedConstructorListenerSpec.php @@ -13,7 +13,7 @@ use Memio\Model\File; use Memio\Model\Method; -use Memio\Model\Object; +use Memio\Model\Objekt; use Memio\Model\Property; use Memio\SpecGen\GenerateConstructor\GeneratedConstructor; use PhpSpec\Console\ConsoleIO; @@ -30,7 +30,7 @@ function let(ConsoleIO $io) $this->beConstructedWith($io); } - function it_logs_the_generated_constructor(File $file, ConsoleIO $io, Method $method, Object $object, Property $property) + function it_logs_the_generated_constructor(File $file, ConsoleIO $io, Method $method, Objekt $object, Property $property) { $generatedConstructor = new GeneratedConstructor($file->getWrappedObject()); $file->getStructure()->willReturn($object); diff --git a/spec/Memio/SpecGen/GenerateMethod/InsertGeneratedMethodListenerSpec.php b/spec/Memio/SpecGen/GenerateMethod/InsertGeneratedMethodListenerSpec.php index f1a8960..e9c4846 100644 --- a/spec/Memio/SpecGen/GenerateMethod/InsertGeneratedMethodListenerSpec.php +++ b/spec/Memio/SpecGen/GenerateMethod/InsertGeneratedMethodListenerSpec.php @@ -14,7 +14,7 @@ use Memio\Model\File as FileModel; use Memio\Model\FullyQualifiedName as FullyQualifiedNameModel; use Memio\Model\Method as MethodModel; -use Memio\Model\Object as ObjectModel; +use Memio\Model\Objekt as ObjectModel; use Memio\SpecGen\CodeEditor\CodeEditor; use Memio\SpecGen\CodeEditor\InsertMethod; use Memio\SpecGen\CodeEditor\InsertUseStatements; diff --git a/spec/Memio/SpecGen/GenerateMethod/LogGeneratedMethodListenerSpec.php b/spec/Memio/SpecGen/GenerateMethod/LogGeneratedMethodListenerSpec.php index 83b4d1a..c2e3139 100644 --- a/spec/Memio/SpecGen/GenerateMethod/LogGeneratedMethodListenerSpec.php +++ b/spec/Memio/SpecGen/GenerateMethod/LogGeneratedMethodListenerSpec.php @@ -13,7 +13,7 @@ use Memio\Model\File; use Memio\Model\Method; -use Memio\Model\Object; +use Memio\Model\Objekt; use Memio\SpecGen\GenerateMethod\GeneratedMethod; use PhpSpec\Console\ConsoleIO; use PhpSpec\ObjectBehavior; @@ -28,7 +28,7 @@ function let(ConsoleIO $io) $this->beConstructedWith($io); } - function it_logs_the_generated_method(File $file, ConsoleIO $io, Method $method, Object $object) + function it_logs_the_generated_method(File $file, ConsoleIO $io, Method $method, Objekt $object) { $generatedMethod = new GeneratedMethod($file->getWrappedObject()); $file->getStructure()->willReturn($object); diff --git a/src/Memio/SpecGen/GenerateConstructor/GenerateConstructorHandler.php b/src/Memio/SpecGen/GenerateConstructor/GenerateConstructorHandler.php index eb1f358..985b6ec 100644 --- a/src/Memio/SpecGen/GenerateConstructor/GenerateConstructorHandler.php +++ b/src/Memio/SpecGen/GenerateConstructor/GenerateConstructorHandler.php @@ -14,7 +14,7 @@ use Memio\Model\File; use Memio\Model\FullyQualifiedName; use Memio\Model\Method; -use Memio\Model\Object; +use Memio\Model\Objekt; use Memio\Model\Property; use Memio\SpecGen\CommandBus\Command; use Memio\SpecGen\CommandBus\CommandHandler; @@ -54,7 +54,7 @@ public function supports(Command $command): bool public function handle(Command $command) { $method = new Method($command->methodName); - $object = Object::make($command->fullyQualifiedName)->addMethod($method); + $object = Objekt::make($command->fullyQualifiedName)->addMethod($method); $file = File::make($command->fileName)->setStructure($object); $arguments = $this->variableArgumentMarshaller->marshal($command->arguments); foreach ($arguments as $argument) { diff --git a/src/Memio/SpecGen/GenerateMethod/GenerateMethodHandler.php b/src/Memio/SpecGen/GenerateMethod/GenerateMethodHandler.php index c590eb2..3b5893c 100644 --- a/src/Memio/SpecGen/GenerateMethod/GenerateMethodHandler.php +++ b/src/Memio/SpecGen/GenerateMethod/GenerateMethodHandler.php @@ -14,7 +14,7 @@ use Memio\Model\File; use Memio\Model\FullyQualifiedName; use Memio\Model\Method; -use Memio\Model\Object; +use Memio\Model\Objekt; use Memio\SpecGen\CommandBus\Command; use Memio\SpecGen\CommandBus\CommandHandler; use Memio\SpecGen\Marshaller\VariableArgumentMarshaller; @@ -55,7 +55,7 @@ public function handle(Command $command) { $method = new Method($command->methodName); $file = File::make($command->fileName) - ->setStructure(Object::make($command->fullyQualifiedName) + ->setStructure(Objekt::make($command->fullyQualifiedName) ->addMethod($method) ) ; From 0e8dd58d4c809a68d6debda78402a8ee08272845 Mon Sep 17 00:00:00 2001 From: Mathias STRASSER Date: Fri, 22 Dec 2017 21:22:34 +0100 Subject: [PATCH 2/2] Add branch alias --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index e680853..addd8f8 100644 --- a/composer.json +++ b/composer.json @@ -39,5 +39,10 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.0", "phpunit/phpunit": "^6.0" + }, + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } } }