-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation when packaging a pass using the PassValidator class
- Loading branch information
Showing
9 changed files
with
297 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Passbook\Exception; | ||
|
||
/** | ||
* Thrown when validation of a pass fails. | ||
*/ | ||
class PassInvalidException extends \RuntimeException | ||
{ | ||
/** | ||
* Construct a PassInvalidException either with or without an array of errors. | ||
* | ||
* @param string[]|null $errors | ||
*/ | ||
public function __construct(array $errors = null) | ||
{ | ||
$this->errors = $errors ? $errors : array(); | ||
} | ||
|
||
/** | ||
* Returns the errors with the pass. | ||
* | ||
* @return string[] | ||
*/ | ||
public function getErrors() | ||
{ | ||
return $this->errors; | ||
} | ||
} |
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
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
Oops, something went wrong.