for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Cubiche package.
*
* Copyright (c) Cubiche
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cubiche\Domain\EventSourcing\Tests\Fixtures\ReadModel;
use Cubiche\Core\Cqrs\ReadModelInterface;
use Cubiche\Domain\Model\AggregateRoot;
use Cubiche\Domain\Model\Tests\Fixtures\PostId;
* PublishedPost class.
* @author Ivannis Suárez Jerez <[email protected]>
class PublishedPost extends AggregateRoot implements ReadModelInterface
{
* Post constructor.
* @param PostId $id
* @param string $title
public function __construct(PostId $id, $title)
parent::__construct($id);
$this->title = $title;
title
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
* @return string
public function title()
return $this->title;
public function setTitle($title)
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: