private function getClassType(Parameter $property)
 {
     if ($property->hasClass()) {
         return $property->getClassType()->getName();
     }
     return '';
 }
 private function createMethodParam(Parameter $param)
 {
     $result = $this->builderFactory->param($param->getName());
     if ($param->hasClass()) {
         $result->setTypeHint($param->getClassType()->getName());
     }
     return $result;
 }
 public function it_will_create_source_from_given_class_type_and_aggregate_root_id_param(ClassSourceFactory $sourceFactory, DefinitionFactory $definitionFactory, ClassType $classType, ImprovedClassSource $classSource, Parameter $parameter, ClassType $parameterClassType, CreateMethod $createMethod, AggregateRootIdGetterMethod $aggregateRootIdGetterMethod)
 {
     $parameter->getClassType()->willReturn($parameterClassType);
     $sourceFactory->create($classType)->willReturn($classSource);
     $definitionFactory->createBroadwayModelCreateMethod($classType, [$parameter])->shouldBeCalled()->willReturn($createMethod);
     $definitionFactory->createBroadwayModelAggregateRootIdGetterMethod($parameter)->shouldBeCalled()->willReturn($aggregateRootIdGetterMethod);
     $this->create($classType, $parameter)->shouldReturn($classSource);
 }
 private function createMethodParamWithDefaultValue(Parameter $param, $defaultValue)
 {
     $result = $this->builderFactory->param($param->getName());
     if ($param->hasClass()) {
         $result->setTypeHint($param->getClassType()->getName());
     }
     $result->setDefault($defaultValue);
     return $result;
 }
 private function createConstructorMethodAssignment(Parameter $param)
 {
     return new Node\Expr\Assign(new Node\Expr\Variable('this->' . $param->getName()), new Node\Expr\Variable($param->getName()));
 }
 private function createMethodParam(Parameter $param)
 {
     $result = $this->builderFactory->param($param->getName());
     return $result;
 }
 public function it_will_not_show_plain_params_from_constructor_in_imports(ConstructorMethod $constructor, Parameter $param)
 {
     $constructor->getMethodParameters()->willReturn([$param]);
     $param->hasClass()->willReturn(false);
     $this->addConstructorMethod($constructor)->shouldReturn($this);
     $this->getImports()->shouldReturn([]);
 }