This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving param and uriSegment annotations over to a new MSON syntax. #42
- Loading branch information
Jon Ursenbach
committed
Apr 28, 2017
1 parent
be36f8f
commit 3bcfe6d
Showing
20 changed files
with
795 additions
and
354 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
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
34 changes: 34 additions & 0 deletions
34
src/Exceptions/Resource/Annotations/InvalidMSONSyntaxException.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,34 @@ | ||
<?php | ||
namespace Mill\Exceptions\Resource\Annotations; | ||
|
||
class InvalidMSONSyntaxException extends \Exception | ||
{ | ||
use AnnotationExceptionTrait; | ||
|
||
/** | ||
* @param string $annotation | ||
* @param string $docblock | ||
* @param string $class | ||
* @param string $method | ||
* @return InvalidMSONSyntaxException | ||
*/ | ||
public static function create($required_field, $annotation, $docblock, $class, $method) | ||
{ | ||
$message = sprintf( | ||
'Unable to parse a `%s` in the MSON on %s::%s for: `@api-%s %s`', | ||
$required_field, | ||
$class, | ||
$method, | ||
$annotation, | ||
$docblock | ||
); | ||
|
||
$exception = new self($message); | ||
$exception->annotation = $annotation; | ||
$exception->docblock = $docblock; | ||
$exception->class = $class; | ||
$exception->method = $method; | ||
|
||
return $exception; | ||
} | ||
} |
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.