@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | interface LoggedInUserProviderInterface |
6 | 6 | { |
7 | - public function getUser(): LoggedInUser; |
|
7 | + public function getUser(): LoggedInUser; |
|
8 | 8 | } |
9 | 9 | \ No newline at end of file |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | self::$tags = Collection::from([]); |
46 | 46 | } |
47 | 47 | |
48 | - public function createPostHeader(CreateNewTagsPostHeaderDto $newPostHeader): void |
|
48 | + public function createPostHeader(CreateNewTagsPostHeaderDto $newPostHeader): void |
|
49 | 49 | { |
50 | 50 | self::$postHeaders = self::$postHeaders->append(new InMemoryTagPostHeader( |
51 | 51 | $newPostHeader->getId(), |
@@ -59,29 +59,29 @@ discard block |
||
59 | 59 | )); |
60 | 60 | } |
61 | 61 | |
62 | - public function updatePostHeader(UpdateExistingTagsPostHeaderDto $updatedPostHeader): void |
|
62 | + public function updatePostHeader(UpdateExistingTagsPostHeaderDto $updatedPostHeader): void |
|
63 | 63 | { |
64 | 64 | foreach (self::$postHeaders |
65 | - ->filter(function ($header) use ($updatedPostHeader) { |
|
66 | - return $header->getId() == $updatedPostHeader->getId() && $header->getVersion() <= $updatedPostHeader->getVersion(); |
|
67 | - }) |
|
68 | - ->toArray() as $header) { |
|
65 | + ->filter(function ($header) use ($updatedPostHeader) { |
|
66 | + return $header->getId() == $updatedPostHeader->getId() && $header->getVersion() <= $updatedPostHeader->getVersion(); |
|
67 | + }) |
|
68 | + ->toArray() as $header) { |
|
69 | 69 | $header->setTitle($updatedPostHeader->getTitle()); |
70 | 70 | $header->setSummary($updatedPostHeader->getSummary()); |
71 | 71 | $header->setVersion($updatedPostHeader->getVersion()); |
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | - public function deletePostHeader(DeleteExistingTagsPostHeaderDto $deletedPostHeader): void |
|
75 | + public function deletePostHeader(DeleteExistingTagsPostHeaderDto $deletedPostHeader): void |
|
76 | 76 | { |
77 | 77 | self::$postHeaders = self::$postHeaders->filter( |
78 | - function ($header) use ($deletedPostHeader) { |
|
78 | + function ($header) use ($deletedPostHeader) { |
|
79 | 79 | return $header->getId() != $deletedPostHeader->getId(); |
80 | 80 | } |
81 | 81 | )->realize(); |
82 | 82 | } |
83 | 83 | |
84 | - public function findPostHeaders(): array |
|
84 | + public function findPostHeaders(): array |
|
85 | 85 | { |
86 | 86 | return self::$postHeaders |
87 | 87 | ->map(function ($header) { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | - public function createPost(CreateNewPostDto $newPost): Ulid |
|
44 | + public function createPost(CreateNewPostDto $newPost): Ulid |
|
45 | 45 | { |
46 | 46 | $id = new Ulid(); |
47 | 47 | self::$posts = self::$posts->append( |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | return $id; |
62 | 62 | } |
63 | 63 | |
64 | - public function deletePost(DeleteExistingPostDto $dto): void |
|
64 | + public function deletePost(DeleteExistingPostDto $dto): void |
|
65 | 65 | { |
66 | 66 | self::$posts = Collection::from( |
67 | 67 | self::$posts |
@@ -72,13 +72,13 @@ discard block |
||
72 | 72 | ); |
73 | 73 | } |
74 | 74 | |
75 | - public function updatePost(UpdateExistingPostDto $dto): void |
|
75 | + public function updatePost(UpdateExistingPostDto $dto): void |
|
76 | 76 | { |
77 | 77 | foreach (self::$posts |
78 | - ->filter(function ($post) use ($dto) { |
|
79 | - return $post->getId() == $dto->getId(); |
|
80 | - }) |
|
81 | - ->toArray() as $post) { |
|
78 | + ->filter(function ($post) use ($dto) { |
|
79 | + return $post->getId() == $dto->getId(); |
|
80 | + }) |
|
81 | + ->toArray() as $post) { |
|
82 | 82 | $post->setTitle($dto->getTitle()); |
83 | 83 | $post->setBody($dto->getBody()); |
84 | 84 | $post->setSummary($dto->getSummary()); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | class InMemoryTransactionFactory implements TransactionFactoryInterface |
9 | 9 | { |
10 | 10 | |
11 | - public function createTransaction($func): TransactionInterface |
|
11 | + public function createTransaction($func): TransactionInterface |
|
12 | 12 | { |
13 | 13 | return new InMemoryTransaction($func); |
14 | 14 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @return mixed |
27 | 27 | * @throws \Exception |
28 | 28 | */ |
29 | - public function execute(): mixed |
|
29 | + public function execute(): mixed |
|
30 | 30 | { |
31 | 31 | try { |
32 | 32 | $handler = $this->func; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param $func |
49 | 49 | * @return $this |
50 | 50 | */ |
51 | - public function afterCommit($func): TransactionInterface |
|
51 | + public function afterCommit($func): TransactionInterface |
|
52 | 52 | { |
53 | 53 | $this->afterCommit->add($func); |
54 | 54 | return $this; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param $func |
59 | 59 | * @return $this |
60 | 60 | */ |
61 | - public function afterRollback($func): TransactionInterface |
|
61 | + public function afterRollback($func): TransactionInterface |
|
62 | 62 | { |
63 | 63 | $this->afterRollback->add($func); |
64 | 64 | return $this; |
@@ -20,7 +20,7 @@ |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | |
23 | - public function getUser(): LoggedInUser |
|
23 | + public function getUser(): LoggedInUser |
|
24 | 24 | { |
25 | 25 | return new LoggedInUser( |
26 | 26 | InMemoryLoggedInUserProvider::$USER_ID, |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | public function updatePostHeader(UpdateExistingCommentsPostHeaderDto $updatedPostHeader): void |
56 | 56 | { |
57 | 57 | foreach (self::$postHeaders |
58 | - ->filter(function ($header) use ($updatedPostHeader) { |
|
59 | - return $header->getId() == $updatedPostHeader->getId() && $header->getVersion() <= $updatedPostHeader->getVersion(); |
|
60 | - }) |
|
61 | - ->toArray() as $header) { |
|
58 | + ->filter(function ($header) use ($updatedPostHeader) { |
|
59 | + return $header->getId() == $updatedPostHeader->getId() && $header->getVersion() <= $updatedPostHeader->getVersion(); |
|
60 | + }) |
|
61 | + ->toArray() as $header) { |
|
62 | 62 | $header->setTitle($updatedPostHeader->getTitle()); |
63 | 63 | $header->setTags($updatedPostHeader->getTags()); |
64 | 64 | $header->setVersion($updatedPostHeader->getVersion()); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function deletePostHeader(DeleteExistingCommentsPostHeaderDto $deletedPostHeader): void |
69 | 69 | { |
70 | 70 | self::$postHeaders = self::$postHeaders->filter( |
71 | - function ($header) use ($deletedPostHeader) { |
|
71 | + function ($header) use ($deletedPostHeader) { |
|
72 | 72 | return $header->getId() != $deletedPostHeader->getId(); |
73 | 73 | } |
74 | 74 | )->realize(); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | parent::__construct($managerRegistry); |
18 | 18 | } |
19 | 19 | |
20 | - public function createTransaction($func): TransactionInterface |
|
20 | + public function createTransaction($func): TransactionInterface |
|
21 | 21 | { |
22 | 22 | $em = $this->getEntityManager(); |
23 | 23 | if(!$em->isOpen()) { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @param CreateNewPostDto $newPost |
16 | 16 | * @return Ulid |
17 | 17 | */ |
18 | - public function createPost(CreateNewPostDto $newPost): Ulid |
|
18 | + public function createPost(CreateNewPostDto $newPost): Ulid |
|
19 | 19 | { |
20 | 20 | $id = new Ulid(); |
21 | 21 | $em = $this->getEntityManager(); |