-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
1,836 additions
and
460 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
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,39 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the awesomite/var-dumper package. | ||
* | ||
* (c) Bartłomiej Krukowski <bartlomiej@krukowski.me> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Awesomite\VarDumper\LightVarDumper; | ||
|
||
require __DIR__ . DIRECTORY_SEPARATOR . 'init.php'; | ||
|
||
global $argc, $argv; | ||
$function = function ($a, $b) use ($argc, $argv) { | ||
}; | ||
|
||
$dumper = new LightVarDumper(); | ||
$dumper->dump($function); | ||
|
||
/* | ||
Output: | ||
object(Closure) #3 {[ | ||
$name => “{closure}” | ||
$filename => “(...)/examples/closure.php” | ||
$startLine => 17 | ||
$endLine => 18 | ||
$use => | ||
array(2) { | ||
[argc] => 1 | ||
[argv] => array(1) {“examples/closure.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
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,77 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the awesomite/var-dumper package. | ||
* | ||
* (c) Bartłomiej Krukowski <bartlomiej@krukowski.me> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Awesomite\VarDumper\LightVarDumper; | ||
|
||
require __DIR__ . DIRECTORY_SEPARATOR . 'init.php'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class DivideByZeroException extends \Exception | ||
{ | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class Divider | ||
{ | ||
public function divide($a, $b) | ||
{ | ||
if (0 === $b) { | ||
throw new DivideByZeroException('Cannot divide by zero'); | ||
} | ||
|
||
return $a / $b; | ||
} | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class Controller | ||
{ | ||
public static function execute($class, $method, ...$params) | ||
{ | ||
(new $class())->$method(...$params); | ||
} | ||
} | ||
|
||
try { | ||
Controller::execute(Divider::class, 'divide', 10, 0); | ||
} catch (\Exception $exception) { | ||
$dumper = new LightVarDumper(); | ||
$dumper->dump($exception); | ||
} | ||
|
||
/* | ||
Output: | ||
object(DivideByZeroException) #2 {[ | ||
[message] => “Cannot divide by zero” | ||
[code] => 0 | ||
[file] => “(...)/examples/exception-variadic.php:31” | ||
[previous] => NULL | ||
[trace] => | ||
1. (...)/examples/exception-variadic.php:45 Divider->divide( | ||
a: 10 | ||
b: 0 | ||
) | ||
2. (...)/examples/exception-variadic.php:50 Controller::execute( | ||
class: “Divider” | ||
method: “divide” | ||
params: array(2) {10, 0} | ||
) | ||
]} | ||
*/ |
Oops, something went wrong.