diff --git a/src/Blueprint/Domain/Blueprint.php b/src/Blueprint/Domain/Blueprint.php new file mode 100644 index 0000000..ce6b154 --- /dev/null +++ b/src/Blueprint/Domain/Blueprint.php @@ -0,0 +1,56 @@ + */ + private array $classBlueprints = [], + ) { + } + + /** + * @param BlueprintId $id + * @param array $classBlueprints + */ + public static function create(BlueprintId $id, array $classBlueprints): static + { + $blueprint = new static($id, $classBlueprints); + + $blueprint->raise( + new BlueprintCreated($id) + ); + + return $blueprint; + } + + /** + * @param BlueprintId $id + * @param array $classBlueprints + */ + public static function recreate(BlueprintId $id, array $classBlueprints): static + { + return new static($id, $classBlueprints); + } + + public function id(): BlueprintId + { + return $this->id; + } + + /** + * @return array + */ + public function classBlueprints(): array + { + return $this->classBlueprints; + } +} diff --git a/src/Blueprint/Domain/Entities/ClassBlueprint.php b/src/Blueprint/Domain/Entities/ClassBlueprint.php new file mode 100644 index 0000000..342baff --- /dev/null +++ b/src/Blueprint/Domain/Entities/ClassBlueprint.php @@ -0,0 +1,56 @@ + */ + private array $propertyBlueprints = [], + ) { + } + + /** + * @param BlueprintId $id + * @param array $propertyBlueprints + */ + public static function create(BlueprintId $id, array $propertyBlueprints): static + { + $blueprint = new static($id, $propertyBlueprints); + + $blueprint->raise( + new BlueprintCreated($id) + ); + + return $blueprint; + } + + /** + * @param BlueprintId $id + * @param array $propertyBlueprints + */ + public static function recreate(BlueprintId $id, array $propertyBlueprints): static + { + return new static($id, $propertyBlueprints); + } + + public function id(): BlueprintId + { + return $this->id; + } + + /** + * @return array + */ + public function propertyBlueprints(): array + { + return $this->propertyBlueprints; + } +} diff --git a/src/Blueprint/Domain/Entities/PropertyBlueprint.php b/src/Blueprint/Domain/Entities/PropertyBlueprint.php new file mode 100644 index 0000000..8036b10 --- /dev/null +++ b/src/Blueprint/Domain/Entities/PropertyBlueprint.php @@ -0,0 +1,38 @@ +raise( + new BlueprintCreated($id) + ); + + return $blueprint; + } + + public static function recreate(BlueprintId $id): static + { + return new static($id); + } + + public function id(): BlueprintId + { + return $this->id; + } +} diff --git a/src/Blueprint/Domain/Events/BlueprintCreated.php b/src/Blueprint/Domain/Events/BlueprintCreated.php new file mode 100644 index 0000000..201306a --- /dev/null +++ b/src/Blueprint/Domain/Events/BlueprintCreated.php @@ -0,0 +1,20 @@ +raise( + new BuildCreated($id) + ); + + return $build; + } + + public static function recreate(BuildId $id): static + { + return new static($id); + } + + public function id(): BuildId + { + return $this->id; + } +} diff --git a/src/Build/Domain/Events/BuildCreated.php b/src/Build/Domain/Events/BuildCreated.php new file mode 100644 index 0000000..434b3ce --- /dev/null +++ b/src/Build/Domain/Events/BuildCreated.php @@ -0,0 +1,20 @@ +raise( + new MapperCreated($id) + ); + + return $mapper; + } + + public static function recreate(MapperId $id): static + { + return new static($id); + } + + public function id(): MapperId + { + return $this->id; + } +} diff --git a/src/Reflection/Domain/Entities/AttributeReflection.php b/src/Reflection/Domain/Entities/AttributeReflection.php new file mode 100644 index 0000000..fb38548 --- /dev/null +++ b/src/Reflection/Domain/Entities/AttributeReflection.php @@ -0,0 +1,202 @@ + */ + private array $arguments, + private false|string $fileName, + private false|string $fileHash, + private false|string $docBlock, + ) { + } + + public static function create( + \ReflectionAttribute $reflectionAttribute, + ReflectionInterface&AttributesSupport $parent, + ): static { + $reflectionClass = new \ReflectionClass($reflectionAttribute->getName()); + + $instance = new static( + id: ReflectionId::uuid(), + name: $reflectionClass->getName(), + shortName: $reflectionClass->getShortName(), + namespace: $reflectionClass->getNamespaceName(), + arguments: $reflectionAttribute->getArguments(), + fileName: $reflectionClass->getFileName(), + fileHash: $reflectionClass->getFileName() ? md5_file($reflectionClass->getFileName()) : false, + docBlock: $reflectionClass->getDocComment(), + ); + + $instance->parent = $parent; + $instance->raise( + new ReflectionCreated($instance->id()) + ); + + $parent->addAttribute($instance); + + return $instance; + } + + /** + * @param ReflectionId $id + * @param string $name + * @param string $shortName + * @param string $namespace + * @param array $arguments + * @param false|string $fileName + * @param false|string $fileHash + * @param false|string $docBlock + */ + public static function recreate( + ReflectionId $id, + string $name, + string $shortName, + string $namespace, + array $arguments, + false|string $fileName, + false|string $fileHash, + false|string $docBlock, + ): static { + return new static( + id: $id, + name: $name, + shortName: $shortName, + namespace: $namespace, + arguments: $arguments, + fileName: $fileName, + fileHash: $fileHash, + docBlock: $docBlock, + ); + } + + public function parent(null|(ReflectionInterface&AttributesSupport) $parent = null): ReflectionInterface&AttributesSupport + { + if (!$parent) { + return $this->parent; + } + + if (!property_exists($this, 'parent')) { + $this->parent = $parent; + + return $this->parent; + } + + throw new \InvalidArgumentException("Cannot set parent property. Parent property is read-only."); + } + + public function id(): ReflectionId + { + return $this->id; + } + + public function name(): string + { + return $this->name; + } + + public function shortName(): string + { + return $this->shortName; + } + + public function namespace(): string + { + return $this->namespace; + } + + /** @return array */ + public function arguments(): array + { + return $this->arguments; + } + + public function fileName(): false|string + { + return $this->fileName; + } + + public function fileHash(): false|string + { + return $this->fileHash; + } + + public function docBlock(): false|string + { + return $this->docBlock; + } + + public function instance(): object + { + return new $this->name(...$this->arguments); + } + + public function reflection(): \Reflector + { + if (method_exists($parentReflection = $this->parent->reflection(), 'getAttributes')) { + /** + * @var \ReflectionClass|\ReflectionMethod|\ReflectionProperty|\ReflectionParameter $parentReflection + * @var \ReflectionAttribute[] $attrs + */ + $attrs = $parentReflection->getAttributes($this->name); + foreach ($attrs as $attr) { + if ($attr->getArguments() === $this->arguments()) { + return $attr; + } + } + } + + throw new ReflectionException( + "ReflectionAttribute for `{$this->name}` in `{$parentReflection->__toString()}` class not found.", + "Check if the attribute is still present in the class and if the arguments match.", + 5 + ); + } + + public function normalize(): array + { + return [ + 'id' => $this->id->value, + 'name' => $this->name, + 'shortName' => $this->shortName, + 'namespace' => $this->namespace, + 'arguments' => $this->arguments, + 'fileName' => $this->fileName, + 'fileHash' => $this->fileHash, + 'docBlock' => $this->docBlock, + ]; + } + + public static function denormalize(array $data): static + { + return static::recreate( + ReflectionId::recreate($data['id']), + $data['name'], + $data['shortName'], + $data['namespace'], + $data['arguments'], + $data['fileName'], + $data['fileHash'], + $data['docBlock'], + ); + } +} diff --git a/src/Reflection/Domain/Entities/ClassReflection.php b/src/Reflection/Domain/Entities/ClassReflection.php new file mode 100644 index 0000000..13612fc --- /dev/null +++ b/src/Reflection/Domain/Entities/ClassReflection.php @@ -0,0 +1,264 @@ +attributes = $attributes; + $this->properties = $properties; + $this->methods = $methods; + } + + /** + * @param string|class-string $name + * @param Reflection $root + * @param null|PropertyReflection $parentProperty + * + * @return static + */ + public static function create( + string $name, + Reflection $root, + ?PropertyReflection $parentProperty = null, + ): static { + if (__CLASS__ === $name) { + throw new ReflectionException( + "Cannot create instance of $name class.", + "Please do not use `ClassReflection::create` method to create instance of $name class.", + 1 + ); + } + + try { + $reflection = new \ReflectionClass($name); + } catch (\ReflectionException $e) { + $message = $e->getMessage(); + throw new ReflectionException( + "Class `$name` not found. $message", + "Check if the class exists, has correct namespace and filename, and is properly autoloaded.", + 2 + ); + } + + $instance = new static( + id: ReflectionId::uuid(), + name: $name, + shortName: $reflection->getShortName(), + namespace: $reflection->getNamespaceName(), + hash: md5($reflection->__toString()), + fileName: $reflection->getFileName(), + fileHash: $reflection->getFileName() ? md5_file($reflection->getFileName()) : false, + docBlock: $reflection->getDocComment(), + ); + + $instance->root = $root; + $instance->raise( + new ReflectionCreated($instance->id()) + ); + + if (true === $result = $root->addClassReflection($instance)) { + foreach ($reflection->getAttributes() as $attribute) { + AttributeReflection::create($attribute, $instance); + } + + foreach ($reflection->getProperties() as $property) { + PropertyReflection::create($property, $instance, $parentProperty); + } + + foreach ($reflection->getMethods() as $method) { + MethodReflection::create($method, $instance); + } + + return $instance; + } + + return $result; + } + + /** + * @param ReflectionId $id + * @param string|class-string $name + * @param string $shortName + * @param string $namespace + * @param string $hash + * @param false|string $fileName + * @param false|string $fileHash + * @param false|string $docBlock + * @param array $attributes + * @param array $properties + * @param array $methods + * + * @return static + */ + public static function recreate( + ReflectionId $id, + string $name, + string $shortName, + string $namespace, + string $hash, + false|string $fileName, + false|string $fileHash, + false|string $docBlock, + array $attributes, + array $properties, + array $methods + ): static { + return new static( + $id, + $name, + $shortName, + $namespace, + $hash, + $fileName, + $fileHash, + $docBlock, + $attributes, + $properties, + $methods + ); + } + + public function root(?Reflection $root = null): Reflection + { + if (!$root) { + return $this->root; + } + + if (!property_exists($this, 'root')) { + $this->root = $root; + + return $this->root; + } + + throw new \InvalidArgumentException("Cannot set root property. Root property is read-only."); + } + + public function id(): ReflectionId + { + return $this->id; + } + + public function name(): string + { + return $this->name; + } + + public function shortName(): string + { + return $this->shortName; + } + + public function namespace(): string + { + return $this->namespace; + } + + public function hash(): string + { + return $this->hash; + } + + public function fileName(): false|string + { + return $this->fileName; + } + + public function fileHash(): false|string + { + return $this->fileHash; + } + + public function docBlock(): false|string + { + return $this->docBlock; + } + + public function reflection(): \Reflector + { + return new \ReflectionClass($this->name); + } + + public function normalize(): array + { + return [ + 'id' => $this->id->value, + 'name' => $this->name, + 'shortName' => $this->shortName, + 'namespace' => $this->namespace, + 'hash' => $this->hash, + 'fileName' => $this->fileName, + 'fileHash' => $this->fileHash, + 'docBlock' => $this->docBlock, + 'attributes' => $this->normalizeAttributes(), + 'properties' => $this->normalizeProperties(), + 'methods' => $this->normalizeMethods(), + ]; + } + + public static function denormalize(array $data): static + { + $instance = static::recreate( + ReflectionId::recreate($data['id']), + $data['name'], + $data['shortName'], + $data['namespace'], + $data['hash'], + $data['fileName'], + $data['fileHash'], + $data['docBlock'], + static::denormalizeAttributes($data['attributes']), + static::denormalizeProperties($data['properties']), + static::denormalizeMethods($data['methods']), + ); + + foreach ($instance->attributes() as $attrs) { + foreach ($attrs as $attr) { + $attr->parent($instance); + } + } + + foreach ($instance->properties() as $prop) { + $prop->parent($instance); + } + + foreach ($instance->methods() as $method) { + $method->parent($instance); + } + + return $instance; + } +} diff --git a/src/Reflection/Domain/Entities/Interfaces/AttributesSupport.php b/src/Reflection/Domain/Entities/Interfaces/AttributesSupport.php new file mode 100644 index 0000000..599face --- /dev/null +++ b/src/Reflection/Domain/Entities/Interfaces/AttributesSupport.php @@ -0,0 +1,21 @@ +|AttributeReflection[] + */ + public function attributes(null|string $filter = null): array; + + public function addAttribute(AttributeReflection $attribute): void; + + public function removeAttribute(AttributeReflection $attribute): void; +} diff --git a/src/Reflection/Domain/Entities/Interfaces/ReflectionInterface.php b/src/Reflection/Domain/Entities/Interfaces/ReflectionInterface.php new file mode 100644 index 0000000..fcc8ff9 --- /dev/null +++ b/src/Reflection/Domain/Entities/Interfaces/ReflectionInterface.php @@ -0,0 +1,10 @@ +attributes = $attributes; + $this->parameters = $parameters; + } + + public static function create(\ReflectionMethod $reflectionMethod, ClassReflection $parent): static + { + $instance = new static( + id: ReflectionId::uuid(), + name: $reflectionMethod->getName(), + docBlock: $reflectionMethod->getDocComment(), + attributes: [], + parameters: [], + ); + + $instance->parent = $parent; + $instance->raise( + new ReflectionCreated($instance->id) + ); + + return $instance; + } + + /** + * @param ReflectionId $id + * @param string $name + * @param string $docBlock + * @param array $attributes + * @param array $parameters + */ + public static function recreate( + ReflectionId $id, + string $name, + string $docBlock, + array $attributes, + array $parameters, + ): static { + return new static( + $id, + $name, + $docBlock, + $attributes, + $parameters, + ); + } + + public function parent(null|ClassReflection $parent = null): ClassReflection + { + if (!$parent) { + return $this->parent; + } + + if (!property_exists($this, 'parent')) { + $this->parent = $parent; + + return $this->parent; + } + + throw new \InvalidArgumentException("Cannot set parent property. Parent property is read-only."); + } + + public function id(): ReflectionId + { + return $this->id; + } + + public function name(): string + { + return $this->name; + } + + public function docBlock(): string + { + return $this->docBlock; + } + + public function parameters(): array + { + return $this->parameters; + } + + public function reflection(): Reflector + { + /** @var \ReflectionClass */ + $parentReflection = $this->parent->reflection(); + + return $parentReflection->getMethod($this->name); + } + + public function normalize(): array + { + return [ + 'id' => $this->id->value, + 'name' => $this->name, + 'docBlock' => $this->docBlock, + 'attributes' => $this->normalizeAttributes(), + 'parameters' => $this->normalizeParameters(), + ]; + } + + public static function denormalize(array $data): static + { + $instance = static::recreate( + ReflectionId::recreate($data['id']), + $data['name'], + $data['docBlock'], + self::denormalizeAttributes($data['attributes']), + self::denormalizeParameters($data['parameters']), + ); + + foreach ($instance->attributes() as $attrs) { + foreach ($attrs as $attr) { + $attr->parent($instance); + } + } + + foreach ($instance->parameters() as $param) { + $param->parent($instance); + } + + return $instance; + } +} diff --git a/src/Reflection/Domain/Entities/ParameterReflection.php b/src/Reflection/Domain/Entities/ParameterReflection.php new file mode 100644 index 0000000..4e5105e --- /dev/null +++ b/src/Reflection/Domain/Entities/ParameterReflection.php @@ -0,0 +1,76 @@ +attributes = $attributes; + } + + public static function create(\ReflectionParameter $reflectionMethod, MethodReflection $parent): static + { + $instance = new static( + id: ReflectionId::uuid(), + name: $reflectionMethod->getName(), + attributes: [], + parameters: [], + ); + + $instance->parent = $parent; + $instance->raise( + new ReflectionCreated($instance->id) + ); + + return $instance; + } + + public static function recreate(ReflectionId $id): static + { + return new static($id); + } + + public function parent(null|MethodReflection $parent = null): MethodReflection + { + if (!$parent) { + return $this->parent; + } + + if (!property_exists($this, 'parent')) { + $this->parent = $parent; + + return $this->parent; + } + + throw new \InvalidArgumentException("Cannot set parent property. Parent property is read-only."); + } + + public function id(): ReflectionId + { + return $this->id; + } + + public function name(): string + { + return $this->name; + } +} diff --git a/src/Reflection/Domain/Entities/PropertyReflection.php b/src/Reflection/Domain/Entities/PropertyReflection.php new file mode 100644 index 0000000..87028a2 --- /dev/null +++ b/src/Reflection/Domain/Entities/PropertyReflection.php @@ -0,0 +1,78 @@ +parent; + } + + if (!property_exists($this, 'parent')) { + $this->parent = $parent; + + return $this->parent; + } + + throw new \InvalidArgumentException("Cannot set parent property. Parent property is read-only."); + } + + public function parentProperty(null|PropertyReflection $parentProperty = null): PropertyReflection + { + if (!$parentProperty) { + return $this->parentProperty; + } + + if (!property_exists($this, 'parentProperty')) { + $this->parentProperty = $parentProperty; + + return $this->parentProperty; + } + + throw new \InvalidArgumentException("Cannot set parentProperty property. parentProperty property is read-only."); + } + + public function id(): ReflectionId + { + return $this->id; + } + + public function name(): string + { + return $this->name; + } +} diff --git a/src/Reflection/Domain/Entities/TypeReflection.php b/src/Reflection/Domain/Entities/TypeReflection.php new file mode 100644 index 0000000..e6d31ef --- /dev/null +++ b/src/Reflection/Domain/Entities/TypeReflection.php @@ -0,0 +1,40 @@ +raise( + new ReflectionCreated($id) + ); + + return $reflection; + } + + public static function recreate(ReflectionId $id): static + { + return new static($id); + } + + public function id(): ReflectionId + { + return $this->id; + } +} diff --git a/src/Reflection/Domain/Entities/traits/Attributes.php b/src/Reflection/Domain/Entities/traits/Attributes.php new file mode 100644 index 0000000..5292573 --- /dev/null +++ b/src/Reflection/Domain/Entities/traits/Attributes.php @@ -0,0 +1,87 @@ + + */ + private array $attributes = []; + + /** + * @param null|class-string $filter + * + * @return array|AttributeReflection[] + */ + public function attributes(null|string $filter = null): array + { + if ($filter) { + return $this->attributes[$filter] ?? []; + } + + return $this->attributes; + } + + public function addAttribute(AttributeReflection $attribute): void + { + $this->attributes[$attribute->name()][] = $attribute; + $this->raise( + new ReflectionAdded($attribute->id(), ReflectionAdded::ATTRIBUTE_REFLECTION_ADDED) + ); + } + + public function removeAttribute(AttributeReflection $attribute): void + { + $id = $attribute->id(); + $name = $attribute->name(); + if (!array_key_exists($name, $this->attributes)) { + throw new \InvalidArgumentException("Attribute `$name` does not exist in $this->shortName class."); + } + + $deleted = false; + foreach ($this->attributes[$name] as $key => $attr) { + if ($attr->id() === $id) { + unset($this->attributes[$name][$key]); + $deleted = true; + break; + } + } + + if (!$deleted) { + throw new \InvalidArgumentException("Attribute `$name` with id `$id` does not exist in $this->shortName class."); + } + + $this->raise( + new ReflectionRemoved($id, ReflectionRemoved::ATTRIBUTE_REFLECTION_REMOVED) + ); + } + + private function normalizeAttributes(): array + { + return array_map( + fn (array $attrs): array => array_map( + fn (AttributeReflection $attr): array => $attr->normalize(), + $attrs + ), + $this->attributes + ); + } + + public static function denormalizeAttributes(array $attributes): array + { + return array_map( + fn (array $attrs) => array_map( + fn (array $attrData): AttributeReflection => AttributeReflection::denormalize($attrData), + $attrs + ), + $attributes + ); + } +} diff --git a/src/Reflection/Domain/Entities/traits/Methods.php b/src/Reflection/Domain/Entities/traits/Methods.php new file mode 100644 index 0000000..646235f --- /dev/null +++ b/src/Reflection/Domain/Entities/traits/Methods.php @@ -0,0 +1,72 @@ + + */ + private array $methods = []; + + /** + * @param null|string $name + * + * @return array|MethodReflection + */ + public function methods(null|string $name = null): array|MethodReflection + { + if ($name) { + if (!array_key_exists($name, $this->methods)) { + throw new \InvalidArgumentException("Method `$name` does not exist in $this->shortName class."); + } + + return $this->methods[$name]; + } + + return $this->methods; + } + + public function addMethod(MethodReflection $method): void + { + $this->methods[$method->name()] = $method; + $this->raise( + new ReflectionAdded($method->id(), ReflectionAdded::METHOD_REFLECTION_ADDED) + ); + } + + public function removeMethod(string $name): void + { + if (!array_key_exists($name, $this->methods)) { + throw new \InvalidArgumentException("Method `$name` does not exist in $this->shortName class."); + } + $id = $this->methods($name)->id(); + unset($this->methods[$name]); + + $this->raise( + new ReflectionRemoved($id, ReflectionRemoved::METHOD_REFLECTION_REMOVED) + ); + } + + private function normalizeMethods(): array + { + return array_map( + fn (MethodReflection $item): array => $item->normalize(), + $this->methods + ); + } + + public static function denormalizeMethods(array $methods): array + { + return array_map( + fn (array $item): MethodReflection => MethodReflection::denormalize($item), + $methods + ); + } +} diff --git a/src/Reflection/Domain/Entities/traits/Parameters.php b/src/Reflection/Domain/Entities/traits/Parameters.php new file mode 100644 index 0000000..ec166e6 --- /dev/null +++ b/src/Reflection/Domain/Entities/traits/Parameters.php @@ -0,0 +1,72 @@ + + */ + private array $parameters = []; + + /** + * @param null|string $name + * + * @return array|ParameterReflection + */ + public function parameters(null|string $name = null): array|ParameterReflection + { + if ($name) { + if (!array_key_exists($name, $this->parameters)) { + throw new \InvalidArgumentException("Parameter `$name` does not exist in $this->shortName class."); + } + + return $this->parameters[$name]; + } + + return $this->parameters; + } + + public function addParameter(ParameterReflection $parameter): void + { + $this->parameters[$parameter->name()] = $parameter; + $this->raise( + new ReflectionAdded($parameter->id(), ReflectionAdded::PARAMETER_REFLECTION_ADDED) + ); + } + + public function removeParameter(string $name): void + { + if (!array_key_exists($name, $this->parameters)) { + throw new \InvalidArgumentException("Parameter `$name` does not exist in $this->shortName class."); + } + $id = $this->parameters($name)->id(); + unset($this->parameters[$name]); + + $this->raise( + new ReflectionRemoved($id, ReflectionRemoved::PARAMETER_REFLECTION_REMOVED) + ); + } + + private function normalizeParameters(): array + { + return array_map( + fn (ParameterReflection $item): array => $item->normalize(), + $this->parameters + ); + } + + public static function denormalizeParameters(array $parameters): array + { + return array_map( + fn (array $item): ParameterReflection => ParameterReflection::denormalize($item), + $parameters + ); + } +} diff --git a/src/Reflection/Domain/Entities/traits/Properties.php b/src/Reflection/Domain/Entities/traits/Properties.php new file mode 100644 index 0000000..9bcf58d --- /dev/null +++ b/src/Reflection/Domain/Entities/traits/Properties.php @@ -0,0 +1,72 @@ + + */ + private array $properties = []; + + /** + * @param null|string $name + * + * @return array|PropertyReflection + */ + public function properties(null|string $name = null): array|PropertyReflection + { + if ($name) { + if (!array_key_exists($name, $this->properties)) { + throw new \InvalidArgumentException("Property `$name` does not exist in $this->shortName class."); + } + + return $this->properties[$name]; + } + + return $this->properties; + } + + public function addProperty(PropertyReflection $property): void + { + $this->properties[$property->name()] = $property; + $this->raise( + new ReflectionAdded($property->id(), ReflectionAdded::PROPERTY_REFLECTION_ADDED) + ); + } + + public function removeProperty(string $name): void + { + if (!array_key_exists($name, $this->properties)) { + throw new \InvalidArgumentException("Property `$name` does not exist in $this->shortName class."); + } + $id = $this->properties($name)->id(); + unset($this->properties[$name]); + + $this->raise( + new ReflectionRemoved($id, ReflectionRemoved::PROPERTY_REFLECTION_REMOVED) + ); + } + + private function normalizeProperties(): array + { + return array_map( + fn (PropertyReflection $item): array => $item->normalize(), + $this->properties + ); + } + + public static function denormalizeProperties(array $properties): array + { + return array_map( + fn (array $item): PropertyReflection => PropertyReflection::denormalize($item), + $properties + ); + } +} diff --git a/src/Reflection/Domain/Events/ReflectionAdded.php b/src/Reflection/Domain/Events/ReflectionAdded.php new file mode 100644 index 0000000..cdd540f --- /dev/null +++ b/src/Reflection/Domain/Events/ReflectionAdded.php @@ -0,0 +1,45 @@ + */ + private array $classReflections = [], + ) { + } + + /** + * @param class-string|string $rootClass The class that is being reflected + * @param string $idSuffix It's used to create unique id for reflection + */ + public static function create(string $rootClass, string $idSuffix = ''): static + { + if (!class_exists($rootClass)) { + throw new \InvalidArgumentException("Class `$rootClass` does not exist."); + } + + $reflection = new static( + ReflectionId::create(md5($rootClass) . $idSuffix), + $rootClass, + ); + + $reflection->raise( + new ReflectionCreated($reflection->id()) + ); + + ClassReflection::create($rootClass, $reflection, null); + + return $reflection; + } + + /** + * @param ReflectionId $id + * @param class-string|string $rootClass + * @param array $classReflections + */ + public static function recreate( + ReflectionId $id, + string $rootClass, + array $classReflections + ): static { + return new static($id, $rootClass, $classReflections); + } + + public function id(): ReflectionId + { + return $this->id; + } + + /** @return class-string|string */ + public function rootClass(): string + { + return $this->rootClass; + } + + /** + * @param null|class-string|string $filter + * + * @return array | ClassReflection + */ + public function classReflections(?string $filter = null): array|ClassReflection + { + if ($filter) { + if (!array_key_exists($filter, $this->classReflections)) { + throw new \InvalidArgumentException("Class `$filter` not found in the class reflection collection."); + } + + return $this->classReflections[$filter]; + } + + return $this->classReflections; + } + + /** + * @param ClassReflection $classReflection + * + * @return true|ClassReflection If the class reflection already exists in the collection, it returns the existing one. + * Otherwise, it returns true to indicate that the class reflection was successfully added. + */ + public function addClassReflection(ClassReflection $classReflection): true|ClassReflection + { + foreach ($this->classReflections() as $existingClassReflection) { + if ($existingClassReflection->id() === $classReflection->id()) { + return $existingClassReflection; + } + } + $this->classReflections[$classReflection->name()] = $classReflection; + $this->raise(new ReflectionAdded($classReflection->id(), ReflectionAdded::CLASS_REFLECTION_ADDED)); + + return true; + } + + public function removeClassReflection(string $classReflectionName): void + { + if ($this->rootClass === $classReflectionName) { + throw new \InvalidArgumentException("Cannot remove the root class reflection."); + } + + $id = $this->classReflections($classReflectionName)->id(); + unset($this->classReflections[$classReflectionName]); + + $this->raise( + new ReflectionRemoved( + $id, + ReflectionRemoved::CLASS_REFLECTION_REMOVED + ) + ); + } + + public function normalize(): array + { + return [ + 'id' => $this->id()->value, + 'rootClass' => $this->rootClass(), + 'classReflections' => array_map( + fn (ClassReflection $classReflection) => $classReflection->normalize(), + $this->classReflections() + ), + ]; + } + + public static function denormalize(array $data): static + { + $classReflections = array_map( + fn (array $classReflectionData) => ClassReflection::denormalize($classReflectionData), + $data['classReflections'] + ); + + $instance = static::recreate( + ReflectionId::recreate($data['id']), + $data['rootClass'], + $classReflections + ); + + foreach ($instance->classReflections() as $classReflection) { + $classReflection->root($instance); + } + + return $instance; + } +} diff --git a/src/Shared/Application/Exception/UltraMapperException.php b/src/Shared/Application/Exception/UltraMapperException.php index 446004c..b57de11 100644 --- a/src/Shared/Application/Exception/UltraMapperException.php +++ b/src/Shared/Application/Exception/UltraMapperException.php @@ -4,6 +4,10 @@ namespace PBaszak\UltraMapper\Shared\Application\Exception; +/** + * Class UltraMapperException is the basic exception for all + * exceptions thrown by library. + */ class UltraMapperException extends \Exception { public function __construct( @@ -12,6 +16,10 @@ public function __construct( int $code = 0, ?\Throwable $previous = null ) { + if ('' === $message || '' === $advice) { + throw new \InvalidArgumentException('Message and advice cannot be empty.'); + } + parent::__construct( sprintf('%s. %s.', $this->format($message), $this->format($advice)), $code, diff --git a/src/Shared/Domain/Identity/Identifier.php b/src/Shared/Domain/Identity/Identifier.php new file mode 100644 index 0000000..6a1866b --- /dev/null +++ b/src/Shared/Domain/Identity/Identifier.php @@ -0,0 +1,30 @@ +toRfc4122()); + } +} diff --git a/src/Shared/Domain/ObjectTypes/AggregateRoot.php b/src/Shared/Domain/ObjectTypes/AggregateRoot.php new file mode 100644 index 0000000..2c5490d --- /dev/null +++ b/src/Shared/Domain/ObjectTypes/AggregateRoot.php @@ -0,0 +1,33 @@ +events; + $this->events = []; + + return $events; + } + + final protected function raise(Event $event): void + { + $this->events[] = $event; + } +} diff --git a/src/Shared/Domain/ObjectTypes/Event.php b/src/Shared/Domain/ObjectTypes/Event.php new file mode 100644 index 0000000..9b5d998 --- /dev/null +++ b/src/Shared/Domain/ObjectTypes/Event.php @@ -0,0 +1,32 @@ +identifier; + } + + public function eventVersion(): int + { + return $this->version; + } + + public function eventName(): string + { + return $this->eventName; + } +} diff --git a/src/Shared/Infrastructure/Normalization/Normalizable.php b/src/Shared/Infrastructure/Normalization/Normalizable.php index a627b2e..1b9d3a2 100644 --- a/src/Shared/Infrastructure/Normalization/Normalizable.php +++ b/src/Shared/Infrastructure/Normalization/Normalizable.php @@ -12,4 +12,11 @@ interface Normalizable * @return array */ public function normalize(): array; + + /** + * Denormalize the object from an array. + * + * @param array $data + */ + public static function denormalize(array $data): static; } diff --git a/tests/Support/UseCases/AbstractUseCase.php b/tests/Support/UseCases/AbstractUseCase.php new file mode 100644 index 0000000..3a4980d --- /dev/null +++ b/tests/Support/UseCases/AbstractUseCase.php @@ -0,0 +1,9 @@ +street = self::randomStreet(); + $address->zip = self::randomZip(); + $address->city = self::randomCity(); + $address->state = self::randomState(); + $address->country = self::randomCountry(); + + return $address; + } + + private static function randomStreet(): string + { + $streets = [ + 'First avenue 123/4', + 'Second st 12', + 'Third street 1A', + 'Fourth avenue 34B', + 'Fifth st 9/11', + ]; + + return $streets[array_rand($streets)]; + } + + private static function randomZip(): string + { + $formats = ['%d%d', '%d-%d']; + + return sprintf( + $formats[array_rand($formats)], + random_int(0, 99), + random_int(0, 999) + ); + } + + private static function randomCity(): string + { + $cities = [ + 'New York', + 'Los Angeles', + 'Chicago', + 'Houston', + 'Phoenix', + ]; + + return $cities[array_rand($cities)]; + } + + private static function randomState(): string + { + $states = [ + 'NY', + 'DOL', + 'New York', + 'California', + ]; + + return $states[array_rand($states)]; + } + + private static function randomCountry(): Country + { + $countries = [ + Country::PL, + Country::DE, + Country::FR, + Country::ES, + Country::IT, + Country::UK, + ]; + + return $countries[array_rand($countries)]; + } +} diff --git a/tests/Support/UseCases/TransformPersistenceIntoArray/Entity/Country.php b/tests/Support/UseCases/TransformPersistenceIntoArray/Entity/Country.php new file mode 100644 index 0000000..5a5bff5 --- /dev/null +++ b/tests/Support/UseCases/TransformPersistenceIntoArray/Entity/Country.php @@ -0,0 +1,15 @@ +id = self::randomId(); + $person->name = self::randomName(); + $person->sex = self::randomSex(); + $person->email = self::randomEmail(); + $person->address = Address::createRandomStub(); + $person->birthDate = self::randomBirthDate(); + $person->phone = self::randomPhone(); + + return $person; + } + + private static function randomId(): int + { + return random_int(10000, 1000000); + } + + private static function randomName(): string + { + $names = [ + 'John Doe', + 'Jane Doe', + 'Alice', + 'Bob', + 'Charlie', + 'George R. R. Martin', + ]; + + return $names[array_rand($names)]; + } + + private static function randomSex(): ?string + { + $sexes = [ + null, + Sex::M, + Sex::F, + Sex::U, + ]; + + return $sexes[array_rand($sexes)]; + } + + private static function randomEmail(): string + { + $domains = [ + 'gmail.com', + 'yahoo.com', + 'hotmail.com', + 'outlook.com', + 'protonmail.com', + ]; + + $names = [ + 'john.doe', + 'jane.doe', + 'alice', + 'bob', + 'charlie', + 'george+martin', + ]; + + return sprintf( + '%s@%s', + $names[array_rand($names)], + $domains[array_rand($domains)] + ); + } + + private static function randomBirthDate(): \DateTimeImmutable + { + return new \DateTimeImmutable(sprintf( + '-%d years', + random_int(0, 120) + )); + } + + private static function randomPhone(): ?string + { + $phones = [ + null, + '+1 123 456 789', + '+48123456789', + '+49 123 456 789', + '123 456 789', + '123456789', + '0039 123 456 789', + '0044123456789', + ]; + + return $phones[array_rand($phones)]; + } +} diff --git a/tests/Support/UseCases/TransformPersistenceIntoArray/Entity/Sex.php b/tests/Support/UseCases/TransformPersistenceIntoArray/Entity/Sex.php new file mode 100644 index 0000000..3018123 --- /dev/null +++ b/tests/Support/UseCases/TransformPersistenceIntoArray/Entity/Sex.php @@ -0,0 +1,12 @@ + */ + public function iterate(): iterable + { + foreach ($this->useCases as $useCase) { + yield $useCase; + } + } +} diff --git a/tests/Support/UseCases/_readme.md b/tests/Support/UseCases/_readme.md new file mode 100644 index 0000000..af84636 --- /dev/null +++ b/tests/Support/UseCases/_readme.md @@ -0,0 +1,4 @@ +# Ultra Mapper - use cases + +> **NOTE**
+> By `Persistence` we will most often understand a flat array or collection of such arrays, because in this form we receive data from the SQL database. diff --git a/tests/Unit/Shared/Application/Exception/UltraMapperExceptionTest.php b/tests/Unit/Shared/Application/Exception/UltraMapperExceptionTest.php new file mode 100644 index 0000000..a4dacf4 --- /dev/null +++ b/tests/Unit/Shared/Application/Exception/UltraMapperExceptionTest.php @@ -0,0 +1,50 @@ +getMessage()); + self::assertEquals(1, $exception->getCode()); + } + + public function testConstructWithoutCode(): void + { + $exception = new UltraMapperException('message', 'advice'); + + self::assertEquals('Message. Advice.', $exception->getMessage()); + self::assertEquals(0, $exception->getCode()); + } + + public function testConstructWithoutAdvice(): void + { + $this->expectException(\InvalidArgumentException::class); + + new UltraMapperException('message', ''); + } + + public function testConstructWithoutMessage(): void + { + $this->expectException(\InvalidArgumentException::class); + + new UltraMapperException('', 'advice'); + } + + public function testConstructWithoutMessageAndAdvice(): void + { + $this->expectException(\InvalidArgumentException::class); + + new UltraMapperException('', ''); + } +} diff --git a/tools/phpstan/fpm-baseline.neon b/tools/phpstan/fpm-baseline.neon index 7a7212c..364905f 100644 --- a/tools/phpstan/fpm-baseline.neon +++ b/tools/phpstan/fpm-baseline.neon @@ -1,186 +1,2 @@ parameters: ignoreErrors: - - - message: "#^Match expression does not handle remaining value\\: true$#" - count: 1 - path: ../../src/Blueprint/Application/Model/Assets/MethodBlueprint.php - - - - message: "#^Access to an undefined property PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\AttributeBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ClassBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\MethodBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ParameterBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\PropertyBlueprint\\:\\:\\$parent\\.$#" - count: 2 - path: ../../src/Blueprint/Application/Model/Blueprint.php - - - - message: "#^Parameter \\#1 \\$asset of static method PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Blueprint\\:\\:getBlueprint\\(\\) expects PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\AttributeBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ClassBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\MethodBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ParameterBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\PropertyBlueprint, PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ClassBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\MethodBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ParameterBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\PropertyBlueprint\\|null given\\.$#" - count: 1 - path: ../../src/Blueprint/Application/Model/Blueprint.php - - - - message: "#^Parameter \\#1 \\$asset of static method PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Blueprint\\:\\:getClassBlueprint\\(\\) expects PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\AttributeBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ClassBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\MethodBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ParameterBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\PropertyBlueprint, PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ClassBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\MethodBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ParameterBlueprint\\|PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\PropertyBlueprint\\|null given\\.$#" - count: 1 - path: ../../src/Blueprint/Application/Model/Blueprint.php - - - - message: "#^Parameter \\#1 \\$key of function array_key_exists expects int\\|string, string\\|false given\\.$#" - count: 1 - path: ../../src/Blueprint/Application/Model/Blueprint.php - - - - message: "#^Call to an undefined method ReflectionParameter\\|ReflectionProperty\\:\\:getDeclaringFunction\\(\\)\\.$#" - count: 1 - path: ../../src/Blueprint/Domain/Resolver/TypeResolver.php - - - - message: "#^Method PBaszak\\\\UltraMapper\\\\Blueprint\\\\Domain\\\\Resolver\\\\TypeResolver\\:\\:getCorrectClassName\\(\\) should return class\\-string\\|null but returns string\\.$#" - count: 3 - path: ../../src/Blueprint/Domain/Resolver/TypeResolver.php - - - - message: "#^Offset 0 does not exist on array\\{string\\|null\\}\\|null\\.$#" - count: 1 - path: ../../src/Blueprint/Domain/Resolver/TypeResolver.php - - - - message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|null given\\.$#" - count: 1 - path: ../../src/Blueprint/Domain/Resolver/TypeResolver.php - - - - message: "#^Ternary operator condition is always true\\.$#" - count: 2 - path: ../../src/Blueprint/Domain/Resolver/TypeResolver.php - - - - message: "#^Method PBaszak\\\\UltraMapper\\\\Mapper\\\\Application\\\\Service\\\\Mapper\\:\\:getMapper\\(\\) should return PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Contract\\\\ClassMapperInterface but returns PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Contract\\\\ClassMapperInterface\\|null\\.$#" - count: 1 - path: ../../src/Mapper/Application/Service/Mapper.php - - - - message: "#^Parameter \\#1 \\$blueprintClass of method PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Contract\\\\BlueprintInterface\\:\\:checkIfBlueprintFilesWasChanged\\(\\) expects class\\-string, string given\\.$#" - count: 1 - path: ../../src/Mapper/Application/Service/Mapper.php - - - - message: "#^Parameter \\#1 \\$class of method PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Contract\\\\BlueprintInterface\\:\\:createBlueprint\\(\\) expects class\\-string, string given\\.$#" - count: 1 - path: ../../src/Mapper/Application/Service/Mapper.php - - - - message: "#^Binary operation \"\\-\" between float\\|int and DateTime\\|float\\|int results in an error\\.$#" - count: 1 - path: ../../src/Mapper/Application/Stamp/TimeStamp.php - - - - message: "#^Cannot call method getTimestamp\\(\\) on DateTime\\|float\\|int\\.$#" - count: 1 - path: ../../src/Mapper/Application/Stamp/TimeStamp.php - - - - message: "#^Dead catch \\- Throwable is never thrown in the try block\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Abstract/AbstractMapper.php - - - - message: "#^Parameter \\#2 \\$offset of function array_splice expects int, int\\|string\\|false given\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Model/Process.php - - - - message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(object\\)\\: mixed\\)\\|null, Closure\\(PBaszak\\\\UltraMapper\\\\Mapper\\\\Application\\\\Attribute\\\\Groups\\)\\: bool given\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Checker/Strategy/RecursiveLoopChecker.php - - - - message: "#^Property PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Matcher\\\\Extender\\\\DiscriminatorExtender\\:\\:\\$blueprint is never read, only written\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Extender/Strategy/DiscriminatorExtender.php - - - - message: "#^Anonymous function should return PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Contract\\\\ClassMatchingStrategy but returns object\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Anonymous function should return PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Contract\\\\PropertyMatchingStrategy but returns object\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Call to method isStrategyConditionsMet\\(\\) on an unknown class PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\ClassMatchingStrategy\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Call to method isStrategyConditionsMet\\(\\) on an unknown class PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\PropertyMatchingStrategy\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Call to method matchClasses\\(\\) on an unknown class PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\ClassMatchingStrategy\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Call to method matchProperties\\(\\) on an unknown class PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\PropertyMatchingStrategy\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Cannot access property \\$blueprints on PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Blueprint\\|null\\.$#" - count: 3 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Parameter \\#2 \\$callback of function array_walk expects callable\\(PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\ClassMatchingStrategy, int\\|string\\)\\: mixed, Closure\\(PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Contract\\\\ClassMatchingStrategy\\|string\\)\\: PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Contract\\\\ClassMatchingStrategy given\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Parameter \\#2 \\$callback of function array_walk expects callable\\(PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\PropertyMatchingStrategy, int\\|string\\)\\: mixed, Closure\\(PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Contract\\\\PropertyMatchingStrategy\\|string\\)\\: PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Contract\\\\PropertyMatchingStrategy given\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Parameter \\#3 \\$origin of method PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Matcher\\:\\:matchClassBlueprints\\(\\) expects PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ClassBlueprint, PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Blueprint given\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Parameter \\#4 \\$source of method PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Matcher\\:\\:matchClassBlueprints\\(\\) expects PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ClassBlueprint, PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Blueprint given\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Parameter \\#5 \\$target of method PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Matcher\\:\\:matchClassBlueprints\\(\\) expects PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Assets\\\\ClassBlueprint, PBaszak\\\\UltraMapper\\\\Blueprint\\\\Application\\\\Model\\\\Blueprint given\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Parameter \\$classMatchingStrategies of method PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Matcher\\:\\:__construct\\(\\) has invalid type PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\ClassMatchingStrategy\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Parameter \\$propertyMatchingStrategies of method PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Matcher\\:\\:__construct\\(\\) has invalid type PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\PropertyMatchingStrategy\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Property PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Matcher\\:\\:\\$classMatchingStrategies has unknown class PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\ClassMatchingStrategy as its type\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Property PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\Matcher\\:\\:\\$propertyMatchingStrategies has unknown class PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Modules\\\\Matcher\\\\PropertyMatchingStrategy as its type\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Modules/Matcher/Matcher.php - - - - message: "#^Method PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Resolver\\\\MapperResolver\\:\\:resolve\\(\\) should return PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Contract\\\\ClassMapperInterface\\|null but returns object\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Resolver/MapperResolver.php - - - - message: "#^Property PBaszak\\\\UltraMapper\\\\Mapper\\\\Domain\\\\Resolver\\\\MapperResolver\\:\\:\\$mappers \\(array\\\\) does not accept array\\\\.$#" - count: 1 - path: ../../src/Mapper/Domain/Resolver/MapperResolver.php diff --git a/src/Blueprint/Application/Contract/BlueprintInterface.php b/trash/Blueprint/Application/Contract/BlueprintInterface.php similarity index 100% rename from src/Blueprint/Application/Contract/BlueprintInterface.php rename to trash/Blueprint/Application/Contract/BlueprintInterface.php diff --git a/src/Blueprint/Application/Enum/ClassType.php b/trash/Blueprint/Application/Enum/ClassType.php similarity index 100% rename from src/Blueprint/Application/Enum/ClassType.php rename to trash/Blueprint/Application/Enum/ClassType.php diff --git a/src/Blueprint/Application/Enum/TypeDeclaration.php b/trash/Blueprint/Application/Enum/TypeDeclaration.php similarity index 100% rename from src/Blueprint/Application/Enum/TypeDeclaration.php rename to trash/Blueprint/Application/Enum/TypeDeclaration.php diff --git a/src/Blueprint/Application/Enum/Visibility.php b/trash/Blueprint/Application/Enum/Visibility.php similarity index 100% rename from src/Blueprint/Application/Enum/Visibility.php rename to trash/Blueprint/Application/Enum/Visibility.php diff --git a/src/Blueprint/Application/Exception/BlueprintException.php b/trash/Blueprint/Application/Exception/BlueprintException.php similarity index 100% rename from src/Blueprint/Application/Exception/BlueprintException.php rename to trash/Blueprint/Application/Exception/BlueprintException.php diff --git a/src/Blueprint/Application/Exception/ClassNotFoundException.php b/trash/Blueprint/Application/Exception/ClassNotFoundException.php similarity index 100% rename from src/Blueprint/Application/Exception/ClassNotFoundException.php rename to trash/Blueprint/Application/Exception/ClassNotFoundException.php diff --git a/src/Blueprint/Application/Model/Assets/AssetsAggregate.php b/trash/Blueprint/Application/Model/Assets/AssetsAggregate.php similarity index 100% rename from src/Blueprint/Application/Model/Assets/AssetsAggregate.php rename to trash/Blueprint/Application/Model/Assets/AssetsAggregate.php diff --git a/src/Blueprint/Application/Model/Assets/AttributeBlueprint.php b/trash/Blueprint/Application/Model/Assets/AttributeBlueprint.php similarity index 100% rename from src/Blueprint/Application/Model/Assets/AttributeBlueprint.php rename to trash/Blueprint/Application/Model/Assets/AttributeBlueprint.php diff --git a/src/Blueprint/Application/Model/Assets/ClassBlueprint.php b/trash/Blueprint/Application/Model/Assets/ClassBlueprint.php similarity index 100% rename from src/Blueprint/Application/Model/Assets/ClassBlueprint.php rename to trash/Blueprint/Application/Model/Assets/ClassBlueprint.php diff --git a/src/Blueprint/Application/Model/Assets/MethodBlueprint.php b/trash/Blueprint/Application/Model/Assets/MethodBlueprint.php similarity index 100% rename from src/Blueprint/Application/Model/Assets/MethodBlueprint.php rename to trash/Blueprint/Application/Model/Assets/MethodBlueprint.php diff --git a/src/Blueprint/Application/Model/Assets/ParameterBlueprint.php b/trash/Blueprint/Application/Model/Assets/ParameterBlueprint.php similarity index 100% rename from src/Blueprint/Application/Model/Assets/ParameterBlueprint.php rename to trash/Blueprint/Application/Model/Assets/ParameterBlueprint.php diff --git a/src/Blueprint/Application/Model/Assets/PropertyBlueprint.php b/trash/Blueprint/Application/Model/Assets/PropertyBlueprint.php similarity index 100% rename from src/Blueprint/Application/Model/Assets/PropertyBlueprint.php rename to trash/Blueprint/Application/Model/Assets/PropertyBlueprint.php diff --git a/src/Blueprint/Application/Model/Blueprint.php b/trash/Blueprint/Application/Model/Blueprint.php similarity index 100% rename from src/Blueprint/Application/Model/Blueprint.php rename to trash/Blueprint/Application/Model/Blueprint.php diff --git a/src/Blueprint/Application/Model/Type.php b/trash/Blueprint/Application/Model/Type.php similarity index 100% rename from src/Blueprint/Application/Model/Type.php rename to trash/Blueprint/Application/Model/Type.php diff --git a/src/Blueprint/Application/Service/BlueprintService.php b/trash/Blueprint/Application/Service/BlueprintService.php similarity index 100% rename from src/Blueprint/Application/Service/BlueprintService.php rename to trash/Blueprint/Application/Service/BlueprintService.php diff --git a/src/Blueprint/Application/Trait/GetAttributes.php b/trash/Blueprint/Application/Trait/GetAttributes.php similarity index 100% rename from src/Blueprint/Application/Trait/GetAttributes.php rename to trash/Blueprint/Application/Trait/GetAttributes.php diff --git a/src/Blueprint/Domain/Resolver/TypeResolver.php b/trash/Blueprint/Domain/Resolver/TypeResolver.php similarity index 100% rename from src/Blueprint/Domain/Resolver/TypeResolver.php rename to trash/Blueprint/Domain/Resolver/TypeResolver.php diff --git a/src/Blueprint/Presentation/CLI/GenerateBlueprint.php b/trash/Blueprint/Presentation/CLI/GenerateBlueprint.php similarity index 100% rename from src/Blueprint/Presentation/CLI/GenerateBlueprint.php rename to trash/Blueprint/Presentation/CLI/GenerateBlueprint.php diff --git a/src/Build/Application/Contract/BuilderInterface.php b/trash/Build/Application/Contract/BuilderInterface.php similarity index 100% rename from src/Build/Application/Contract/BuilderInterface.php rename to trash/Build/Application/Contract/BuilderInterface.php diff --git a/src/Build/Application/Exception/BuilderException.php b/trash/Build/Application/Exception/BuilderException.php similarity index 100% rename from src/Build/Application/Exception/BuilderException.php rename to trash/Build/Application/Exception/BuilderException.php diff --git a/src/Build/Application/Model/Build.php b/trash/Build/Application/Model/Build.php similarity index 100% rename from src/Build/Application/Model/Build.php rename to trash/Build/Application/Model/Build.php diff --git a/src/Build/Application/Model/ClassBuildContext.php b/trash/Build/Application/Model/ClassBuildContext.php similarity index 100% rename from src/Build/Application/Model/ClassBuildContext.php rename to trash/Build/Application/Model/ClassBuildContext.php diff --git a/src/Build/Application/Model/Enum/AccessOption.php b/trash/Build/Application/Model/Enum/AccessOption.php similarity index 100% rename from src/Build/Application/Model/Enum/AccessOption.php rename to trash/Build/Application/Model/Enum/AccessOption.php diff --git a/src/Build/Application/Model/Enum/AccessType.php b/trash/Build/Application/Model/Enum/AccessType.php similarity index 100% rename from src/Build/Application/Model/Enum/AccessType.php rename to trash/Build/Application/Model/Enum/AccessType.php diff --git a/src/Build/Application/Model/Enum/AssignmentType.php b/trash/Build/Application/Model/Enum/AssignmentType.php similarity index 100% rename from src/Build/Application/Model/Enum/AssignmentType.php rename to trash/Build/Application/Model/Enum/AssignmentType.php diff --git a/src/Build/Application/Model/Enum/CallbackOption.php b/trash/Build/Application/Model/Enum/CallbackOption.php similarity index 100% rename from src/Build/Application/Model/Enum/CallbackOption.php rename to trash/Build/Application/Model/Enum/CallbackOption.php diff --git a/src/Build/Application/Model/PropertyBuildContext.php b/trash/Build/Application/Model/PropertyBuildContext.php similarity index 100% rename from src/Build/Application/Model/PropertyBuildContext.php rename to trash/Build/Application/Model/PropertyBuildContext.php diff --git a/src/Build/Application/Service/BuilderService.php b/trash/Build/Application/Service/BuilderService.php similarity index 100% rename from src/Build/Application/Service/BuilderService.php rename to trash/Build/Application/Service/BuilderService.php diff --git a/src/Build/Presentation/Documentation/Build.md b/trash/Build/Presentation/Documentation/Build.md similarity index 100% rename from src/Build/Presentation/Documentation/Build.md rename to trash/Build/Presentation/Documentation/Build.md diff --git a/src/Mapper/Application/Attribute/Accessor.php b/trash/Mapper/Application/Attribute/Accessor.php similarity index 100% rename from src/Mapper/Application/Attribute/Accessor.php rename to trash/Mapper/Application/Attribute/Accessor.php diff --git a/src/Mapper/Application/Attribute/ApplyToCollectionItem.php b/trash/Mapper/Application/Attribute/ApplyToCollectionItem.php similarity index 100% rename from src/Mapper/Application/Attribute/ApplyToCollectionItem.php rename to trash/Mapper/Application/Attribute/ApplyToCollectionItem.php diff --git a/src/Mapper/Application/Attribute/Callback.php b/trash/Mapper/Application/Attribute/Callback.php similarity index 100% rename from src/Mapper/Application/Attribute/Callback.php rename to trash/Mapper/Application/Attribute/Callback.php diff --git a/src/Mapper/Application/Attribute/Constructor.php b/trash/Mapper/Application/Attribute/Constructor.php similarity index 100% rename from src/Mapper/Application/Attribute/Constructor.php rename to trash/Mapper/Application/Attribute/Constructor.php diff --git a/src/Mapper/Application/Attribute/Discriminator.php b/trash/Mapper/Application/Attribute/Discriminator.php similarity index 100% rename from src/Mapper/Application/Attribute/Discriminator.php rename to trash/Mapper/Application/Attribute/Discriminator.php diff --git a/src/Mapper/Application/Attribute/Groups.php b/trash/Mapper/Application/Attribute/Groups.php similarity index 100% rename from src/Mapper/Application/Attribute/Groups.php rename to trash/Mapper/Application/Attribute/Groups.php diff --git a/src/Mapper/Application/Attribute/Ignore.php b/trash/Mapper/Application/Attribute/Ignore.php similarity index 100% rename from src/Mapper/Application/Attribute/Ignore.php rename to trash/Mapper/Application/Attribute/Ignore.php diff --git a/src/Mapper/Application/Attribute/MaxDepth.php b/trash/Mapper/Application/Attribute/MaxDepth.php similarity index 100% rename from src/Mapper/Application/Attribute/MaxDepth.php rename to trash/Mapper/Application/Attribute/MaxDepth.php diff --git a/src/Mapper/Application/Attribute/SimpleObject.php b/trash/Mapper/Application/Attribute/SimpleObject.php similarity index 100% rename from src/Mapper/Application/Attribute/SimpleObject.php rename to trash/Mapper/Application/Attribute/SimpleObject.php diff --git a/src/Mapper/Application/Attribute/TargetPropertyName.php b/trash/Mapper/Application/Attribute/TargetPropertyName.php similarity index 100% rename from src/Mapper/Application/Attribute/TargetPropertyName.php rename to trash/Mapper/Application/Attribute/TargetPropertyName.php diff --git a/src/Mapper/Application/Attribute/TargetPropertyPath.php b/trash/Mapper/Application/Attribute/TargetPropertyPath.php similarity index 100% rename from src/Mapper/Application/Attribute/TargetPropertyPath.php rename to trash/Mapper/Application/Attribute/TargetPropertyPath.php diff --git a/src/Mapper/Application/Contract/AttributeInterface.php b/trash/Mapper/Application/Contract/AttributeInterface.php similarity index 100% rename from src/Mapper/Application/Contract/AttributeInterface.php rename to trash/Mapper/Application/Contract/AttributeInterface.php diff --git a/src/Mapper/Application/Contract/MapperInterface.php b/trash/Mapper/Application/Contract/MapperInterface.php similarity index 100% rename from src/Mapper/Application/Contract/MapperInterface.php rename to trash/Mapper/Application/Contract/MapperInterface.php diff --git a/src/Mapper/Application/Contract/StampInterface.php b/trash/Mapper/Application/Contract/StampInterface.php similarity index 100% rename from src/Mapper/Application/Contract/StampInterface.php rename to trash/Mapper/Application/Contract/StampInterface.php diff --git a/src/Mapper/Application/Contract/TypeInterface.php b/trash/Mapper/Application/Contract/TypeInterface.php similarity index 100% rename from src/Mapper/Application/Contract/TypeInterface.php rename to trash/Mapper/Application/Contract/TypeInterface.php diff --git a/src/Mapper/Application/Exception/AttributeValidationException.php b/trash/Mapper/Application/Exception/AttributeValidationException.php similarity index 100% rename from src/Mapper/Application/Exception/AttributeValidationException.php rename to trash/Mapper/Application/Exception/AttributeValidationException.php diff --git a/src/Mapper/Application/Exception/ThrowAttributeValidationExceptionTrait.php b/trash/Mapper/Application/Exception/ThrowAttributeValidationExceptionTrait.php similarity index 100% rename from src/Mapper/Application/Exception/ThrowAttributeValidationExceptionTrait.php rename to trash/Mapper/Application/Exception/ThrowAttributeValidationExceptionTrait.php diff --git a/src/Mapper/Application/Model/Context.php b/trash/Mapper/Application/Model/Context.php similarity index 100% rename from src/Mapper/Application/Model/Context.php rename to trash/Mapper/Application/Model/Context.php diff --git a/src/Mapper/Application/Model/Envelope.php b/trash/Mapper/Application/Model/Envelope.php similarity index 100% rename from src/Mapper/Application/Model/Envelope.php rename to trash/Mapper/Application/Model/Envelope.php diff --git a/src/Mapper/Application/Service/Mapper.php b/trash/Mapper/Application/Service/Mapper.php similarity index 100% rename from src/Mapper/Application/Service/Mapper.php rename to trash/Mapper/Application/Service/Mapper.php diff --git a/src/Mapper/Application/Stamp/TimeStamp.php b/trash/Mapper/Application/Stamp/TimeStamp.php similarity index 100% rename from src/Mapper/Application/Stamp/TimeStamp.php rename to trash/Mapper/Application/Stamp/TimeStamp.php diff --git a/src/Mapper/Application/Type/AnonymousObjectType.php b/trash/Mapper/Application/Type/AnonymousObjectType.php similarity index 100% rename from src/Mapper/Application/Type/AnonymousObjectType.php rename to trash/Mapper/Application/Type/AnonymousObjectType.php diff --git a/src/Mapper/Application/Type/ArrayType.php b/trash/Mapper/Application/Type/ArrayType.php similarity index 100% rename from src/Mapper/Application/Type/ArrayType.php rename to trash/Mapper/Application/Type/ArrayType.php diff --git a/src/Mapper/Application/Type/ClassObjectType.php b/trash/Mapper/Application/Type/ClassObjectType.php similarity index 100% rename from src/Mapper/Application/Type/ClassObjectType.php rename to trash/Mapper/Application/Type/ClassObjectType.php diff --git a/src/Mapper/Application/Type/FlatArrayType.php b/trash/Mapper/Application/Type/FlatArrayType.php similarity index 100% rename from src/Mapper/Application/Type/FlatArrayType.php rename to trash/Mapper/Application/Type/FlatArrayType.php diff --git a/src/Mapper/Domain/Abstract/AbstractMapper.php b/trash/Mapper/Domain/Abstract/AbstractMapper.php similarity index 100% rename from src/Mapper/Domain/Abstract/AbstractMapper.php rename to trash/Mapper/Domain/Abstract/AbstractMapper.php diff --git a/src/Mapper/Domain/Abstract/MapDateTimeTrait.php b/trash/Mapper/Domain/Abstract/MapDateTimeTrait.php similarity index 100% rename from src/Mapper/Domain/Abstract/MapDateTimeTrait.php rename to trash/Mapper/Domain/Abstract/MapDateTimeTrait.php diff --git a/src/Mapper/Domain/Contract/ClassMapperInterface.php b/trash/Mapper/Domain/Contract/ClassMapperInterface.php similarity index 100% rename from src/Mapper/Domain/Contract/ClassMapperInterface.php rename to trash/Mapper/Domain/Contract/ClassMapperInterface.php diff --git a/src/Mapper/Domain/Exception/Value/InvalidValueException.php b/trash/Mapper/Domain/Exception/Value/InvalidValueException.php similarity index 100% rename from src/Mapper/Domain/Exception/Value/InvalidValueException.php rename to trash/Mapper/Domain/Exception/Value/InvalidValueException.php diff --git a/src/Mapper/Domain/Exception/Value/NotExistsValueException.php b/trash/Mapper/Domain/Exception/Value/NotExistsValueException.php similarity index 100% rename from src/Mapper/Domain/Exception/Value/NotExistsValueException.php rename to trash/Mapper/Domain/Exception/Value/NotExistsValueException.php diff --git a/src/Mapper/Domain/Model/Process.php b/trash/Mapper/Domain/Model/Process.php similarity index 100% rename from src/Mapper/Domain/Model/Process.php rename to trash/Mapper/Domain/Model/Process.php diff --git a/src/Mapper/Domain/Modules/Checker/Checker.php b/trash/Mapper/Domain/Modules/Checker/Checker.php similarity index 100% rename from src/Mapper/Domain/Modules/Checker/Checker.php rename to trash/Mapper/Domain/Modules/Checker/Checker.php diff --git a/src/Mapper/Domain/Modules/Checker/Contract/CheckerInterface.php b/trash/Mapper/Domain/Modules/Checker/Contract/CheckerInterface.php similarity index 100% rename from src/Mapper/Domain/Modules/Checker/Contract/CheckerInterface.php rename to trash/Mapper/Domain/Modules/Checker/Contract/CheckerInterface.php diff --git a/src/Mapper/Domain/Modules/Checker/Contract/CheckerStrategyInterface.php b/trash/Mapper/Domain/Modules/Checker/Contract/CheckerStrategyInterface.php similarity index 100% rename from src/Mapper/Domain/Modules/Checker/Contract/CheckerStrategyInterface.php rename to trash/Mapper/Domain/Modules/Checker/Contract/CheckerStrategyInterface.php diff --git a/src/Mapper/Domain/Modules/Checker/Exception/CheckerException.php b/trash/Mapper/Domain/Modules/Checker/Exception/CheckerException.php similarity index 100% rename from src/Mapper/Domain/Modules/Checker/Exception/CheckerException.php rename to trash/Mapper/Domain/Modules/Checker/Exception/CheckerException.php diff --git a/src/Mapper/Domain/Modules/Checker/Strategy/RecursiveLoopChecker.php b/trash/Mapper/Domain/Modules/Checker/Strategy/RecursiveLoopChecker.php similarity index 100% rename from src/Mapper/Domain/Modules/Checker/Strategy/RecursiveLoopChecker.php rename to trash/Mapper/Domain/Modules/Checker/Strategy/RecursiveLoopChecker.php diff --git a/src/Mapper/Domain/Modules/Extender/Contract/ExtenderInterface.php b/trash/Mapper/Domain/Modules/Extender/Contract/ExtenderInterface.php similarity index 100% rename from src/Mapper/Domain/Modules/Extender/Contract/ExtenderInterface.php rename to trash/Mapper/Domain/Modules/Extender/Contract/ExtenderInterface.php diff --git a/src/Mapper/Domain/Modules/Extender/Contract/ExtenderStrategyInterface.php b/trash/Mapper/Domain/Modules/Extender/Contract/ExtenderStrategyInterface.php similarity index 100% rename from src/Mapper/Domain/Modules/Extender/Contract/ExtenderStrategyInterface.php rename to trash/Mapper/Domain/Modules/Extender/Contract/ExtenderStrategyInterface.php diff --git a/src/Mapper/Domain/Modules/Extender/Exception/ExtenderException.php b/trash/Mapper/Domain/Modules/Extender/Exception/ExtenderException.php similarity index 100% rename from src/Mapper/Domain/Modules/Extender/Exception/ExtenderException.php rename to trash/Mapper/Domain/Modules/Extender/Exception/ExtenderException.php diff --git a/src/Mapper/Domain/Modules/Extender/Extender.php b/trash/Mapper/Domain/Modules/Extender/Extender.php similarity index 100% rename from src/Mapper/Domain/Modules/Extender/Extender.php rename to trash/Mapper/Domain/Modules/Extender/Extender.php diff --git a/src/Mapper/Domain/Modules/Extender/Strategy/DiscriminatorExtender.php b/trash/Mapper/Domain/Modules/Extender/Strategy/DiscriminatorExtender.php similarity index 100% rename from src/Mapper/Domain/Modules/Extender/Strategy/DiscriminatorExtender.php rename to trash/Mapper/Domain/Modules/Extender/Strategy/DiscriminatorExtender.php diff --git a/src/Mapper/Domain/Modules/Matcher/Contract/ClassMatchingStrategy.php b/trash/Mapper/Domain/Modules/Matcher/Contract/ClassMatchingStrategy.php similarity index 100% rename from src/Mapper/Domain/Modules/Matcher/Contract/ClassMatchingStrategy.php rename to trash/Mapper/Domain/Modules/Matcher/Contract/ClassMatchingStrategy.php diff --git a/src/Mapper/Domain/Modules/Matcher/Contract/MatcherInterface.php b/trash/Mapper/Domain/Modules/Matcher/Contract/MatcherInterface.php similarity index 100% rename from src/Mapper/Domain/Modules/Matcher/Contract/MatcherInterface.php rename to trash/Mapper/Domain/Modules/Matcher/Contract/MatcherInterface.php diff --git a/src/Mapper/Domain/Modules/Matcher/Contract/PropertyMatchingStrategy.php b/trash/Mapper/Domain/Modules/Matcher/Contract/PropertyMatchingStrategy.php similarity index 100% rename from src/Mapper/Domain/Modules/Matcher/Contract/PropertyMatchingStrategy.php rename to trash/Mapper/Domain/Modules/Matcher/Contract/PropertyMatchingStrategy.php diff --git a/src/Mapper/Domain/Modules/Matcher/Exception/PropertyNotMatchedException.php b/trash/Mapper/Domain/Modules/Matcher/Exception/PropertyNotMatchedException.php similarity index 100% rename from src/Mapper/Domain/Modules/Matcher/Exception/PropertyNotMatchedException.php rename to trash/Mapper/Domain/Modules/Matcher/Exception/PropertyNotMatchedException.php diff --git a/src/Mapper/Domain/Modules/Matcher/Matcher.php b/trash/Mapper/Domain/Modules/Matcher/Matcher.php similarity index 100% rename from src/Mapper/Domain/Modules/Matcher/Matcher.php rename to trash/Mapper/Domain/Modules/Matcher/Matcher.php diff --git a/src/Mapper/Domain/Modules/Matcher/Strategy/PropertySameNameMatchingStrategy.php b/trash/Mapper/Domain/Modules/Matcher/Strategy/PropertySameNameMatchingStrategy.php similarity index 100% rename from src/Mapper/Domain/Modules/Matcher/Strategy/PropertySameNameMatchingStrategy.php rename to trash/Mapper/Domain/Modules/Matcher/Strategy/PropertySameNameMatchingStrategy.php diff --git a/src/Mapper/Domain/Modules/Modificator/Contract/ModificatorInterface.php b/trash/Mapper/Domain/Modules/Modificator/Contract/ModificatorInterface.php similarity index 100% rename from src/Mapper/Domain/Modules/Modificator/Contract/ModificatorInterface.php rename to trash/Mapper/Domain/Modules/Modificator/Contract/ModificatorInterface.php diff --git a/src/Mapper/Domain/Modules/Modificator/Contract/ModifierInterface.php b/trash/Mapper/Domain/Modules/Modificator/Contract/ModifierInterface.php similarity index 100% rename from src/Mapper/Domain/Modules/Modificator/Contract/ModifierInterface.php rename to trash/Mapper/Domain/Modules/Modificator/Contract/ModifierInterface.php diff --git a/src/Mapper/Domain/Modules/Modificator/Exception/ModifierException.php b/trash/Mapper/Domain/Modules/Modificator/Exception/ModifierException.php similarity index 100% rename from src/Mapper/Domain/Modules/Modificator/Exception/ModifierException.php rename to trash/Mapper/Domain/Modules/Modificator/Exception/ModifierException.php diff --git a/src/Mapper/Domain/Modules/Modificator/Modificator.php b/trash/Mapper/Domain/Modules/Modificator/Modificator.php similarity index 100% rename from src/Mapper/Domain/Modules/Modificator/Modificator.php rename to trash/Mapper/Domain/Modules/Modificator/Modificator.php diff --git a/src/Mapper/Domain/Modules/Modificator/Strategy/JMSSerializer.php b/trash/Mapper/Domain/Modules/Modificator/Strategy/JMSSerializer.php similarity index 100% rename from src/Mapper/Domain/Modules/Modificator/Strategy/JMSSerializer.php rename to trash/Mapper/Domain/Modules/Modificator/Strategy/JMSSerializer.php diff --git a/src/Mapper/Domain/Modules/Modificator/Strategy/SymfonySerializer.php b/trash/Mapper/Domain/Modules/Modificator/Strategy/SymfonySerializer.php similarity index 100% rename from src/Mapper/Domain/Modules/Modificator/Strategy/SymfonySerializer.php rename to trash/Mapper/Domain/Modules/Modificator/Strategy/SymfonySerializer.php diff --git a/src/Mapper/Domain/Modules/Modificator/Strategy/SymfonyValidator.php b/trash/Mapper/Domain/Modules/Modificator/Strategy/SymfonyValidator.php similarity index 100% rename from src/Mapper/Domain/Modules/Modificator/Strategy/SymfonyValidator.php rename to trash/Mapper/Domain/Modules/Modificator/Strategy/SymfonyValidator.php diff --git a/src/Mapper/Domain/Resolver/MapperResolver.php b/trash/Mapper/Domain/Resolver/MapperResolver.php similarity index 100% rename from src/Mapper/Domain/Resolver/MapperResolver.php rename to trash/Mapper/Domain/Resolver/MapperResolver.php diff --git a/src/Mapper/Domain/Resolver/ProcessResolver.php b/trash/Mapper/Domain/Resolver/ProcessResolver.php similarity index 100% rename from src/Mapper/Domain/Resolver/ProcessResolver.php rename to trash/Mapper/Domain/Resolver/ProcessResolver.php diff --git a/tests/Assets/DataSets.php b/trash/tests/Assets/DataSets.php similarity index 100% rename from tests/Assets/DataSets.php rename to trash/tests/Assets/DataSets.php diff --git a/tests/Assets/Dummy.php b/trash/tests/Assets/Dummy.php similarity index 100% rename from tests/Assets/Dummy.php rename to trash/tests/Assets/Dummy.php diff --git a/tests/Assets/DummySimple.php b/trash/tests/Assets/DummySimple.php similarity index 100% rename from tests/Assets/DummySimple.php rename to trash/tests/Assets/DummySimple.php diff --git a/tests/Assets/DummySimpleWithAttribute.php b/trash/tests/Assets/DummySimpleWithAttribute.php similarity index 100% rename from tests/Assets/DummySimpleWithAttribute.php rename to trash/tests/Assets/DummySimpleWithAttribute.php diff --git a/tests/Assets/pbaszak_ultramapper_tests_assets_dummy.yaml b/trash/tests/Assets/pbaszak_ultramapper_tests_assets_dummy.yaml similarity index 100% rename from tests/Assets/pbaszak_ultramapper_tests_assets_dummy.yaml rename to trash/tests/Assets/pbaszak_ultramapper_tests_assets_dummy.yaml diff --git a/tests/Assets/pbaszak_ultramapper_tests_assets_dummysimple.yaml b/trash/tests/Assets/pbaszak_ultramapper_tests_assets_dummysimple.yaml similarity index 100% rename from tests/Assets/pbaszak_ultramapper_tests_assets_dummysimple.yaml rename to trash/tests/Assets/pbaszak_ultramapper_tests_assets_dummysimple.yaml diff --git a/tests/Assets/pbaszak_ultramapper_tests_assets_dummysimplewithattribute.yaml b/trash/tests/Assets/pbaszak_ultramapper_tests_assets_dummysimplewithattribute.yaml similarity index 100% rename from tests/Assets/pbaszak_ultramapper_tests_assets_dummysimplewithattribute.yaml rename to trash/tests/Assets/pbaszak_ultramapper_tests_assets_dummysimplewithattribute.yaml diff --git a/tests/Blueprint/E2e/Presentation/CLI/GenerateBlueprintCommandTest.php b/trash/tests/Blueprint/E2e/Presentation/CLI/GenerateBlueprintCommandTest.php similarity index 100% rename from tests/Blueprint/E2e/Presentation/CLI/GenerateBlueprintCommandTest.php rename to trash/tests/Blueprint/E2e/Presentation/CLI/GenerateBlueprintCommandTest.php diff --git a/tests/Blueprint/Unit/Application/Model/AttributeBlueprintTest.php b/trash/tests/Blueprint/Unit/Application/Model/AttributeBlueprintTest.php similarity index 100% rename from tests/Blueprint/Unit/Application/Model/AttributeBlueprintTest.php rename to trash/tests/Blueprint/Unit/Application/Model/AttributeBlueprintTest.php diff --git a/tests/Blueprint/Unit/Application/Model/ClassBlueprintTest.php b/trash/tests/Blueprint/Unit/Application/Model/ClassBlueprintTest.php similarity index 100% rename from tests/Blueprint/Unit/Application/Model/ClassBlueprintTest.php rename to trash/tests/Blueprint/Unit/Application/Model/ClassBlueprintTest.php diff --git a/tests/Blueprint/Unit/Application/Model/MethodBlueprintTest.php b/trash/tests/Blueprint/Unit/Application/Model/MethodBlueprintTest.php similarity index 100% rename from tests/Blueprint/Unit/Application/Model/MethodBlueprintTest.php rename to trash/tests/Blueprint/Unit/Application/Model/MethodBlueprintTest.php diff --git a/tests/Blueprint/Unit/Application/Model/ParameterBlueprintTest.php b/trash/tests/Blueprint/Unit/Application/Model/ParameterBlueprintTest.php similarity index 100% rename from tests/Blueprint/Unit/Application/Model/ParameterBlueprintTest.php rename to trash/tests/Blueprint/Unit/Application/Model/ParameterBlueprintTest.php diff --git a/tests/Blueprint/Unit/Application/Model/PropertyBlueprintTest.php b/trash/tests/Blueprint/Unit/Application/Model/PropertyBlueprintTest.php similarity index 100% rename from tests/Blueprint/Unit/Application/Model/PropertyBlueprintTest.php rename to trash/tests/Blueprint/Unit/Application/Model/PropertyBlueprintTest.php diff --git a/tests/Blueprint/Unit/Application/Model/TypeTest.php b/trash/tests/Blueprint/Unit/Application/Model/TypeTest.php similarity index 100% rename from tests/Blueprint/Unit/Application/Model/TypeTest.php rename to trash/tests/Blueprint/Unit/Application/Model/TypeTest.php diff --git a/tests/Blueprint/Unit/Domain/Resolver/TestedClass.php b/trash/tests/Blueprint/Unit/Domain/Resolver/TestedClass.php similarity index 100% rename from tests/Blueprint/Unit/Domain/Resolver/TestedClass.php rename to trash/tests/Blueprint/Unit/Domain/Resolver/TestedClass.php diff --git a/tests/Blueprint/Unit/Domain/Resolver/TypeResolverTest.php b/trash/tests/Blueprint/Unit/Domain/Resolver/TypeResolverTest.php similarity index 100% rename from tests/Blueprint/Unit/Domain/Resolver/TypeResolverTest.php rename to trash/tests/Blueprint/Unit/Domain/Resolver/TypeResolverTest.php diff --git a/trash/tests/Kernel.php b/trash/tests/Kernel.php new file mode 100644 index 0000000..2d0e38a --- /dev/null +++ b/trash/tests/Kernel.php @@ -0,0 +1,18 @@ +overload('/etc/environment'); + } +} diff --git a/tests/Mapper/Unit/Domain/Modules/Checker/RecursiveLoopCheckerTest.php b/trash/tests/Mapper/Unit/Domain/Modules/Checker/RecursiveLoopCheckerTest.php similarity index 100% rename from tests/Mapper/Unit/Domain/Modules/Checker/RecursiveLoopCheckerTest.php rename to trash/tests/Mapper/Unit/Domain/Modules/Checker/RecursiveLoopCheckerTest.php diff --git a/tests/Mapper/Unit/Domain/Resolver/MapperResolverTest.php b/trash/tests/Mapper/Unit/Domain/Resolver/MapperResolverTest.php similarity index 100% rename from tests/Mapper/Unit/Domain/Resolver/MapperResolverTest.php rename to trash/tests/Mapper/Unit/Domain/Resolver/MapperResolverTest.php diff --git a/tests/Mapper/Unit/Domain/Resolver/ProcessResolverTest.php b/trash/tests/Mapper/Unit/Domain/Resolver/ProcessResolverTest.php similarity index 100% rename from tests/Mapper/Unit/Domain/Resolver/ProcessResolverTest.php rename to trash/tests/Mapper/Unit/Domain/Resolver/ProcessResolverTest.php diff --git a/trash/tests/bootstrap.php b/trash/tests/bootstrap.php new file mode 100644 index 0000000..1e60149 --- /dev/null +++ b/trash/tests/bootstrap.php @@ -0,0 +1,14 @@ +bootEnv(dirname(__DIR__).'/.env'); +}