diff --git a/src/JsonSchema/Generator/Model/PropertyGenerator.php b/src/JsonSchema/Generator/Model/PropertyGenerator.php index 3032d1a062..6519a204c5 100644 --- a/src/JsonSchema/Generator/Model/PropertyGenerator.php +++ b/src/JsonSchema/Generator/Model/PropertyGenerator.php @@ -27,7 +27,7 @@ abstract protected function getParser(); protected function createProperty(Property $property, $namespace, $default = null, bool $required = false): Stmt { - $propertyName = $property->getPhpName(); + $propertyName = $this->getNaming()->getPropertyName($property->getPhpName()); $propertyStmt = new Stmt\PropertyProperty($propertyName); if (null === $default) { diff --git a/src/JsonSchema/Generator/Naming.php b/src/JsonSchema/Generator/Naming.php index d57dddb8d9..168f4c3ac0 100644 --- a/src/JsonSchema/Generator/Naming.php +++ b/src/JsonSchema/Generator/Naming.php @@ -29,54 +29,23 @@ class Naming )\b /ix'; - /** - * Get a property name. - * - * @param $name - * - * @return string - */ - public function getPropertyName($name) + public function getPropertyName(string $name): string { - $name = $this->replaceDollar($name); + $name = $this->cleaning($name); - return Inflector::camelize($name); + return $name; } - /** - * Get a method name given a prefix. - * - * @param $prefix - * @param $name - * - * @return string - */ - public function getPrefixedMethodName($prefix, $name) + public function getPrefixedMethodName(string $prefix, string $name): string { - $name = $this->replaceDollar($name); + $name = $this->cleaning($name); return sprintf('%s%s', $prefix, Inflector::classify($name)); } - /** - * Get a class name. - * - * @param $name - * - * @return string - */ - public function getClassName($name) + public function getClassName(string $name): string { - $name = $this->replaceDollar($name); - $name = preg_replace_callback('#[/\{\}]+(\w)#', function ($matches) { - return ucfirst($matches[1]); - }, $name); - - // Doctrine Inflector does not seem to handle some characters (like dots) well. - // So replace invalid char by an underscore to allow Doctrine to uppercase word correctly. - $name = trim(preg_replace('/[^a-z0-9 ]+/iu', '_', $name)); - - $name = Inflector::classify($name); + $name = $this->cleaning($name, true); if (preg_match(self::BAD_CLASS_NAME_REGEX, $name)) { $name = '_' . $name; @@ -85,12 +54,7 @@ public function getClassName($name) return $name; } - /** - * @param $name - * - * @return mixed - */ - protected function replaceDollar($name) + protected function cleaning(string $name, bool $class = false): string { if (preg_match('/\$/', $name)) { $name = preg_replace_callback('/\$([a-z])/', function ($matches) { @@ -98,6 +62,18 @@ protected function replaceDollar($name) }, $name); } - return $name; + $name = preg_replace_callback('#[/\{\}]+(\w)#', function ($matches) { + return ucfirst($matches[1]); + }, $name); + + // Doctrine Inflector does not seem to handle some characters (like dots, @, :) well. + // So replace invalid char by an underscore to allow Doctrine to uppercase word correctly. + $name = trim(preg_replace('/[^a-z0-9 ]+/iu', '_', $name)); + + if ($class) { + return Inflector::classify($name); + } + + return Inflector::camelize($name); } } diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200.php index 143baf0673..32b1753175 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200.php @@ -9,44 +9,44 @@ class BooksGetResponse200 * * @var object[] */ - protected $hydra:member; + protected $hydraMember; /** * * * @var int */ - protected $hydra:totalItems; + protected $hydraTotalItems; /** * * * @var BooksGetResponse200HydraView */ - protected $hydra:view; + protected $hydraView; /** * * * @var BooksGetResponse200HydraSearch */ - protected $hydra:search; + protected $hydraSearch; /** * * * @return object[] */ - public function getHydra:member() : array + public function getHydraMember() : array { - return $this->hydra:member; + return $this->hydraMember; } /** * * - * @param object[] $hydra:member + * @param object[] $hydraMember * * @return self */ - public function setHydra:member(array $hydra:member) : self + public function setHydraMember(array $hydraMember) : self { - $this->hydra:member = $hydra:member; + $this->hydraMember = $hydraMember; return $this; } /** @@ -54,20 +54,20 @@ public function setHydra:member(array $hydra:member) : self * * @return int */ - public function getHydra:totalItems() : int + public function getHydraTotalItems() : int { - return $this->hydra:totalItems; + return $this->hydraTotalItems; } /** * * - * @param int $hydra:totalItems + * @param int $hydraTotalItems * * @return self */ - public function setHydra:totalItems(int $hydra:totalItems) : self + public function setHydraTotalItems(int $hydraTotalItems) : self { - $this->hydra:totalItems = $hydra:totalItems; + $this->hydraTotalItems = $hydraTotalItems; return $this; } /** @@ -75,20 +75,20 @@ public function setHydra:totalItems(int $hydra:totalItems) : self * * @return BooksGetResponse200HydraView */ - public function getHydra:view() : BooksGetResponse200HydraView + public function getHydraView() : BooksGetResponse200HydraView { - return $this->hydra:view; + return $this->hydraView; } /** * * - * @param BooksGetResponse200HydraView $hydra:view + * @param BooksGetResponse200HydraView $hydraView * * @return self */ - public function setHydra:view(BooksGetResponse200HydraView $hydra:view) : self + public function setHydraView(BooksGetResponse200HydraView $hydraView) : self { - $this->hydra:view = $hydra:view; + $this->hydraView = $hydraView; return $this; } /** @@ -96,20 +96,20 @@ public function setHydra:view(BooksGetResponse200HydraView $hydra:view) : self * * @return BooksGetResponse200HydraSearch */ - public function getHydra:search() : BooksGetResponse200HydraSearch + public function getHydraSearch() : BooksGetResponse200HydraSearch { - return $this->hydra:search; + return $this->hydraSearch; } /** * * - * @param BooksGetResponse200HydraSearch $hydra:search + * @param BooksGetResponse200HydraSearch $hydraSearch * * @return self */ - public function setHydra:search(BooksGetResponse200HydraSearch $hydra:search) : self + public function setHydraSearch(BooksGetResponse200HydraSearch $hydraSearch) : self { - $this->hydra:search = $hydra:search; + $this->hydraSearch = $hydraSearch; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraSearch.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraSearch.php index 5d14e6a2a9..49e75f1569 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraSearch.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraSearch.php @@ -9,44 +9,44 @@ class BooksGetResponse200HydraSearch * * @var string */ - protected $@type; + protected $type; /** * * * @var string */ - protected $hydra:template; + protected $hydraTemplate; /** * * * @var string */ - protected $hydra:variableRepresentation; + protected $hydraVariableRepresentation; /** * * * @var BooksGetResponse200HydraSearchHydraMappingItem[] */ - protected $hydra:mapping; + protected $hydraMapping; /** * * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** @@ -54,20 +54,20 @@ public function set@type(string $@type) : self * * @return string */ - public function getHydra:template() : string + public function getHydraTemplate() : string { - return $this->hydra:template; + return $this->hydraTemplate; } /** * * - * @param string $hydra:template + * @param string $hydraTemplate * * @return self */ - public function setHydra:template(string $hydra:template) : self + public function setHydraTemplate(string $hydraTemplate) : self { - $this->hydra:template = $hydra:template; + $this->hydraTemplate = $hydraTemplate; return $this; } /** @@ -75,20 +75,20 @@ public function setHydra:template(string $hydra:template) : self * * @return string */ - public function getHydra:variableRepresentation() : string + public function getHydraVariableRepresentation() : string { - return $this->hydra:variableRepresentation; + return $this->hydraVariableRepresentation; } /** * * - * @param string $hydra:variableRepresentation + * @param string $hydraVariableRepresentation * * @return self */ - public function setHydra:variableRepresentation(string $hydra:variableRepresentation) : self + public function setHydraVariableRepresentation(string $hydraVariableRepresentation) : self { - $this->hydra:variableRepresentation = $hydra:variableRepresentation; + $this->hydraVariableRepresentation = $hydraVariableRepresentation; return $this; } /** @@ -96,20 +96,20 @@ public function setHydra:variableRepresentation(string $hydra:variableRepresenta * * @return BooksGetResponse200HydraSearchHydraMappingItem[] */ - public function getHydra:mapping() : array + public function getHydraMapping() : array { - return $this->hydra:mapping; + return $this->hydraMapping; } /** * * - * @param BooksGetResponse200HydraSearchHydraMappingItem[] $hydra:mapping + * @param BooksGetResponse200HydraSearchHydraMappingItem[] $hydraMapping * * @return self */ - public function setHydra:mapping(array $hydra:mapping) : self + public function setHydraMapping(array $hydraMapping) : self { - $this->hydra:mapping = $hydra:mapping; + $this->hydraMapping = $hydraMapping; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraSearchHydraMappingItem.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraSearchHydraMappingItem.php index da2ce8354a..f43af4a746 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraSearchHydraMappingItem.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraSearchHydraMappingItem.php @@ -9,7 +9,7 @@ class BooksGetResponse200HydraSearchHydraMappingItem * * @var string */ - protected $@type; + protected $type; /** * * @@ -33,20 +33,20 @@ class BooksGetResponse200HydraSearchHydraMappingItem * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraView.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraView.php index fa9c958caf..d43790966a 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraView.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksGetResponse200HydraView.php @@ -9,50 +9,50 @@ class BooksGetResponse200HydraView * * @var string */ - protected $@id; + protected $id; /** * * * @var string */ - protected $@type; + protected $type; /** * * * @var string */ - protected $hydra:first; + protected $hydraFirst; /** * * * @var string */ - protected $hydra:last; + protected $hydraLast; /** * * * @var string */ - protected $hydra:next; + protected $hydraNext; /** * * * @return string */ - public function get@id() : string + public function getId() : string { - return $this->@id; + return $this->id; } /** * * - * @param string $@id + * @param string $id * * @return self */ - public function set@id(string $@id) : self + public function setId(string $id) : self { - $this->@id = $@id; + $this->id = $id; return $this; } /** @@ -60,20 +60,20 @@ public function set@id(string $@id) : self * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** @@ -81,20 +81,20 @@ public function set@type(string $@type) : self * * @return string */ - public function getHydra:first() : string + public function getHydraFirst() : string { - return $this->hydra:first; + return $this->hydraFirst; } /** * * - * @param string $hydra:first + * @param string $hydraFirst * * @return self */ - public function setHydra:first(string $hydra:first) : self + public function setHydraFirst(string $hydraFirst) : self { - $this->hydra:first = $hydra:first; + $this->hydraFirst = $hydraFirst; return $this; } /** @@ -102,20 +102,20 @@ public function setHydra:first(string $hydra:first) : self * * @return string */ - public function getHydra:last() : string + public function getHydraLast() : string { - return $this->hydra:last; + return $this->hydraLast; } /** * * - * @param string $hydra:last + * @param string $hydraLast * * @return self */ - public function setHydra:last(string $hydra:last) : self + public function setHydraLast(string $hydraLast) : self { - $this->hydra:last = $hydra:last; + $this->hydraLast = $hydraLast; return $this; } /** @@ -123,20 +123,20 @@ public function setHydra:last(string $hydra:last) : self * * @return string */ - public function getHydra:next() : string + public function getHydraNext() : string { - return $this->hydra:next; + return $this->hydraNext; } /** * * - * @param string $hydra:next + * @param string $hydraNext * * @return self */ - public function setHydra:next(string $hydra:next) : self + public function setHydraNext(string $hydraNext) : self { - $this->hydra:next = $hydra:next; + $this->hydraNext = $hydraNext; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200.php index 3ac2a79443..95ccccd52b 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200.php @@ -9,44 +9,44 @@ class BooksIdReviewsGetResponse200 * * @var object[] */ - protected $hydra:member; + protected $hydraMember; /** * * * @var int */ - protected $hydra:totalItems; + protected $hydraTotalItems; /** * * * @var BooksIdReviewsGetResponse200HydraView */ - protected $hydra:view; + protected $hydraView; /** * * * @var BooksIdReviewsGetResponse200HydraSearch */ - protected $hydra:search; + protected $hydraSearch; /** * * * @return object[] */ - public function getHydra:member() : array + public function getHydraMember() : array { - return $this->hydra:member; + return $this->hydraMember; } /** * * - * @param object[] $hydra:member + * @param object[] $hydraMember * * @return self */ - public function setHydra:member(array $hydra:member) : self + public function setHydraMember(array $hydraMember) : self { - $this->hydra:member = $hydra:member; + $this->hydraMember = $hydraMember; return $this; } /** @@ -54,20 +54,20 @@ public function setHydra:member(array $hydra:member) : self * * @return int */ - public function getHydra:totalItems() : int + public function getHydraTotalItems() : int { - return $this->hydra:totalItems; + return $this->hydraTotalItems; } /** * * - * @param int $hydra:totalItems + * @param int $hydraTotalItems * * @return self */ - public function setHydra:totalItems(int $hydra:totalItems) : self + public function setHydraTotalItems(int $hydraTotalItems) : self { - $this->hydra:totalItems = $hydra:totalItems; + $this->hydraTotalItems = $hydraTotalItems; return $this; } /** @@ -75,20 +75,20 @@ public function setHydra:totalItems(int $hydra:totalItems) : self * * @return BooksIdReviewsGetResponse200HydraView */ - public function getHydra:view() : BooksIdReviewsGetResponse200HydraView + public function getHydraView() : BooksIdReviewsGetResponse200HydraView { - return $this->hydra:view; + return $this->hydraView; } /** * * - * @param BooksIdReviewsGetResponse200HydraView $hydra:view + * @param BooksIdReviewsGetResponse200HydraView $hydraView * * @return self */ - public function setHydra:view(BooksIdReviewsGetResponse200HydraView $hydra:view) : self + public function setHydraView(BooksIdReviewsGetResponse200HydraView $hydraView) : self { - $this->hydra:view = $hydra:view; + $this->hydraView = $hydraView; return $this; } /** @@ -96,20 +96,20 @@ public function setHydra:view(BooksIdReviewsGetResponse200HydraView $hydra:view) * * @return BooksIdReviewsGetResponse200HydraSearch */ - public function getHydra:search() : BooksIdReviewsGetResponse200HydraSearch + public function getHydraSearch() : BooksIdReviewsGetResponse200HydraSearch { - return $this->hydra:search; + return $this->hydraSearch; } /** * * - * @param BooksIdReviewsGetResponse200HydraSearch $hydra:search + * @param BooksIdReviewsGetResponse200HydraSearch $hydraSearch * * @return self */ - public function setHydra:search(BooksIdReviewsGetResponse200HydraSearch $hydra:search) : self + public function setHydraSearch(BooksIdReviewsGetResponse200HydraSearch $hydraSearch) : self { - $this->hydra:search = $hydra:search; + $this->hydraSearch = $hydraSearch; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraSearch.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraSearch.php index 0745740220..36537950dd 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraSearch.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraSearch.php @@ -9,44 +9,44 @@ class BooksIdReviewsGetResponse200HydraSearch * * @var string */ - protected $@type; + protected $type; /** * * * @var string */ - protected $hydra:template; + protected $hydraTemplate; /** * * * @var string */ - protected $hydra:variableRepresentation; + protected $hydraVariableRepresentation; /** * * * @var BooksIdReviewsGetResponse200HydraSearchHydraMappingItem[] */ - protected $hydra:mapping; + protected $hydraMapping; /** * * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** @@ -54,20 +54,20 @@ public function set@type(string $@type) : self * * @return string */ - public function getHydra:template() : string + public function getHydraTemplate() : string { - return $this->hydra:template; + return $this->hydraTemplate; } /** * * - * @param string $hydra:template + * @param string $hydraTemplate * * @return self */ - public function setHydra:template(string $hydra:template) : self + public function setHydraTemplate(string $hydraTemplate) : self { - $this->hydra:template = $hydra:template; + $this->hydraTemplate = $hydraTemplate; return $this; } /** @@ -75,20 +75,20 @@ public function setHydra:template(string $hydra:template) : self * * @return string */ - public function getHydra:variableRepresentation() : string + public function getHydraVariableRepresentation() : string { - return $this->hydra:variableRepresentation; + return $this->hydraVariableRepresentation; } /** * * - * @param string $hydra:variableRepresentation + * @param string $hydraVariableRepresentation * * @return self */ - public function setHydra:variableRepresentation(string $hydra:variableRepresentation) : self + public function setHydraVariableRepresentation(string $hydraVariableRepresentation) : self { - $this->hydra:variableRepresentation = $hydra:variableRepresentation; + $this->hydraVariableRepresentation = $hydraVariableRepresentation; return $this; } /** @@ -96,20 +96,20 @@ public function setHydra:variableRepresentation(string $hydra:variableRepresenta * * @return BooksIdReviewsGetResponse200HydraSearchHydraMappingItem[] */ - public function getHydra:mapping() : array + public function getHydraMapping() : array { - return $this->hydra:mapping; + return $this->hydraMapping; } /** * * - * @param BooksIdReviewsGetResponse200HydraSearchHydraMappingItem[] $hydra:mapping + * @param BooksIdReviewsGetResponse200HydraSearchHydraMappingItem[] $hydraMapping * * @return self */ - public function setHydra:mapping(array $hydra:mapping) : self + public function setHydraMapping(array $hydraMapping) : self { - $this->hydra:mapping = $hydra:mapping; + $this->hydraMapping = $hydraMapping; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraSearchHydraMappingItem.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraSearchHydraMappingItem.php index bb705b7f10..57a4bf13ae 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraSearchHydraMappingItem.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraSearchHydraMappingItem.php @@ -9,7 +9,7 @@ class BooksIdReviewsGetResponse200HydraSearchHydraMappingItem * * @var string */ - protected $@type; + protected $type; /** * * @@ -33,20 +33,20 @@ class BooksIdReviewsGetResponse200HydraSearchHydraMappingItem * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraView.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraView.php index 5c216b3d9d..83d7414568 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraView.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/BooksIdReviewsGetResponse200HydraView.php @@ -9,50 +9,50 @@ class BooksIdReviewsGetResponse200HydraView * * @var string */ - protected $@id; + protected $id; /** * * * @var string */ - protected $@type; + protected $type; /** * * * @var string */ - protected $hydra:first; + protected $hydraFirst; /** * * * @var string */ - protected $hydra:last; + protected $hydraLast; /** * * * @var string */ - protected $hydra:next; + protected $hydraNext; /** * * * @return string */ - public function get@id() : string + public function getId() : string { - return $this->@id; + return $this->id; } /** * * - * @param string $@id + * @param string $id * * @return self */ - public function set@id(string $@id) : self + public function setId(string $id) : self { - $this->@id = $@id; + $this->id = $id; return $this; } /** @@ -60,20 +60,20 @@ public function set@id(string $@id) : self * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** @@ -81,20 +81,20 @@ public function set@type(string $@type) : self * * @return string */ - public function getHydra:first() : string + public function getHydraFirst() : string { - return $this->hydra:first; + return $this->hydraFirst; } /** * * - * @param string $hydra:first + * @param string $hydraFirst * * @return self */ - public function setHydra:first(string $hydra:first) : self + public function setHydraFirst(string $hydraFirst) : self { - $this->hydra:first = $hydra:first; + $this->hydraFirst = $hydraFirst; return $this; } /** @@ -102,20 +102,20 @@ public function setHydra:first(string $hydra:first) : self * * @return string */ - public function getHydra:last() : string + public function getHydraLast() : string { - return $this->hydra:last; + return $this->hydraLast; } /** * * - * @param string $hydra:last + * @param string $hydraLast * * @return self */ - public function setHydra:last(string $hydra:last) : self + public function setHydraLast(string $hydraLast) : self { - $this->hydra:last = $hydra:last; + $this->hydraLast = $hydraLast; return $this; } /** @@ -123,20 +123,20 @@ public function setHydra:last(string $hydra:last) : self * * @return string */ - public function getHydra:next() : string + public function getHydraNext() : string { - return $this->hydra:next; + return $this->hydraNext; } /** * * - * @param string $hydra:next + * @param string $hydraNext * * @return self */ - public function setHydra:next(string $hydra:next) : self + public function setHydraNext(string $hydraNext) : self { - $this->hydra:next = $hydra:next; + $this->hydraNext = $hydraNext; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200.php index 60a73c2bac..818159a996 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200.php @@ -9,44 +9,44 @@ class ParchmentsGetResponse200 * * @var object[] */ - protected $hydra:member; + protected $hydraMember; /** * * * @var int */ - protected $hydra:totalItems; + protected $hydraTotalItems; /** * * * @var ParchmentsGetResponse200HydraView */ - protected $hydra:view; + protected $hydraView; /** * * * @var ParchmentsGetResponse200HydraSearch */ - protected $hydra:search; + protected $hydraSearch; /** * * * @return object[] */ - public function getHydra:member() : array + public function getHydraMember() : array { - return $this->hydra:member; + return $this->hydraMember; } /** * * - * @param object[] $hydra:member + * @param object[] $hydraMember * * @return self */ - public function setHydra:member(array $hydra:member) : self + public function setHydraMember(array $hydraMember) : self { - $this->hydra:member = $hydra:member; + $this->hydraMember = $hydraMember; return $this; } /** @@ -54,20 +54,20 @@ public function setHydra:member(array $hydra:member) : self * * @return int */ - public function getHydra:totalItems() : int + public function getHydraTotalItems() : int { - return $this->hydra:totalItems; + return $this->hydraTotalItems; } /** * * - * @param int $hydra:totalItems + * @param int $hydraTotalItems * * @return self */ - public function setHydra:totalItems(int $hydra:totalItems) : self + public function setHydraTotalItems(int $hydraTotalItems) : self { - $this->hydra:totalItems = $hydra:totalItems; + $this->hydraTotalItems = $hydraTotalItems; return $this; } /** @@ -75,20 +75,20 @@ public function setHydra:totalItems(int $hydra:totalItems) : self * * @return ParchmentsGetResponse200HydraView */ - public function getHydra:view() : ParchmentsGetResponse200HydraView + public function getHydraView() : ParchmentsGetResponse200HydraView { - return $this->hydra:view; + return $this->hydraView; } /** * * - * @param ParchmentsGetResponse200HydraView $hydra:view + * @param ParchmentsGetResponse200HydraView $hydraView * * @return self */ - public function setHydra:view(ParchmentsGetResponse200HydraView $hydra:view) : self + public function setHydraView(ParchmentsGetResponse200HydraView $hydraView) : self { - $this->hydra:view = $hydra:view; + $this->hydraView = $hydraView; return $this; } /** @@ -96,20 +96,20 @@ public function setHydra:view(ParchmentsGetResponse200HydraView $hydra:view) : s * * @return ParchmentsGetResponse200HydraSearch */ - public function getHydra:search() : ParchmentsGetResponse200HydraSearch + public function getHydraSearch() : ParchmentsGetResponse200HydraSearch { - return $this->hydra:search; + return $this->hydraSearch; } /** * * - * @param ParchmentsGetResponse200HydraSearch $hydra:search + * @param ParchmentsGetResponse200HydraSearch $hydraSearch * * @return self */ - public function setHydra:search(ParchmentsGetResponse200HydraSearch $hydra:search) : self + public function setHydraSearch(ParchmentsGetResponse200HydraSearch $hydraSearch) : self { - $this->hydra:search = $hydra:search; + $this->hydraSearch = $hydraSearch; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraSearch.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraSearch.php index a12fc64261..5d5be5be0a 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraSearch.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraSearch.php @@ -9,44 +9,44 @@ class ParchmentsGetResponse200HydraSearch * * @var string */ - protected $@type; + protected $type; /** * * * @var string */ - protected $hydra:template; + protected $hydraTemplate; /** * * * @var string */ - protected $hydra:variableRepresentation; + protected $hydraVariableRepresentation; /** * * * @var ParchmentsGetResponse200HydraSearchHydraMappingItem[] */ - protected $hydra:mapping; + protected $hydraMapping; /** * * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** @@ -54,20 +54,20 @@ public function set@type(string $@type) : self * * @return string */ - public function getHydra:template() : string + public function getHydraTemplate() : string { - return $this->hydra:template; + return $this->hydraTemplate; } /** * * - * @param string $hydra:template + * @param string $hydraTemplate * * @return self */ - public function setHydra:template(string $hydra:template) : self + public function setHydraTemplate(string $hydraTemplate) : self { - $this->hydra:template = $hydra:template; + $this->hydraTemplate = $hydraTemplate; return $this; } /** @@ -75,20 +75,20 @@ public function setHydra:template(string $hydra:template) : self * * @return string */ - public function getHydra:variableRepresentation() : string + public function getHydraVariableRepresentation() : string { - return $this->hydra:variableRepresentation; + return $this->hydraVariableRepresentation; } /** * * - * @param string $hydra:variableRepresentation + * @param string $hydraVariableRepresentation * * @return self */ - public function setHydra:variableRepresentation(string $hydra:variableRepresentation) : self + public function setHydraVariableRepresentation(string $hydraVariableRepresentation) : self { - $this->hydra:variableRepresentation = $hydra:variableRepresentation; + $this->hydraVariableRepresentation = $hydraVariableRepresentation; return $this; } /** @@ -96,20 +96,20 @@ public function setHydra:variableRepresentation(string $hydra:variableRepresenta * * @return ParchmentsGetResponse200HydraSearchHydraMappingItem[] */ - public function getHydra:mapping() : array + public function getHydraMapping() : array { - return $this->hydra:mapping; + return $this->hydraMapping; } /** * * - * @param ParchmentsGetResponse200HydraSearchHydraMappingItem[] $hydra:mapping + * @param ParchmentsGetResponse200HydraSearchHydraMappingItem[] $hydraMapping * * @return self */ - public function setHydra:mapping(array $hydra:mapping) : self + public function setHydraMapping(array $hydraMapping) : self { - $this->hydra:mapping = $hydra:mapping; + $this->hydraMapping = $hydraMapping; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraSearchHydraMappingItem.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraSearchHydraMappingItem.php index 888cf803b2..88e8fdede5 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraSearchHydraMappingItem.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraSearchHydraMappingItem.php @@ -9,7 +9,7 @@ class ParchmentsGetResponse200HydraSearchHydraMappingItem * * @var string */ - protected $@type; + protected $type; /** * * @@ -33,20 +33,20 @@ class ParchmentsGetResponse200HydraSearchHydraMappingItem * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraView.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraView.php index 053302c4f9..230139c177 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraView.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ParchmentsGetResponse200HydraView.php @@ -9,50 +9,50 @@ class ParchmentsGetResponse200HydraView * * @var string */ - protected $@id; + protected $id; /** * * * @var string */ - protected $@type; + protected $type; /** * * * @var string */ - protected $hydra:first; + protected $hydraFirst; /** * * * @var string */ - protected $hydra:last; + protected $hydraLast; /** * * * @var string */ - protected $hydra:next; + protected $hydraNext; /** * * * @return string */ - public function get@id() : string + public function getId() : string { - return $this->@id; + return $this->id; } /** * * - * @param string $@id + * @param string $id * * @return self */ - public function set@id(string $@id) : self + public function setId(string $id) : self { - $this->@id = $@id; + $this->id = $id; return $this; } /** @@ -60,20 +60,20 @@ public function set@id(string $@id) : self * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** @@ -81,20 +81,20 @@ public function set@type(string $@type) : self * * @return string */ - public function getHydra:first() : string + public function getHydraFirst() : string { - return $this->hydra:first; + return $this->hydraFirst; } /** * * - * @param string $hydra:first + * @param string $hydraFirst * * @return self */ - public function setHydra:first(string $hydra:first) : self + public function setHydraFirst(string $hydraFirst) : self { - $this->hydra:first = $hydra:first; + $this->hydraFirst = $hydraFirst; return $this; } /** @@ -102,20 +102,20 @@ public function setHydra:first(string $hydra:first) : self * * @return string */ - public function getHydra:last() : string + public function getHydraLast() : string { - return $this->hydra:last; + return $this->hydraLast; } /** * * - * @param string $hydra:last + * @param string $hydraLast * * @return self */ - public function setHydra:last(string $hydra:last) : self + public function setHydraLast(string $hydraLast) : self { - $this->hydra:last = $hydra:last; + $this->hydraLast = $hydraLast; return $this; } /** @@ -123,20 +123,20 @@ public function setHydra:last(string $hydra:last) : self * * @return string */ - public function getHydra:next() : string + public function getHydraNext() : string { - return $this->hydra:next; + return $this->hydraNext; } /** * * - * @param string $hydra:next + * @param string $hydraNext * * @return self */ - public function setHydra:next(string $hydra:next) : self + public function setHydraNext(string $hydraNext) : self { - $this->hydra:next = $hydra:next; + $this->hydraNext = $hydraNext; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200.php index efaa7ff38b..9d1f1caf17 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200.php @@ -9,44 +9,44 @@ class ReviewsGetResponse200 * * @var object[] */ - protected $hydra:member; + protected $hydraMember; /** * * * @var int */ - protected $hydra:totalItems; + protected $hydraTotalItems; /** * * * @var ReviewsGetResponse200HydraView */ - protected $hydra:view; + protected $hydraView; /** * * * @var ReviewsGetResponse200HydraSearch */ - protected $hydra:search; + protected $hydraSearch; /** * * * @return object[] */ - public function getHydra:member() : array + public function getHydraMember() : array { - return $this->hydra:member; + return $this->hydraMember; } /** * * - * @param object[] $hydra:member + * @param object[] $hydraMember * * @return self */ - public function setHydra:member(array $hydra:member) : self + public function setHydraMember(array $hydraMember) : self { - $this->hydra:member = $hydra:member; + $this->hydraMember = $hydraMember; return $this; } /** @@ -54,20 +54,20 @@ public function setHydra:member(array $hydra:member) : self * * @return int */ - public function getHydra:totalItems() : int + public function getHydraTotalItems() : int { - return $this->hydra:totalItems; + return $this->hydraTotalItems; } /** * * - * @param int $hydra:totalItems + * @param int $hydraTotalItems * * @return self */ - public function setHydra:totalItems(int $hydra:totalItems) : self + public function setHydraTotalItems(int $hydraTotalItems) : self { - $this->hydra:totalItems = $hydra:totalItems; + $this->hydraTotalItems = $hydraTotalItems; return $this; } /** @@ -75,20 +75,20 @@ public function setHydra:totalItems(int $hydra:totalItems) : self * * @return ReviewsGetResponse200HydraView */ - public function getHydra:view() : ReviewsGetResponse200HydraView + public function getHydraView() : ReviewsGetResponse200HydraView { - return $this->hydra:view; + return $this->hydraView; } /** * * - * @param ReviewsGetResponse200HydraView $hydra:view + * @param ReviewsGetResponse200HydraView $hydraView * * @return self */ - public function setHydra:view(ReviewsGetResponse200HydraView $hydra:view) : self + public function setHydraView(ReviewsGetResponse200HydraView $hydraView) : self { - $this->hydra:view = $hydra:view; + $this->hydraView = $hydraView; return $this; } /** @@ -96,20 +96,20 @@ public function setHydra:view(ReviewsGetResponse200HydraView $hydra:view) : self * * @return ReviewsGetResponse200HydraSearch */ - public function getHydra:search() : ReviewsGetResponse200HydraSearch + public function getHydraSearch() : ReviewsGetResponse200HydraSearch { - return $this->hydra:search; + return $this->hydraSearch; } /** * * - * @param ReviewsGetResponse200HydraSearch $hydra:search + * @param ReviewsGetResponse200HydraSearch $hydraSearch * * @return self */ - public function setHydra:search(ReviewsGetResponse200HydraSearch $hydra:search) : self + public function setHydraSearch(ReviewsGetResponse200HydraSearch $hydraSearch) : self { - $this->hydra:search = $hydra:search; + $this->hydraSearch = $hydraSearch; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraSearch.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraSearch.php index 7d37dfb6af..83b76ddf0a 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraSearch.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraSearch.php @@ -9,44 +9,44 @@ class ReviewsGetResponse200HydraSearch * * @var string */ - protected $@type; + protected $type; /** * * * @var string */ - protected $hydra:template; + protected $hydraTemplate; /** * * * @var string */ - protected $hydra:variableRepresentation; + protected $hydraVariableRepresentation; /** * * * @var ReviewsGetResponse200HydraSearchHydraMappingItem[] */ - protected $hydra:mapping; + protected $hydraMapping; /** * * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** @@ -54,20 +54,20 @@ public function set@type(string $@type) : self * * @return string */ - public function getHydra:template() : string + public function getHydraTemplate() : string { - return $this->hydra:template; + return $this->hydraTemplate; } /** * * - * @param string $hydra:template + * @param string $hydraTemplate * * @return self */ - public function setHydra:template(string $hydra:template) : self + public function setHydraTemplate(string $hydraTemplate) : self { - $this->hydra:template = $hydra:template; + $this->hydraTemplate = $hydraTemplate; return $this; } /** @@ -75,20 +75,20 @@ public function setHydra:template(string $hydra:template) : self * * @return string */ - public function getHydra:variableRepresentation() : string + public function getHydraVariableRepresentation() : string { - return $this->hydra:variableRepresentation; + return $this->hydraVariableRepresentation; } /** * * - * @param string $hydra:variableRepresentation + * @param string $hydraVariableRepresentation * * @return self */ - public function setHydra:variableRepresentation(string $hydra:variableRepresentation) : self + public function setHydraVariableRepresentation(string $hydraVariableRepresentation) : self { - $this->hydra:variableRepresentation = $hydra:variableRepresentation; + $this->hydraVariableRepresentation = $hydraVariableRepresentation; return $this; } /** @@ -96,20 +96,20 @@ public function setHydra:variableRepresentation(string $hydra:variableRepresenta * * @return ReviewsGetResponse200HydraSearchHydraMappingItem[] */ - public function getHydra:mapping() : array + public function getHydraMapping() : array { - return $this->hydra:mapping; + return $this->hydraMapping; } /** * * - * @param ReviewsGetResponse200HydraSearchHydraMappingItem[] $hydra:mapping + * @param ReviewsGetResponse200HydraSearchHydraMappingItem[] $hydraMapping * * @return self */ - public function setHydra:mapping(array $hydra:mapping) : self + public function setHydraMapping(array $hydraMapping) : self { - $this->hydra:mapping = $hydra:mapping; + $this->hydraMapping = $hydraMapping; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraSearchHydraMappingItem.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraSearchHydraMappingItem.php index b148594459..6c7ec2ee23 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraSearchHydraMappingItem.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraSearchHydraMappingItem.php @@ -9,7 +9,7 @@ class ReviewsGetResponse200HydraSearchHydraMappingItem * * @var string */ - protected $@type; + protected $type; /** * * @@ -33,20 +33,20 @@ class ReviewsGetResponse200HydraSearchHydraMappingItem * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraView.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraView.php index 1d77cd2074..dfae0a5150 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraView.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Model/ReviewsGetResponse200HydraView.php @@ -9,50 +9,50 @@ class ReviewsGetResponse200HydraView * * @var string */ - protected $@id; + protected $id; /** * * * @var string */ - protected $@type; + protected $type; /** * * * @var string */ - protected $hydra:first; + protected $hydraFirst; /** * * * @var string */ - protected $hydra:last; + protected $hydraLast; /** * * * @var string */ - protected $hydra:next; + protected $hydraNext; /** * * * @return string */ - public function get@id() : string + public function getId() : string { - return $this->@id; + return $this->id; } /** * * - * @param string $@id + * @param string $id * * @return self */ - public function set@id(string $@id) : self + public function setId(string $id) : self { - $this->@id = $@id; + $this->id = $id; return $this; } /** @@ -60,20 +60,20 @@ public function set@id(string $@id) : self * * @return string */ - public function get@type() : string + public function getType() : string { - return $this->@type; + return $this->type; } /** * * - * @param string $@type + * @param string $type * * @return self */ - public function set@type(string $@type) : self + public function setType(string $type) : self { - $this->@type = $@type; + $this->type = $type; return $this; } /** @@ -81,20 +81,20 @@ public function set@type(string $@type) : self * * @return string */ - public function getHydra:first() : string + public function getHydraFirst() : string { - return $this->hydra:first; + return $this->hydraFirst; } /** * * - * @param string $hydra:first + * @param string $hydraFirst * * @return self */ - public function setHydra:first(string $hydra:first) : self + public function setHydraFirst(string $hydraFirst) : self { - $this->hydra:first = $hydra:first; + $this->hydraFirst = $hydraFirst; return $this; } /** @@ -102,20 +102,20 @@ public function setHydra:first(string $hydra:first) : self * * @return string */ - public function getHydra:last() : string + public function getHydraLast() : string { - return $this->hydra:last; + return $this->hydraLast; } /** * * - * @param string $hydra:last + * @param string $hydraLast * * @return self */ - public function setHydra:last(string $hydra:last) : self + public function setHydraLast(string $hydraLast) : self { - $this->hydra:last = $hydra:last; + $this->hydraLast = $hydraLast; return $this; } /** @@ -123,20 +123,20 @@ public function setHydra:last(string $hydra:last) : self * * @return string */ - public function getHydra:next() : string + public function getHydraNext() : string { - return $this->hydra:next; + return $this->hydraNext; } /** * * - * @param string $hydra:next + * @param string $hydraNext * * @return self */ - public function setHydra:next(string $hydra:next) : self + public function setHydraNext(string $hydraNext) : self { - $this->hydra:next = $hydra:next; + $this->hydraNext = $hydraNext; return $this; } } \ No newline at end of file diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraSearchHydraMappingItemNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraSearchHydraMappingItemNormalizer.php index aaffad190a..a7c723e721 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraSearchHydraMappingItemNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraSearchHydraMappingItemNormalizer.php @@ -29,7 +29,7 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\BooksGetResponse200HydraSearchHydraMappingItem(); if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'variable')) { $object->setVariable($data->{'variable'}); @@ -45,8 +45,8 @@ public function denormalize($data, $class, $format = null, array $context = arra public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } if (null !== $object->getVariable()) { $data->{'variable'} = $object->getVariable(); diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraSearchNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraSearchNormalizer.php index c66c50dd2d..bac8f6b6a3 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraSearchNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraSearchNormalizer.php @@ -29,38 +29,38 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\BooksGetResponse200HydraSearch(); if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'hydra:template')) { - $object->setHydra:template($data->{'hydra:template'}); + $object->setHydraTemplate($data->{'hydra:template'}); } if (property_exists($data, 'hydra:variableRepresentation')) { - $object->setHydra:variableRepresentation($data->{'hydra:variableRepresentation'}); + $object->setHydraVariableRepresentation($data->{'hydra:variableRepresentation'}); } if (property_exists($data, 'hydra:mapping')) { $values = array(); foreach ($data->{'hydra:mapping'} as $value) { $values[] = $this->denormalizer->denormalize($value, 'ApiPlatform\\Demo\\Model\\BooksGetResponse200HydraSearchHydraMappingItem', 'json', $context); } - $object->setHydra:mapping($values); + $object->setHydraMapping($values); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } - if (null !== $object->getHydra:template()) { - $data->{'hydra:template'} = $object->getHydra:template(); + if (null !== $object->getHydraTemplate()) { + $data->{'hydra:template'} = $object->getHydraTemplate(); } - if (null !== $object->getHydra:variableRepresentation()) { - $data->{'hydra:variableRepresentation'} = $object->getHydra:variableRepresentation(); + if (null !== $object->getHydraVariableRepresentation()) { + $data->{'hydra:variableRepresentation'} = $object->getHydraVariableRepresentation(); } - if (null !== $object->getHydra:mapping()) { + if (null !== $object->getHydraMapping()) { $values = array(); - foreach ($object->getHydra:mapping() as $value) { + foreach ($object->getHydraMapping() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data->{'hydra:mapping'} = $values; diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraViewNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraViewNormalizer.php index c05e0ba56d..d031a78621 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraViewNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200HydraViewNormalizer.php @@ -29,39 +29,39 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\BooksGetResponse200HydraView(); if (property_exists($data, '@id')) { - $object->set@id($data->{'@id'}); + $object->setId($data->{'@id'}); } if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'hydra:first')) { - $object->setHydra:first($data->{'hydra:first'}); + $object->setHydraFirst($data->{'hydra:first'}); } if (property_exists($data, 'hydra:last')) { - $object->setHydra:last($data->{'hydra:last'}); + $object->setHydraLast($data->{'hydra:last'}); } if (property_exists($data, 'hydra:next')) { - $object->setHydra:next($data->{'hydra:next'}); + $object->setHydraNext($data->{'hydra:next'}); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@id()) { - $data->{'@id'} = $object->get@id(); + if (null !== $object->getId()) { + $data->{'@id'} = $object->getId(); } - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } - if (null !== $object->getHydra:first()) { - $data->{'hydra:first'} = $object->getHydra:first(); + if (null !== $object->getHydraFirst()) { + $data->{'hydra:first'} = $object->getHydraFirst(); } - if (null !== $object->getHydra:last()) { - $data->{'hydra:last'} = $object->getHydra:last(); + if (null !== $object->getHydraLast()) { + $data->{'hydra:last'} = $object->getHydraLast(); } - if (null !== $object->getHydra:next()) { - $data->{'hydra:next'} = $object->getHydra:next(); + if (null !== $object->getHydraNext()) { + $data->{'hydra:next'} = $object->getHydraNext(); } return $data; } diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200Normalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200Normalizer.php index 113881e416..34632091bf 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200Normalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksGetResponse200Normalizer.php @@ -33,37 +33,37 @@ public function denormalize($data, $class, $format = null, array $context = arra foreach ($data->{'hydra:member'} as $value) { $values[] = $value; } - $object->setHydra:member($values); + $object->setHydraMember($values); } if (property_exists($data, 'hydra:totalItems')) { - $object->setHydra:totalItems($data->{'hydra:totalItems'}); + $object->setHydraTotalItems($data->{'hydra:totalItems'}); } if (property_exists($data, 'hydra:view')) { - $object->setHydra:view($this->denormalizer->denormalize($data->{'hydra:view'}, 'ApiPlatform\\Demo\\Model\\BooksGetResponse200HydraView', 'json', $context)); + $object->setHydraView($this->denormalizer->denormalize($data->{'hydra:view'}, 'ApiPlatform\\Demo\\Model\\BooksGetResponse200HydraView', 'json', $context)); } if (property_exists($data, 'hydra:search')) { - $object->setHydra:search($this->denormalizer->denormalize($data->{'hydra:search'}, 'ApiPlatform\\Demo\\Model\\BooksGetResponse200HydraSearch', 'json', $context)); + $object->setHydraSearch($this->denormalizer->denormalize($data->{'hydra:search'}, 'ApiPlatform\\Demo\\Model\\BooksGetResponse200HydraSearch', 'json', $context)); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->getHydra:member()) { + if (null !== $object->getHydraMember()) { $values = array(); - foreach ($object->getHydra:member() as $value) { + foreach ($object->getHydraMember() as $value) { $values[] = $value; } $data->{'hydra:member'} = $values; } - if (null !== $object->getHydra:totalItems()) { - $data->{'hydra:totalItems'} = $object->getHydra:totalItems(); + if (null !== $object->getHydraTotalItems()) { + $data->{'hydra:totalItems'} = $object->getHydraTotalItems(); } - if (null !== $object->getHydra:view()) { - $data->{'hydra:view'} = $this->normalizer->normalize($object->getHydra:view(), 'json', $context); + if (null !== $object->getHydraView()) { + $data->{'hydra:view'} = $this->normalizer->normalize($object->getHydraView(), 'json', $context); } - if (null !== $object->getHydra:search()) { - $data->{'hydra:search'} = $this->normalizer->normalize($object->getHydra:search(), 'json', $context); + if (null !== $object->getHydraSearch()) { + $data->{'hydra:search'} = $this->normalizer->normalize($object->getHydraSearch(), 'json', $context); } return $data; } diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraSearchHydraMappingItemNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraSearchHydraMappingItemNormalizer.php index ac68315d32..bc01be6ee3 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraSearchHydraMappingItemNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraSearchHydraMappingItemNormalizer.php @@ -29,7 +29,7 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\BooksIdReviewsGetResponse200HydraSearchHydraMappingItem(); if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'variable')) { $object->setVariable($data->{'variable'}); @@ -45,8 +45,8 @@ public function denormalize($data, $class, $format = null, array $context = arra public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } if (null !== $object->getVariable()) { $data->{'variable'} = $object->getVariable(); diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraSearchNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraSearchNormalizer.php index dab4c6d42e..b50b8a5f61 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraSearchNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraSearchNormalizer.php @@ -29,38 +29,38 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\BooksIdReviewsGetResponse200HydraSearch(); if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'hydra:template')) { - $object->setHydra:template($data->{'hydra:template'}); + $object->setHydraTemplate($data->{'hydra:template'}); } if (property_exists($data, 'hydra:variableRepresentation')) { - $object->setHydra:variableRepresentation($data->{'hydra:variableRepresentation'}); + $object->setHydraVariableRepresentation($data->{'hydra:variableRepresentation'}); } if (property_exists($data, 'hydra:mapping')) { $values = array(); foreach ($data->{'hydra:mapping'} as $value) { $values[] = $this->denormalizer->denormalize($value, 'ApiPlatform\\Demo\\Model\\BooksIdReviewsGetResponse200HydraSearchHydraMappingItem', 'json', $context); } - $object->setHydra:mapping($values); + $object->setHydraMapping($values); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } - if (null !== $object->getHydra:template()) { - $data->{'hydra:template'} = $object->getHydra:template(); + if (null !== $object->getHydraTemplate()) { + $data->{'hydra:template'} = $object->getHydraTemplate(); } - if (null !== $object->getHydra:variableRepresentation()) { - $data->{'hydra:variableRepresentation'} = $object->getHydra:variableRepresentation(); + if (null !== $object->getHydraVariableRepresentation()) { + $data->{'hydra:variableRepresentation'} = $object->getHydraVariableRepresentation(); } - if (null !== $object->getHydra:mapping()) { + if (null !== $object->getHydraMapping()) { $values = array(); - foreach ($object->getHydra:mapping() as $value) { + foreach ($object->getHydraMapping() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data->{'hydra:mapping'} = $values; diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraViewNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraViewNormalizer.php index f3f74448b8..7d1deb6a33 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraViewNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200HydraViewNormalizer.php @@ -29,39 +29,39 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\BooksIdReviewsGetResponse200HydraView(); if (property_exists($data, '@id')) { - $object->set@id($data->{'@id'}); + $object->setId($data->{'@id'}); } if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'hydra:first')) { - $object->setHydra:first($data->{'hydra:first'}); + $object->setHydraFirst($data->{'hydra:first'}); } if (property_exists($data, 'hydra:last')) { - $object->setHydra:last($data->{'hydra:last'}); + $object->setHydraLast($data->{'hydra:last'}); } if (property_exists($data, 'hydra:next')) { - $object->setHydra:next($data->{'hydra:next'}); + $object->setHydraNext($data->{'hydra:next'}); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@id()) { - $data->{'@id'} = $object->get@id(); + if (null !== $object->getId()) { + $data->{'@id'} = $object->getId(); } - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } - if (null !== $object->getHydra:first()) { - $data->{'hydra:first'} = $object->getHydra:first(); + if (null !== $object->getHydraFirst()) { + $data->{'hydra:first'} = $object->getHydraFirst(); } - if (null !== $object->getHydra:last()) { - $data->{'hydra:last'} = $object->getHydra:last(); + if (null !== $object->getHydraLast()) { + $data->{'hydra:last'} = $object->getHydraLast(); } - if (null !== $object->getHydra:next()) { - $data->{'hydra:next'} = $object->getHydra:next(); + if (null !== $object->getHydraNext()) { + $data->{'hydra:next'} = $object->getHydraNext(); } return $data; } diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200Normalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200Normalizer.php index 89aaf01422..ab407e04ff 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200Normalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/BooksIdReviewsGetResponse200Normalizer.php @@ -33,37 +33,37 @@ public function denormalize($data, $class, $format = null, array $context = arra foreach ($data->{'hydra:member'} as $value) { $values[] = $value; } - $object->setHydra:member($values); + $object->setHydraMember($values); } if (property_exists($data, 'hydra:totalItems')) { - $object->setHydra:totalItems($data->{'hydra:totalItems'}); + $object->setHydraTotalItems($data->{'hydra:totalItems'}); } if (property_exists($data, 'hydra:view')) { - $object->setHydra:view($this->denormalizer->denormalize($data->{'hydra:view'}, 'ApiPlatform\\Demo\\Model\\BooksIdReviewsGetResponse200HydraView', 'json', $context)); + $object->setHydraView($this->denormalizer->denormalize($data->{'hydra:view'}, 'ApiPlatform\\Demo\\Model\\BooksIdReviewsGetResponse200HydraView', 'json', $context)); } if (property_exists($data, 'hydra:search')) { - $object->setHydra:search($this->denormalizer->denormalize($data->{'hydra:search'}, 'ApiPlatform\\Demo\\Model\\BooksIdReviewsGetResponse200HydraSearch', 'json', $context)); + $object->setHydraSearch($this->denormalizer->denormalize($data->{'hydra:search'}, 'ApiPlatform\\Demo\\Model\\BooksIdReviewsGetResponse200HydraSearch', 'json', $context)); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->getHydra:member()) { + if (null !== $object->getHydraMember()) { $values = array(); - foreach ($object->getHydra:member() as $value) { + foreach ($object->getHydraMember() as $value) { $values[] = $value; } $data->{'hydra:member'} = $values; } - if (null !== $object->getHydra:totalItems()) { - $data->{'hydra:totalItems'} = $object->getHydra:totalItems(); + if (null !== $object->getHydraTotalItems()) { + $data->{'hydra:totalItems'} = $object->getHydraTotalItems(); } - if (null !== $object->getHydra:view()) { - $data->{'hydra:view'} = $this->normalizer->normalize($object->getHydra:view(), 'json', $context); + if (null !== $object->getHydraView()) { + $data->{'hydra:view'} = $this->normalizer->normalize($object->getHydraView(), 'json', $context); } - if (null !== $object->getHydra:search()) { - $data->{'hydra:search'} = $this->normalizer->normalize($object->getHydra:search(), 'json', $context); + if (null !== $object->getHydraSearch()) { + $data->{'hydra:search'} = $this->normalizer->normalize($object->getHydraSearch(), 'json', $context); } return $data; } diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraSearchHydraMappingItemNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraSearchHydraMappingItemNormalizer.php index 23df3f3801..50fd759b14 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraSearchHydraMappingItemNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraSearchHydraMappingItemNormalizer.php @@ -29,7 +29,7 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\ParchmentsGetResponse200HydraSearchHydraMappingItem(); if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'variable')) { $object->setVariable($data->{'variable'}); @@ -45,8 +45,8 @@ public function denormalize($data, $class, $format = null, array $context = arra public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } if (null !== $object->getVariable()) { $data->{'variable'} = $object->getVariable(); diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraSearchNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraSearchNormalizer.php index 1c5e3577da..48e8662e66 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraSearchNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraSearchNormalizer.php @@ -29,38 +29,38 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\ParchmentsGetResponse200HydraSearch(); if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'hydra:template')) { - $object->setHydra:template($data->{'hydra:template'}); + $object->setHydraTemplate($data->{'hydra:template'}); } if (property_exists($data, 'hydra:variableRepresentation')) { - $object->setHydra:variableRepresentation($data->{'hydra:variableRepresentation'}); + $object->setHydraVariableRepresentation($data->{'hydra:variableRepresentation'}); } if (property_exists($data, 'hydra:mapping')) { $values = array(); foreach ($data->{'hydra:mapping'} as $value) { $values[] = $this->denormalizer->denormalize($value, 'ApiPlatform\\Demo\\Model\\ParchmentsGetResponse200HydraSearchHydraMappingItem', 'json', $context); } - $object->setHydra:mapping($values); + $object->setHydraMapping($values); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } - if (null !== $object->getHydra:template()) { - $data->{'hydra:template'} = $object->getHydra:template(); + if (null !== $object->getHydraTemplate()) { + $data->{'hydra:template'} = $object->getHydraTemplate(); } - if (null !== $object->getHydra:variableRepresentation()) { - $data->{'hydra:variableRepresentation'} = $object->getHydra:variableRepresentation(); + if (null !== $object->getHydraVariableRepresentation()) { + $data->{'hydra:variableRepresentation'} = $object->getHydraVariableRepresentation(); } - if (null !== $object->getHydra:mapping()) { + if (null !== $object->getHydraMapping()) { $values = array(); - foreach ($object->getHydra:mapping() as $value) { + foreach ($object->getHydraMapping() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data->{'hydra:mapping'} = $values; diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraViewNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraViewNormalizer.php index 3bdf0ad76d..47ca8f55ec 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraViewNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200HydraViewNormalizer.php @@ -29,39 +29,39 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\ParchmentsGetResponse200HydraView(); if (property_exists($data, '@id')) { - $object->set@id($data->{'@id'}); + $object->setId($data->{'@id'}); } if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'hydra:first')) { - $object->setHydra:first($data->{'hydra:first'}); + $object->setHydraFirst($data->{'hydra:first'}); } if (property_exists($data, 'hydra:last')) { - $object->setHydra:last($data->{'hydra:last'}); + $object->setHydraLast($data->{'hydra:last'}); } if (property_exists($data, 'hydra:next')) { - $object->setHydra:next($data->{'hydra:next'}); + $object->setHydraNext($data->{'hydra:next'}); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@id()) { - $data->{'@id'} = $object->get@id(); + if (null !== $object->getId()) { + $data->{'@id'} = $object->getId(); } - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } - if (null !== $object->getHydra:first()) { - $data->{'hydra:first'} = $object->getHydra:first(); + if (null !== $object->getHydraFirst()) { + $data->{'hydra:first'} = $object->getHydraFirst(); } - if (null !== $object->getHydra:last()) { - $data->{'hydra:last'} = $object->getHydra:last(); + if (null !== $object->getHydraLast()) { + $data->{'hydra:last'} = $object->getHydraLast(); } - if (null !== $object->getHydra:next()) { - $data->{'hydra:next'} = $object->getHydra:next(); + if (null !== $object->getHydraNext()) { + $data->{'hydra:next'} = $object->getHydraNext(); } return $data; } diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200Normalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200Normalizer.php index 998c15d3a7..17de58360d 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200Normalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ParchmentsGetResponse200Normalizer.php @@ -33,37 +33,37 @@ public function denormalize($data, $class, $format = null, array $context = arra foreach ($data->{'hydra:member'} as $value) { $values[] = $value; } - $object->setHydra:member($values); + $object->setHydraMember($values); } if (property_exists($data, 'hydra:totalItems')) { - $object->setHydra:totalItems($data->{'hydra:totalItems'}); + $object->setHydraTotalItems($data->{'hydra:totalItems'}); } if (property_exists($data, 'hydra:view')) { - $object->setHydra:view($this->denormalizer->denormalize($data->{'hydra:view'}, 'ApiPlatform\\Demo\\Model\\ParchmentsGetResponse200HydraView', 'json', $context)); + $object->setHydraView($this->denormalizer->denormalize($data->{'hydra:view'}, 'ApiPlatform\\Demo\\Model\\ParchmentsGetResponse200HydraView', 'json', $context)); } if (property_exists($data, 'hydra:search')) { - $object->setHydra:search($this->denormalizer->denormalize($data->{'hydra:search'}, 'ApiPlatform\\Demo\\Model\\ParchmentsGetResponse200HydraSearch', 'json', $context)); + $object->setHydraSearch($this->denormalizer->denormalize($data->{'hydra:search'}, 'ApiPlatform\\Demo\\Model\\ParchmentsGetResponse200HydraSearch', 'json', $context)); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->getHydra:member()) { + if (null !== $object->getHydraMember()) { $values = array(); - foreach ($object->getHydra:member() as $value) { + foreach ($object->getHydraMember() as $value) { $values[] = $value; } $data->{'hydra:member'} = $values; } - if (null !== $object->getHydra:totalItems()) { - $data->{'hydra:totalItems'} = $object->getHydra:totalItems(); + if (null !== $object->getHydraTotalItems()) { + $data->{'hydra:totalItems'} = $object->getHydraTotalItems(); } - if (null !== $object->getHydra:view()) { - $data->{'hydra:view'} = $this->normalizer->normalize($object->getHydra:view(), 'json', $context); + if (null !== $object->getHydraView()) { + $data->{'hydra:view'} = $this->normalizer->normalize($object->getHydraView(), 'json', $context); } - if (null !== $object->getHydra:search()) { - $data->{'hydra:search'} = $this->normalizer->normalize($object->getHydra:search(), 'json', $context); + if (null !== $object->getHydraSearch()) { + $data->{'hydra:search'} = $this->normalizer->normalize($object->getHydraSearch(), 'json', $context); } return $data; } diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraSearchHydraMappingItemNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraSearchHydraMappingItemNormalizer.php index 382f9cec48..97486b6311 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraSearchHydraMappingItemNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraSearchHydraMappingItemNormalizer.php @@ -29,7 +29,7 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\ReviewsGetResponse200HydraSearchHydraMappingItem(); if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'variable')) { $object->setVariable($data->{'variable'}); @@ -45,8 +45,8 @@ public function denormalize($data, $class, $format = null, array $context = arra public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } if (null !== $object->getVariable()) { $data->{'variable'} = $object->getVariable(); diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraSearchNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraSearchNormalizer.php index c7d94db33d..adf7471b25 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraSearchNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraSearchNormalizer.php @@ -29,38 +29,38 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\ReviewsGetResponse200HydraSearch(); if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'hydra:template')) { - $object->setHydra:template($data->{'hydra:template'}); + $object->setHydraTemplate($data->{'hydra:template'}); } if (property_exists($data, 'hydra:variableRepresentation')) { - $object->setHydra:variableRepresentation($data->{'hydra:variableRepresentation'}); + $object->setHydraVariableRepresentation($data->{'hydra:variableRepresentation'}); } if (property_exists($data, 'hydra:mapping')) { $values = array(); foreach ($data->{'hydra:mapping'} as $value) { $values[] = $this->denormalizer->denormalize($value, 'ApiPlatform\\Demo\\Model\\ReviewsGetResponse200HydraSearchHydraMappingItem', 'json', $context); } - $object->setHydra:mapping($values); + $object->setHydraMapping($values); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } - if (null !== $object->getHydra:template()) { - $data->{'hydra:template'} = $object->getHydra:template(); + if (null !== $object->getHydraTemplate()) { + $data->{'hydra:template'} = $object->getHydraTemplate(); } - if (null !== $object->getHydra:variableRepresentation()) { - $data->{'hydra:variableRepresentation'} = $object->getHydra:variableRepresentation(); + if (null !== $object->getHydraVariableRepresentation()) { + $data->{'hydra:variableRepresentation'} = $object->getHydraVariableRepresentation(); } - if (null !== $object->getHydra:mapping()) { + if (null !== $object->getHydraMapping()) { $values = array(); - foreach ($object->getHydra:mapping() as $value) { + foreach ($object->getHydraMapping() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data->{'hydra:mapping'} = $values; diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraViewNormalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraViewNormalizer.php index f22c2016e4..6d1bd79e3a 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraViewNormalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200HydraViewNormalizer.php @@ -29,39 +29,39 @@ public function denormalize($data, $class, $format = null, array $context = arra } $object = new \ApiPlatform\Demo\Model\ReviewsGetResponse200HydraView(); if (property_exists($data, '@id')) { - $object->set@id($data->{'@id'}); + $object->setId($data->{'@id'}); } if (property_exists($data, '@type')) { - $object->set@type($data->{'@type'}); + $object->setType($data->{'@type'}); } if (property_exists($data, 'hydra:first')) { - $object->setHydra:first($data->{'hydra:first'}); + $object->setHydraFirst($data->{'hydra:first'}); } if (property_exists($data, 'hydra:last')) { - $object->setHydra:last($data->{'hydra:last'}); + $object->setHydraLast($data->{'hydra:last'}); } if (property_exists($data, 'hydra:next')) { - $object->setHydra:next($data->{'hydra:next'}); + $object->setHydraNext($data->{'hydra:next'}); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->get@id()) { - $data->{'@id'} = $object->get@id(); + if (null !== $object->getId()) { + $data->{'@id'} = $object->getId(); } - if (null !== $object->get@type()) { - $data->{'@type'} = $object->get@type(); + if (null !== $object->getType()) { + $data->{'@type'} = $object->getType(); } - if (null !== $object->getHydra:first()) { - $data->{'hydra:first'} = $object->getHydra:first(); + if (null !== $object->getHydraFirst()) { + $data->{'hydra:first'} = $object->getHydraFirst(); } - if (null !== $object->getHydra:last()) { - $data->{'hydra:last'} = $object->getHydra:last(); + if (null !== $object->getHydraLast()) { + $data->{'hydra:last'} = $object->getHydraLast(); } - if (null !== $object->getHydra:next()) { - $data->{'hydra:next'} = $object->getHydra:next(); + if (null !== $object->getHydraNext()) { + $data->{'hydra:next'} = $object->getHydraNext(); } return $data; } diff --git a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200Normalizer.php b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200Normalizer.php index c082226012..61920a8a4c 100644 --- a/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200Normalizer.php +++ b/src/OpenApi/Tests/fixtures/api-platform-demo/expected/Normalizer/ReviewsGetResponse200Normalizer.php @@ -33,37 +33,37 @@ public function denormalize($data, $class, $format = null, array $context = arra foreach ($data->{'hydra:member'} as $value) { $values[] = $value; } - $object->setHydra:member($values); + $object->setHydraMember($values); } if (property_exists($data, 'hydra:totalItems')) { - $object->setHydra:totalItems($data->{'hydra:totalItems'}); + $object->setHydraTotalItems($data->{'hydra:totalItems'}); } if (property_exists($data, 'hydra:view')) { - $object->setHydra:view($this->denormalizer->denormalize($data->{'hydra:view'}, 'ApiPlatform\\Demo\\Model\\ReviewsGetResponse200HydraView', 'json', $context)); + $object->setHydraView($this->denormalizer->denormalize($data->{'hydra:view'}, 'ApiPlatform\\Demo\\Model\\ReviewsGetResponse200HydraView', 'json', $context)); } if (property_exists($data, 'hydra:search')) { - $object->setHydra:search($this->denormalizer->denormalize($data->{'hydra:search'}, 'ApiPlatform\\Demo\\Model\\ReviewsGetResponse200HydraSearch', 'json', $context)); + $object->setHydraSearch($this->denormalizer->denormalize($data->{'hydra:search'}, 'ApiPlatform\\Demo\\Model\\ReviewsGetResponse200HydraSearch', 'json', $context)); } return $object; } public function normalize($object, $format = null, array $context = array()) { $data = new \stdClass(); - if (null !== $object->getHydra:member()) { + if (null !== $object->getHydraMember()) { $values = array(); - foreach ($object->getHydra:member() as $value) { + foreach ($object->getHydraMember() as $value) { $values[] = $value; } $data->{'hydra:member'} = $values; } - if (null !== $object->getHydra:totalItems()) { - $data->{'hydra:totalItems'} = $object->getHydra:totalItems(); + if (null !== $object->getHydraTotalItems()) { + $data->{'hydra:totalItems'} = $object->getHydraTotalItems(); } - if (null !== $object->getHydra:view()) { - $data->{'hydra:view'} = $this->normalizer->normalize($object->getHydra:view(), 'json', $context); + if (null !== $object->getHydraView()) { + $data->{'hydra:view'} = $this->normalizer->normalize($object->getHydraView(), 'json', $context); } - if (null !== $object->getHydra:search()) { - $data->{'hydra:search'} = $this->normalizer->normalize($object->getHydra:search(), 'json', $context); + if (null !== $object->getHydraSearch()) { + $data->{'hydra:search'} = $this->normalizer->normalize($object->getHydraSearch(), 'json', $context); } return $data; }