@@ -22,13 +22,13 @@ |
||
| 22 | 22 | |
| 23 | 23 | $recommended = $this->postRepository |
| 24 | 24 | ->withAudio() |
| 25 | - ->filter(function (AudioEpisode $episode) use ($post) { |
|
| 25 | + ->filter(function(AudioEpisode $episode) use ($post) { |
|
| 26 | 26 | return $post->guid() !== $episode->guid(); |
| 27 | 27 | }) |
| 28 | - ->sortByDesc(function (AudioEpisode $episode) { |
|
| 28 | + ->sortByDesc(function(AudioEpisode $episode) { |
|
| 29 | 29 | return $episode->createdAt(); |
| 30 | 30 | }) |
| 31 | - ->sortByDesc(function (AudioEpisode $episode) use ($tags) { |
|
| 31 | + ->sortByDesc(function(AudioEpisode $episode) use ($tags) { |
|
| 32 | 32 | return count(array_intersect($episode->tags() ?? [], $tags)); |
| 33 | 33 | }) |
| 34 | 34 | ->take($amount); |
@@ -26,15 +26,15 @@ |
||
| 26 | 26 | /** @var Collection|array $paths */ |
| 27 | 27 | $paths = $this->jigsaw->getOutputPaths(); |
| 28 | 28 | |
| 29 | - $paths = array_map(function (string $path) { |
|
| 29 | + $paths = array_map(function(string $path) { |
|
| 30 | 30 | return $this->jigsaw->getDestinationPath() . $path . '/index.html'; |
| 31 | 31 | }, is_array($paths) ? $paths : $paths->toArray()); |
| 32 | 32 | |
| 33 | - $paths = array_filter($paths, function (string $path) { |
|
| 33 | + $paths = array_filter($paths, function(string $path) { |
|
| 34 | 34 | return $this->filesystem->exists($path); |
| 35 | 35 | }); |
| 36 | 36 | |
| 37 | - return new OutputFileCollection(array_map(function (string $path) { |
|
| 37 | + return new OutputFileCollection(array_map(function(string $path) { |
|
| 38 | 38 | return new OutputFile($path, $this->filesystem->get($path)); |
| 39 | 39 | }, $paths)); |
| 40 | 40 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | return new PostCollection( |
| 29 | 29 | $collection |
| 30 | - ->map(function (PageVariable $post) { |
|
| 30 | + ->map(function(PageVariable $post) { |
|
| 31 | 31 | return $this->jigsawPostFactory->newPostFromPageVariable($post); |
| 32 | 32 | }) |
| 33 | 33 | ->toArray() |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | return new AudioEpisodeCollection( |
| 40 | 40 | $collection |
| 41 | - ->map(function (PageVariable $post) { |
|
| 41 | + ->map(function(PageVariable $post) { |
|
| 42 | 42 | return $this->jigsawPostFactory->newAudioEpisodeFromPageVariable($post); |
| 43 | 43 | }) |
| 44 | 44 | ->toArray() |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | return $this->jigsawCollectionToAudioEpisodeCollection( |
| 80 | 80 | $this->jigsaw |
| 81 | 81 | ->getCollection('episodes') |
| 82 | - ->filter(function (PageVariable $page) { |
|
| 82 | + ->filter(function(PageVariable $page) { |
|
| 83 | 83 | return !is_null($page->episode['audioUrl']); |
| 84 | 84 | }) |
| 85 | 85 | ); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | public function testExecuteFetchesExactAmount(): void |
| 27 | 27 | { |
| 28 | 28 | $audioEpisodeCollection = $this->createDefaultAudioEpisodeCollection() |
| 29 | - ->sortByDesc(function (AudioEpisode $episode) { |
|
| 29 | + ->sortByDesc(function(AudioEpisode $episode) { |
|
| 30 | 30 | return $episode->createdAt(); |
| 31 | 31 | }); |
| 32 | 32 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function testExecuteFiltersCategoryName(): void |
| 46 | 46 | { |
| 47 | 47 | $audioEpisodeCollection = $this->createDefaultAudioEpisodeCollection() |
| 48 | - ->sortByDesc(function (AudioEpisode $episode) { |
|
| 48 | + ->sortByDesc(function(AudioEpisode $episode) { |
|
| 49 | 49 | return $episode->createdAt(); |
| 50 | 50 | }); |
| 51 | 51 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $referenceEpisode, |
| 40 | 40 | 999 |
| 41 | 41 | ) |
| 42 | - ->filter(function (AudioEpisode $episode) use ($referenceEpisode) { |
|
| 42 | + ->filter(function(AudioEpisode $episode) use ($referenceEpisode) { |
|
| 43 | 43 | return $episode->guid() === $referenceEpisode->guid(); |
| 44 | 44 | }); |
| 45 | 45 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $referenceEpisodeProphecy->tags()->willReturn([]); |
| 56 | 56 | $referenceEpisode = $referenceEpisodeProphecy->reveal(); |
| 57 | 57 | |
| 58 | - $recommended = $this->recommendationService->recommendEpisodesForPost($referenceEpisode,999); |
|
| 58 | + $recommended = $this->recommendationService->recommendEpisodesForPost($referenceEpisode, 999); |
|
| 59 | 59 | |
| 60 | 60 | $this->assertGreaterThan($recommended->last()->createdAt(), $recommended->first()->createdAt()); |
| 61 | 61 | } |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | $referenceEpisodeProphecy->tags()->willReturn([]); |
| 70 | 70 | $referenceEpisode = $referenceEpisodeProphecy->reveal(); |
| 71 | 71 | |
| 72 | - $recommended = $this->recommendationService->recommendEpisodesForPost($referenceEpisode,2); |
|
| 72 | + $recommended = $this->recommendationService->recommendEpisodesForPost($referenceEpisode, 2); |
|
| 73 | 73 | $this->assertEquals(2, $recommended->count()); |
| 74 | 74 | |
| 75 | - $recommended = $this->recommendationService->recommendEpisodesForPost($referenceEpisode,1); |
|
| 75 | + $recommended = $this->recommendationService->recommendEpisodesForPost($referenceEpisode, 1); |
|
| 76 | 76 | $this->assertEquals(1, $recommended->count()); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | 'googleTagManagerId' => 'GTM-TEST-ID', |
| 10 | 10 | 'collections' => [ |
| 11 | 11 | 'episodes' => [ |
| 12 | - 'path' => function (\TightenCo\Jigsaw\PageVariable $page) { |
|
| 12 | + 'path' => function(\TightenCo\Jigsaw\PageVariable $page) { |
|
| 13 | 13 | $builder = new \PODEntender\Domain\Model\Post\EpisodeSlugBuilder(); |
| 14 | 14 | return $builder->build( |
| 15 | 15 | $page->episode['number'], |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $canonicalLink = $canonical->first()->attr('href'); |
| 58 | - $post = $this->postRepository->withAudio()->filter(function (Post $post) use ($canonicalLink) { |
|
| 58 | + $post = $this->postRepository->withAudio()->filter(function(Post $post) use ($canonicalLink) { |
|
| 59 | 59 | return $canonicalLink === $post->url(); |
| 60 | 60 | })->first(); |
| 61 | 61 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $header = [ |
| 67 | - '---' , |
|
| 67 | + '---', |
|
| 68 | 68 | 'redirect_from:', |
| 69 | 69 | ]; |
| 70 | 70 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | { |
| 14 | 14 | return new RobotsTxt( |
| 15 | 15 | $configuration['sitemap'], |
| 16 | - new RulesSetCollection($configuration['rulesSetCollection']->map(function (Collection $rules) { |
|
| 16 | + new RulesSetCollection($configuration['rulesSetCollection']->map(function(Collection $rules) { |
|
| 17 | 17 | $rulesSet = new RulesSet($rules['User-Agent']); |
| 18 | 18 | $rulesSet->addAllowRules($rules['Allow']->toArray()); |
| 19 | 19 | $rulesSet->addDisallowRules($rules['Disallow']->toArray()); |
@@ -8,16 +8,16 @@ |
||
| 8 | 8 | { |
| 9 | 9 | $robotsTxt = ['Sitemap: ' . $robot->sitemap()]; |
| 10 | 10 | $rules = $robot->ruleSetCollection() |
| 11 | - ->map(function (RulesSet $rule) { |
|
| 11 | + ->map(function(RulesSet $rule) { |
|
| 12 | 12 | return array_merge( |
| 13 | 13 | [ |
| 14 | 14 | '', |
| 15 | 15 | 'User-Agent: ' . $rule->userAgent(), |
| 16 | 16 | ], |
| 17 | - array_map(function (string $string) { |
|
| 17 | + array_map(function(string $string) { |
|
| 18 | 18 | return "Allow: $string"; |
| 19 | 19 | }, $rule->allowRules()), |
| 20 | - array_map(function (string $string) { |
|
| 20 | + array_map(function(string $string) { |
|
| 21 | 21 | return "Disallow: $string"; |
| 22 | 22 | }, $rule->disallowRules()) |
| 23 | 23 | ); |