-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for XenForo Resources, bump version to v1.1.0
- Loading branch information
1 parent
d31cf65
commit 0d7367b
Showing
12 changed files
with
174 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
DevCommunityDE/CodeFormatter/Preparer/PreparerInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace DevCommunityDE\CodeFormatter\Preparer; | ||
|
||
use XF\Mvc\Entity\Entity; | ||
|
||
/** | ||
* Class PreparerInterface | ||
* | ||
* @package DevCommunityDE\CodeFormatter\Preparer | ||
*/ | ||
interface PreparerInterface | ||
{ | ||
|
||
/** | ||
* @return Entity | ||
*/ | ||
public function getEntity(): Entity; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getContent() : string; | ||
|
||
/** | ||
* @param string $content | ||
*/ | ||
public function setContent(string $content); | ||
|
||
/** | ||
* | ||
*/ | ||
public function afterInsert(); | ||
|
||
/** | ||
* | ||
*/ | ||
public function afterUpdate(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace DevCommunityDE\CodeFormatter\Traits; | ||
|
||
use DevCommunityDE\CodeFormatter\CodeFormatter; | ||
|
||
/** | ||
* Class FormatsCode | ||
* | ||
* @package DevCommunityDE\CodeFormatter\Traits | ||
*/ | ||
trait FormatsCode | ||
{ | ||
|
||
/** | ||
* | ||
*/ | ||
public function afterInsert() | ||
{ | ||
parent::afterInsert(); | ||
|
||
$this->formatCode(); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function afterUpdate() | ||
{ | ||
parent::afterUpdate(); | ||
|
||
$this->formatCode(); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
protected function formatCode() | ||
{ | ||
(new CodeFormatter($this))->run(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
DevCommunityDE/CodeFormatter/XFRM/Service/ResourceUpdate/Preparer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace DevCommunityDE\CodeFormatter\XFRM\Service\ResourceUpdate; | ||
|
||
use DevCommunityDE\CodeFormatter\Preparer\PreparerInterface; | ||
use DevCommunityDE\CodeFormatter\Traits\FormatsCode; | ||
use XFRM\Entity\ResourceUpdate; | ||
use XFRM\Service\ResourceUpdate\Preparer as BasePreparer; | ||
|
||
/** | ||
* Class Preparer | ||
* | ||
* @package DevCommunityDE\CodeFormatter\XFRM\Service\ResourceUpdate | ||
*/ | ||
class Preparer extends BasePreparer implements PreparerInterface | ||
{ | ||
use FormatsCode; | ||
|
||
/** | ||
* @return ResourceUpdate | ||
*/ | ||
public function getEntity() : ResourceUpdate | ||
{ | ||
return $this->getUpdate(); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getContent() : string | ||
{ | ||
return $this->getEntity()->message; | ||
} | ||
|
||
/** | ||
* @param string $content | ||
*/ | ||
public function setContent(string $content) | ||
{ | ||
$this->setMessage($content); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<class_extensions> | ||
<extension from_class="XFRM\Service\ResourceUpdate\Preparer" to_class="DevCommunityDE\CodeFormatter\XFRM\Service\ResourceUpdate\Preparer" execute_order="10" active="1"/> | ||
<extension from_class="XF\Service\Post\Preparer" to_class="DevCommunityDE\CodeFormatter\XF\Service\Post\Preparer" execute_order="10" active="1"/> | ||
</class_extensions> |
6 changes: 6 additions & 0 deletions
6
...rceUpdate-Preparer_DevCommunityDE-CodeFormatter-XFRM-Service-ResourceUpdate-Preparer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"from_class": "XFRM\\Service\\ResourceUpdate\\Preparer", | ||
"to_class": "DevCommunityDE\\CodeFormatter\\XFRM\\Service\\ResourceUpdate\\Preparer", | ||
"execute_order": 10, | ||
"active": true | ||
} |
3 changes: 3 additions & 0 deletions
3
DevCommunityDE/CodeFormatter/_output/class_extensions/_metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"XF-Service-Post-Preparer_DevCommunityDE-CodeFormatter-XF-Service-Post-Preparer.json": { | ||
"hash": "38a93f88da5c59c03832964ae1f1522a" | ||
}, | ||
"XFRM-Service-ResourceUpdate-Preparer_DevCommunityDE-CodeFormatter-XFRM-Service-ResourceUpdate-Preparer.json": { | ||
"hash": "2ae5311a3c6c9b3d0b7e0539e15ce8d9" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
DevCommunityDE/CodeFormatter/_releases/DevCommunityDE-CodeFormatter-0.1.0 Alpha.zip
Binary file not shown.
Binary file added
BIN
+15.3 KB
DevCommunityDE/CodeFormatter/_releases/DevCommunityDE-CodeFormatter-1.1.0.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters