forked from cweiske/jsonmapper
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added functions for validation of oneof/anyof params by type (#27)
* added methods to checkForType and getType for any value in JsonMapper * style fixes * added tests for newly added function * added more tests for edge cases and fix a bug * done changes recommended by sufyan * addition of type checking for anyof/oneof types in typeGroups along with test cases * addition of apply factory methods in library along with unit tests * fix a test case failure in PHP 7.0 * fix a test case failure in PHP 7.2
- Loading branch information
1 parent
5b8386c
commit 99fc537
Showing
8 changed files
with
1,066 additions
and
76 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace multitypetest; | ||
|
||
use apimatic\jsonmapper\JsonMapper; | ||
|
||
class MultiTypeJsonMapper extends JsonMapper | ||
{ | ||
public function getType(&$value, $factoryMethods = [], $start = '', $end = '') | ||
{ | ||
return parent::getType($value, $factoryMethods, $start, $end); | ||
} | ||
|
||
public function checkForType($typeGroup, $type, $start = '', $end = '') | ||
{ | ||
return parent::checkForType($typeGroup, $type, $start, $end); | ||
} | ||
|
||
} |
Oops, something went wrong.