forked from thephpleague/factory-muffin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated two exceptions to make more sense
- Loading branch information
1 parent
a2f5349
commit 2f0fcbc
Showing
6 changed files
with
36 additions
and
36 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 |
---|---|---|
|
@@ -15,17 +15,17 @@ | |
namespace League\FactoryMuffin\Exceptions; | ||
|
||
/** | ||
* This is the no defined factory exception class. | ||
* This is the missing definition exception class. | ||
* | ||
* This is thrown when you try to create a model without defining its factory. | ||
* This class extends ModelException, so you may want to try to catch that | ||
* exception instead, if you want to be more general. | ||
* This is thrown when you try to create a model without registering its | ||
* definitions first. This class extends ModelException, so you may want to try | ||
* to catch that exception instead, if you want to be more general. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class NoDefinedFactoryException extends ModelException | ||
class MissingDefinitionException extends ModelException | ||
{ | ||
/** | ||
* Create a new instance. | ||
|
@@ -38,7 +38,7 @@ class NoDefinedFactoryException extends ModelException | |
public function __construct($model, $message = null) | ||
{ | ||
if (!$message) { | ||
$message = "No model definition was defined for the model: '$model'."; | ||
$message = "A model definition for '$model' has not been registered."; | ||
} | ||
|
||
parent::__construct($model, $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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,17 +15,17 @@ | |
namespace League\FactoryMuffin\Exceptions; | ||
|
||
/** | ||
* This is the model not found exception class. | ||
* This is the missing model exception not found exception class. | ||
* | ||
* This is thrown when we try to create an object, but the model class defined | ||
* is not found. This class extends ModelException, so you may want to try to | ||
* was not found. This class extends ModelException, so you may want to try to | ||
* catch that exception instead, if you want to be more general. | ||
* | ||
* @author Scott Robertson <[email protected]> | ||
* @author Graham Campbell <[email protected]> | ||
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT | ||
*/ | ||
class ModelNotFoundException extends ModelException | ||
class MissingModelException extends ModelException | ||
{ | ||
/** | ||
* Create a new instance. | ||
|
@@ -38,7 +38,7 @@ class ModelNotFoundException extends ModelException | |
public function __construct($model, $message = null) | ||
{ | ||
if (!$message) { | ||
$message = "No class was defined for the model: '$model'."; | ||
$message = "The model class '$model' is undefined."; | ||
} | ||
|
||
parent::__construct($model, $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
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