Skip to content

Commit

Permalink
Merge pull request #10 from bearsaturday/php7
Browse files Browse the repository at this point in the history
PHP 7.x compatible
  • Loading branch information
koriym authored Jun 4, 2018
2 parents 98b391e + b7dbe7f commit 98f9de4
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 335 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: php
sudo: false
php:
- 5.4
- 5.5
- 5.6
- 7
- 7.1
- 7.2
Expand Down
7 changes: 5 additions & 2 deletions Panda.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ public static function onPearError(PEAR_Error $error)
$userInfo = $error->getUserInfo();
$trace = ($error->getBackTrace());
$info = array('Error Type' => $error->getType(),
'Debug Info' => $error->getUserInfo());
'Debug Info' => ''); //$error->getUserInfo()
if ($debugInfo !== $userInfo) {
$info['User Info'] = $userInfo;
}
Expand Down Expand Up @@ -603,8 +603,11 @@ public static function onLivePhpError($code, $message, $file, $line, array $errc
*
* @return void
*/
public static function onException(Exception $e, $httpScreenOutput = true)
public static function onException($e, $httpScreenOutput = true)
{
if (! $e instanceof Exception) {
throw $e;
}
try {
$class = get_class($e);
$body = null;
Expand Down
11 changes: 3 additions & 8 deletions Panda/vendors/debuglib.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,9 @@ public static function trim_leading_tabs( $string, $tab_padding = NULL ) {

public static function _handle_whitespace( $string ) {
// replace 2 or more spaces with nobreaks (for special markup)
$string = preg_replace_callback(
'/ {2,}/',
create_function(
'$matches',
'return str_repeat(" ", strlen($matches[0]));'
),
$string
);
$string = preg_replace_callback('/ {2,}/', function($matches) {
return str_repeat(" ", strlen($matches[0]));
}, $string);

$string = preg_replace(array('/&nbsp;$/', '/^&nbsp;/'), '<span class="DbugL_outer_space">&nbsp;</span>', $string); # mark spaces at the start/end of the string with red underscores
$string = str_replace("\t", '&nbsp;&nbsp;<span class="DbugL_tabs">&nbsp;</span>', $string); # replace tabulators with ' »'
Expand Down
56 changes: 28 additions & 28 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"name": "bearsaturday/panda",
"description": "Panda is a PHP error handler.",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Akihito Koriyama",
"email": "[email protected]"
"name": "bearsaturday/panda",
"description": "Panda is a PHP error handler.",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Akihito Koriyama",
"email": "[email protected]"
}
],
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"require": {
"php": ">=7.0.0",
"pear-pear.php.net/pear": "^1.10"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"autoload": {
"classmap": ["Panda"],
"files": ["./Panda.php"]
},
"config":{
"secure-http" : false
}
],
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"require": {
"php": ">=5.4.0",
"pear-pear.php.net/pear": "^1.10"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"doctrine/instantiator": "~1.0.5"
},
"include-path": [
"./"
],
"config":{
"secure-http" : false
}
}
8 changes: 0 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,4 @@
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="-1" />
</php>
</phpunit>
Loading

0 comments on commit 98f9de4

Please sign in to comment.