It is a Post
, but not the Post
it is looking for.
You seem to be confused by the namespaces. On one occation, Post
refers to Core\Model\Mapper\Post
, but what you pass is of type Core\Model\Post
.
namespace Core\Model\Mapper;
interface PostMapperInterface
{
public function save(Post $post);
}
You first state that you are now inside the namespace Core\Model\Mapper
, so when you refer to Post
in the method declaration, Post
is relative to that namespace, which is why it wants an instance of the type Core\Model\Mapper\Post
.
You need to change your code like this:
public function save(\Core\Model\Post $post);