-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from brianjmiller/php7
PHP 7 support
- Loading branch information
Showing
17 changed files
with
348 additions
and
227 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 |
---|---|---|
|
@@ -11,6 +11,7 @@ composer.lock | |
sample/vendor | ||
sample/composer.lock | ||
doc/api | ||
doc/coverage | ||
|
||
# wild | ||
todo.md | ||
|
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
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,49 @@ | ||
<?php | ||
/* | ||
Copyright 2016 Rustici Software | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
namespace TinCan; | ||
|
||
class JSONParseErrorException extends \Exception | ||
{ | ||
private static $format = 'Invalid JSON "%s": %s (%d)'; | ||
|
||
private $malformedValue; | ||
private $jsonErrorNumber; | ||
private $jsonErrorMessage; | ||
|
||
public function __construct($malformedValue, $jsonErrorNumber, $jsonErrorMessage, \Exception $previous = null) { | ||
$this->malformedValue = $malformedValue; | ||
$this->jsonErrorNumber = (int) $jsonErrorNumber; | ||
$this->jsonErrorMessage = $jsonErrorMessage; | ||
|
||
$message = sprintf(self::$format, $malformedValue, $jsonErrorMessage, $jsonErrorNumber); | ||
|
||
parent::__construct($message, $jsonErrorNumber, $previous); | ||
} | ||
|
||
public function malformedValue() { | ||
return $this->malformedValue; | ||
} | ||
|
||
public function jsonErrorNumber() { | ||
return $this->jsonErrorNumber; | ||
} | ||
|
||
public function jsonErrorMessage() { | ||
return $this->jsonErrorMessage; | ||
} | ||
} |
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.