-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serializer] Groups annotation/attribute on class
- Loading branch information
Showing
7 changed files
with
171 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/Symfony/Component/Serializer/Tests/Fixtures/Annotations/GroupClassDummy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Serializer\Tests\Fixtures\Annotations; | ||
|
||
use Symfony\Component\Serializer\Annotation\Groups; | ||
|
||
/** | ||
* @Groups({"a"}) | ||
*/ | ||
class GroupClassDummy | ||
{ | ||
/** | ||
* @Groups({"b"}) | ||
*/ | ||
private $foo; | ||
|
||
/** | ||
* @Groups({"c", "d"}) | ||
*/ | ||
private $bar; | ||
|
||
private $baz; | ||
|
||
public function getFoo() | ||
{ | ||
return $this->foo; | ||
} | ||
|
||
public function setFoo($foo): void | ||
{ | ||
$this->foo = $foo; | ||
} | ||
|
||
public function getBar() | ||
{ | ||
return $this->bar; | ||
} | ||
|
||
public function setBar($bar): void | ||
{ | ||
$this->bar = $bar; | ||
} | ||
|
||
public function getBaz() | ||
{ | ||
return $this->baz; | ||
} | ||
|
||
public function setBaz($baz): void | ||
{ | ||
$this->baz = $baz; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/Symfony/Component/Serializer/Tests/Fixtures/Attributes/GroupClassDummy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Serializer\Tests\Fixtures\Attributes; | ||
|
||
use Symfony\Component\Serializer\Annotation\Groups; | ||
|
||
#[Groups('a')] | ||
class GroupClassDummy | ||
{ | ||
#[Groups('b')] | ||
private $foo; | ||
|
||
#[Groups(['c', 'd'])] | ||
private $bar; | ||
|
||
private $baz; | ||
|
||
public function getFoo() | ||
{ | ||
return $this->foo; | ||
} | ||
|
||
public function setFoo($foo): void | ||
{ | ||
$this->foo = $foo; | ||
} | ||
|
||
public function getBar() | ||
{ | ||
return $this->bar; | ||
} | ||
|
||
public function setBar($bar): void | ||
{ | ||
$this->bar = $bar; | ||
} | ||
|
||
public function getBaz() | ||
{ | ||
return $this->baz; | ||
} | ||
|
||
public function setBaz($baz): void | ||
{ | ||
$this->baz = $baz; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters