for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @MongoDB\EmbeddedDocument
*/
class Package
{
* @MongoDB\Field(type="string")
* @Groups({"package_default"})
protected $version;
* @MongoDB\Field(type="raw")
*
* @var string
protected $data;
public function getVersion(): string
return $this->version;
}
public function setVersion(string $version): self
$this->version = $version;
return $this;
public function getData(): array
if(is_string($this->data)) {
is_string($this->data)
true
return json_decode($this->data, true);
return $this->data;
public function setData(array $data): self
$this->data = json_encode($data);
* @return array
public function getReplace()
if(isset($this->getData()['replace'])) {
return array_keys($this->getData()['replace']);
return [];