Skip to content

Commit

Permalink
Renaming hook ContentIsRendering to PageContentIsRendering
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Jul 29, 2017
1 parent c0d5630 commit 13a433f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Modules/Core/Events/Handlers/RenderMarkdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace Modules\Core\Events\Handlers;

use League\CommonMark\CommonMarkConverter;
use Modules\Page\Events\ContentIsRendering;
use Modules\Page\Events\PageContentIsRendering;

class RenderMarkdown
{
public function handle(ContentIsRendering $event)
public function handle(PageContentIsRendering $event)
{
$converter = new CommonMarkConverter();

Expand Down
4 changes: 2 additions & 2 deletions Modules/Page/Entities/PageTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Modules\Page\Entities;

use Illuminate\Database\Eloquent\Model;
use Modules\Page\Events\ContentIsRendering;
use Modules\Page\Events\PageContentIsRendering;

class PageTranslation extends Model
{
Expand All @@ -24,7 +24,7 @@ class PageTranslation extends Model

public function getBodyAttribute($body)
{
event($event = new ContentIsRendering($body));
event($event = new PageContentIsRendering($body));

return $event->getBody();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Modules\Page\Events;

class ContentIsRendering
class PageContentIsRendering
{
/**
* @var string The body of the page to render
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace Modules\Page\Tests;

use Illuminate\Support\Facades\Event;
use Modules\Page\Events\ContentIsRendering;
use Modules\Page\Events\PageContentIsRendering;

class ContentIsRenderingTest extends BasePageTest
class PageContentIsRenderingTest extends BasePageTest
{
/** @test */
public function it_can_change_final_content()
{
Event::listen(ContentIsRendering::class, function (ContentIsRendering $event) {
Event::listen(PageContentIsRendering::class, function (PageContentIsRendering $event) {
$event->setBody('<strong>' . $event->getOriginal() . '</strong>');
});

Expand Down
3 changes: 3 additions & 0 deletions Modules/Page/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
url: https://github.com/AsgardCms/Platform
versions:
"2.x.x@unreleased":
changed:
- Renamed hook <code>ContentIsRendering</code> to <code>PageContentIsRendering</code> making it more specific
"2.5.0":
added:
- Trigger event before a page is created (<code>PageIsCreating</code>) allow data to be changed
Expand Down

0 comments on commit 13a433f

Please sign in to comment.