-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(ComponentTest): Prevent invalid / reserved props being passed in and add test - Github Issue #15 * fix(ComponentData): Remove unused properties and improve documentation
- Loading branch information
1 parent
de157b7
commit 3e52d15
Showing
6 changed files
with
113 additions
and
12 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
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,9 @@ | ||
<?php | ||
|
||
namespace SilbinaryWolf\Components; | ||
|
||
use Exception; | ||
|
||
class ComponentException extends Exception | ||
{ | ||
} |
24 changes: 24 additions & 0 deletions
24
src/SilbinaryWolf/Components/ComponentReservedPropertyException.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,24 @@ | ||
<?php | ||
|
||
namespace SilbinaryWolf\Components; | ||
|
||
class ComponentReservedPropertyException extends ComponentException | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $propertyName; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $componentName; | ||
|
||
public function __construct($componentName, $propertyName) | ||
{ | ||
$this->propertyName = $propertyName; | ||
$this->componentName = $componentName; | ||
$message = 'You cannot use the property "'.$propertyName.'" on "'.$componentName.'" as it\'s already used by ViewableData.'; | ||
parent::__construct($message); | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
tests/templates/components/ComponentUsingClassButNotPassedIn.ss
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 @@ | ||
<div class="$class"></div> |
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 @@ | ||
<div></div> |