/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Exceptions
/Handler.php
return $this->convertValidationExceptionToResponse($e, $request);
}
return $request->expectsJson()
? $this->prepareJsonResponse($request, $e)
: $this->prepareResponse($request, $e);
}
/**
* Prepare exception for rendering.
*
* @param \Exception $e
* @return \Exception
*/
protected function prepareException(Exception $e)
{
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
} elseif ($e instanceof AuthorizationException) {
$e = new AccessDeniedHttpException($e->getMessage(), $e);
} elseif ($e instanceof TokenMismatchException) {
$e = new HttpException(419, $e->getMessage(), $e);
}
return $e;
}
/**
* Convert an authentication exception into a response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
return $request->expectsJson()
? response()->json(['message' => $exception->getMessage()], 401)
: redirect()->guest(route('login'));
}
Arguments
"This action is unauthorized."
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Exceptions
/Handler.php
return [];
}
}
/**
* Render an exception into a response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Symfony\Component\HttpFoundation\Response
*/
public function render($request, Exception $e)
{
if (method_exists($e, 'render') && $response = $e->render($request)) {
return Router::toResponse($request, $response);
} elseif ($e instanceof Responsable) {
return $e->toResponse($request);
}
$e = $this->prepareException($e);
if ($e instanceof HttpResponseException) {
return $e->getResponse();
} elseif ($e instanceof AuthenticationException) {
return $this->unauthenticated($request, $e);
} elseif ($e instanceof ValidationException) {
return $this->convertValidationExceptionToResponse($e, $request);
}
return $request->expectsJson()
? $this->prepareJsonResponse($request, $e)
: $this->prepareResponse($request, $e);
}
/**
* Prepare exception for rendering.
*
* @param \Exception $e
* @return \Exception
*/
Arguments
AuthorizationException {#5215
#message: "This action is unauthorized."
#code: 0
#file: "/home/gregorio/Documents/codes/laraland/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php"
#line: 165
}
/home
/gregorio
/Documents
/codes
/laraland
/app
/Exceptions
/Handler.php
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
}
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
AuthorizationException {#5215
#message: "This action is unauthorized."
#code: 0
#file: "/home/gregorio/Documents/codes/laraland/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php"
#line: 165
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Lib
/Connector
/Laravel5
/ExceptionHandlerDecorator.php
/**
* Report or log an exception.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
$this->laravelExceptionHandler->report($e);
}
/**
* @param $request
* @param Exception $e
* @return \Symfony\Component\HttpFoundation\Response
* @throws Exception
*/
public function render($request, Exception $e)
{
$response = $this->laravelExceptionHandler->render($request, $e);
if ($this->exceptionHandlingDisabled && $this->isSymfonyExceptionHandlerOutput($response->getContent())) {
// If content was generated by the \Symfony\Component\Debug\ExceptionHandler class
// the Laravel application could not handle the exception,
// so re-throw this exception if the Codeception user disabled Laravel's exception handling.
throw $e;
}
return $response;
}
/**
* Check if the response content is HTML output of the Symfony exception handler class.
*
* @param string $content
* @return bool
*/
private function isSymfonyExceptionHandlerOutput($content)
{
return strpos($content, '<div id="sf-resetcontent" class="sf-reset">') !== false ||
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
AuthorizationException {#5215
#message: "This action is unauthorized."
#code: 0
#file: "/home/gregorio/Documents/codes/laraland/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php"
#line: 165
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
if (! $this->container->bound(ExceptionHandler::class) ||
! $passable instanceof Request) {
throw $e;
}
$handler = $this->container->make(ExceptionHandler::class);
$handler->report($e);
$response = $handler->render($passable, $e);
if (method_exists($response, 'withException')) {
$response->withException($e);
}
return $response;
}
}
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
AuthorizationException {#5215
#message: "This action is unauthorized."
#code: 0
#file: "/home/gregorio/Documents/codes/laraland/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php"
#line: 165
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
/**
* This extended pipeline catches any exceptions that occur during each slice.
*
* The exceptions are converted to HTTP responses for proper middleware handling.
*/
class Pipeline extends BasePipeline
{
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
AuthorizationException {#5215
#message: "This action is unauthorized."
#code: 0
#file: "/home/gregorio/Documents/codes/laraland/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php"
#line: 165
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/FormRequest.php
*/
protected function passesAuthorization()
{
if (method_exists($this, 'authorize')) {
return $this->container->call([$this, 'authorize']);
}
return false;
}
/**
* Handle a failed authorization attempt.
*
* @return void
*
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
protected function failedAuthorization()
{
throw new AuthorizationException('This action is unauthorized.');
}
/**
* Get the validated data from the request.
*
* @return array
*/
public function validated()
{
$rules = $this->container->call([$this, 'rules']);
return $this->only(collect($rules)->keys()->map(function ($rule) {
return str_contains($rule, '.') ? explode('.', $rule)[0] : $rule;
})->unique()->toArray());
}
/**
* Get custom messages for validator errors.
*
* @return array
Arguments
"This action is unauthorized."
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Validation
/ValidatesWhenResolvedTrait.php
namespace Illuminate\Validation;
/**
* Provides default implementation of ValidatesWhenResolved contract.
*/
trait ValidatesWhenResolvedTrait
{
/**
* Validate the class instance.
*
* @return void
*/
public function validate()
{
$this->prepareForValidation();
$instance = $this->getValidatorInstance();
if (! $this->passesAuthorization()) {
$this->failedAuthorization();
} elseif (! $instance->passes()) {
$this->failedValidation($instance);
}
}
/**
* Prepare the data for validation.
*
* @return void
*/
protected function prepareForValidation()
{
// no default action
}
/**
* Get the validator instance for the request.
*
* @return \Illuminate\Validation\Validator
*/
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Providers
/FormRequestServiceProvider.php
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
$this->app->afterResolving(ValidatesWhenResolved::class, function ($resolved) {
$resolved->validate();
});
$this->app->resolving(FormRequest::class, function ($request, $app) {
$this->initializeRequest($request, $app['request']);
$request->setContainer($app)->setRedirector($app->make(Redirector::class));
});
}
/**
* Initialize the form request with data from the given request.
*
* @param \Illuminate\Foundation\Http\FormRequest $form
* @param \Symfony\Component\HttpFoundation\Request $current
* @return void
*/
protected function initializeRequest(FormRequest $form, Request $current)
{
$files = $current->files->all();
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Container
/Container.php
foreach ($callbacksPerType as $type => $callbacks) {
if ($type === $abstract || $object instanceof $type) {
$results = array_merge($results, $callbacks);
}
}
return $results;
}
/**
* Fire an array of callbacks with an object.
*
* @param mixed $object
* @param array $callbacks
* @return void
*/
protected function fireCallbackArray($object, array $callbacks)
{
foreach ($callbacks as $callback) {
$callback($object, $this);
}
}
/**
* Get the container's bindings.
*
* @return array
*/
public function getBindings()
{
return $this->bindings;
}
/**
* Get the alias for an abstract if available.
*
* @param string $abstract
* @return string
*
* @throws \LogicException
Arguments
UpdateKaryawafKaryawan {#5207
#container: Application {#3040}
#redirector: Redirector {#5205}
#redirect: null
#redirectRoute: null
#redirectAction: null
#errorBag: "default"
#json: ParameterBag {#5214}
#convertedFiles: []
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5209}
+request: ParameterBag {#5206}
+query: ParameterBag {#5208}
+server: ServerBag {#5212}
+files: FileBag {#5211}
+cookies: ParameterBag {#5210}
+headers: HeaderBag {#5213}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: null
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/api/karyawaf/karyawans/1"
requestUri: "/api/karyawaf/karyawans/1"
baseUrl: ""
basePath: ""
method: "PUT"
format: "html"
}
Application {#3040}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Container
/Container.php
$this->fireCallbackArray(
$object, $this->getCallbacksForType($abstract, $object, $this->resolvingCallbacks)
);
$this->fireAfterResolvingCallbacks($abstract, $object);
}
/**
* Fire all of the after resolving callbacks.
*
* @param string $abstract
* @param mixed $object
* @return void
*/
protected function fireAfterResolvingCallbacks($abstract, $object)
{
$this->fireCallbackArray($object, $this->globalAfterResolvingCallbacks);
$this->fireCallbackArray(
$object, $this->getCallbacksForType($abstract, $object, $this->afterResolvingCallbacks)
);
}
/**
* Get all callbacks for a given type.
*
* @param string $abstract
* @param object $object
* @param array $callbacksPerType
*
* @return array
*/
protected function getCallbacksForType($abstract, $object, array $callbacksPerType)
{
$results = [];
foreach ($callbacksPerType as $type => $callbacks) {
if ($type === $abstract || $object instanceof $type) {
$results = array_merge($results, $callbacks);
}
Arguments
UpdateKaryawafKaryawan {#5207
#container: Application {#3040}
#redirector: Redirector {#5205}
#redirect: null
#redirectRoute: null
#redirectAction: null
#errorBag: "default"
#json: ParameterBag {#5214}
#convertedFiles: []
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5209}
+request: ParameterBag {#5206}
+query: ParameterBag {#5208}
+server: ServerBag {#5212}
+files: FileBag {#5211}
+cookies: ParameterBag {#5210}
+headers: HeaderBag {#5213}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: null
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/api/karyawaf/karyawans/1"
requestUri: "/api/karyawaf/karyawans/1"
baseUrl: ""
basePath: ""
method: "PUT"
format: "html"
}
array:1 [
0 => Closure {#4118
class: "Illuminate\Foundation\Providers\FormRequestServiceProvider"
this: FormRequestServiceProvider {#4150 …}
parameters: {
$resolved: {}
}
}
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Container
/Container.php
$this->afterResolvingCallbacks[$abstract][] = $callback;
}
}
/**
* Fire all of the resolving callbacks.
*
* @param string $abstract
* @param mixed $object
* @return void
*/
protected function fireResolvingCallbacks($abstract, $object)
{
$this->fireCallbackArray($object, $this->globalResolvingCallbacks);
$this->fireCallbackArray(
$object, $this->getCallbacksForType($abstract, $object, $this->resolvingCallbacks)
);
$this->fireAfterResolvingCallbacks($abstract, $object);
}
/**
* Fire all of the after resolving callbacks.
*
* @param string $abstract
* @param mixed $object
* @return void
*/
protected function fireAfterResolvingCallbacks($abstract, $object)
{
$this->fireCallbackArray($object, $this->globalAfterResolvingCallbacks);
$this->fireCallbackArray(
$object, $this->getCallbacksForType($abstract, $object, $this->afterResolvingCallbacks)
);
}
/**
* Get all callbacks for a given type.
Arguments
"Modules\Karyawaf\Http\Requests\UpdateKaryawafKaryawan"
UpdateKaryawafKaryawan {#5207
#container: Application {#3040}
#redirector: Redirector {#5205}
#redirect: null
#redirectRoute: null
#redirectAction: null
#errorBag: "default"
#json: ParameterBag {#5214}
#convertedFiles: []
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5209}
+request: ParameterBag {#5206}
+query: ParameterBag {#5208}
+server: ServerBag {#5212}
+files: FileBag {#5211}
+cookies: ParameterBag {#5210}
+headers: HeaderBag {#5213}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: null
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/api/karyawaf/karyawans/1"
requestUri: "/api/karyawaf/karyawans/1"
baseUrl: ""
basePath: ""
method: "PUT"
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Container
/Container.php
$object = $this->build($concrete);
} else {
$object = $this->make($concrete);
}
// If we defined any extenders for this type, we'll need to spin through them
// and apply them to the object being built. This allows for the extension
// of services, such as changing configuration or decorating the object.
foreach ($this->getExtenders($abstract) as $extender) {
$object = $extender($object, $this);
}
// If the requested type is registered as a singleton we'll want to cache off
// the instances in "memory" so we can return it later without creating an
// entirely new instance of an object on each subsequent request for it.
if ($this->isShared($abstract) && ! $needsContextualBuild) {
$this->instances[$abstract] = $object;
}
$this->fireResolvingCallbacks($abstract, $object);
// Before returning, we will also set the resolved flag to "true" and pop off
// the parameter overrides for this build. After those two things are done
// we will be ready to return back the fully constructed class instance.
$this->resolved[$abstract] = true;
array_pop($this->with);
return $object;
}
/**
* Get the concrete type for a given abstract.
*
* @param string $abstract
* @return mixed $concrete
*/
protected function getConcrete($abstract)
{
if (! is_null($concrete = $this->getContextualConcrete($abstract))) {
Arguments
"Modules\Karyawaf\Http\Requests\UpdateKaryawafKaryawan"
UpdateKaryawafKaryawan {#5207
#container: Application {#3040}
#redirector: Redirector {#5205}
#redirect: null
#redirectRoute: null
#redirectAction: null
#errorBag: "default"
#json: ParameterBag {#5214}
#convertedFiles: []
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5209}
+request: ParameterBag {#5206}
+query: ParameterBag {#5208}
+server: ServerBag {#5212}
+files: FileBag {#5211}
+cookies: ParameterBag {#5210}
+headers: HeaderBag {#5213}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: null
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
pathInfo: "/api/karyawaf/karyawans/1"
requestUri: "/api/karyawaf/karyawans/1"
baseUrl: ""
basePath: ""
method: "PUT"
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Container
/Container.php
*
* @param string $abstract
* @param array $parameters
* @return mixed
*/
public function makeWith($abstract, array $parameters = [])
{
return $this->make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param array $parameters
* @return mixed
*/
public function make($abstract, array $parameters = [])
{
return $this->resolve($abstract, $parameters);
}
/**
* {@inheritdoc}
*/
public function get($id)
{
if ($this->has($id)) {
return $this->resolve($id);
}
throw new EntryNotFoundException;
}
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param array $parameters
* @return mixed
Arguments
"Modules\Karyawaf\Http\Requests\UpdateKaryawafKaryawan"
[]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Application.php
}
/**
* Resolve the given type from the container.
*
* (Overriding Container::make)
*
* @param string $abstract
* @param array $parameters
* @return mixed
*/
public function make($abstract, array $parameters = [])
{
$abstract = $this->getAlias($abstract);
if (isset($this->deferredServices[$abstract]) && ! isset($this->instances[$abstract])) {
$this->loadDeferredProvider($abstract);
}
return parent::make($abstract, $parameters);
}
/**
* Determine if the given abstract type has been bound.
*
* (Overriding Container::bound)
*
* @param string $abstract
* @return bool
*/
public function bound($abstract)
{
return isset($this->deferredServices[$abstract]) || parent::bound($abstract);
}
/**
* Determine if the application has booted.
*
* @return bool
*/
Arguments
"Modules\Karyawaf\Http\Requests\UpdateKaryawafKaryawan"
[]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/RouteDependencyResolverTrait.php
}
/**
* Attempt to transform the given parameter into a class instance.
*
* @param \ReflectionParameter $parameter
* @param array $parameters
* @return mixed
*/
protected function transformDependency(ReflectionParameter $parameter, $parameters)
{
$class = $parameter->getClass();
// If the parameter has a type-hinted class, we will check to see if it is already in
// the list of parameters. If it is we will just skip it as it is probably a model
// binding and we do not want to mess with those; otherwise, we resolve it here.
if ($class && ! $this->alreadyInParameters($class->name, $parameters)) {
return $parameter->isDefaultValueAvailable()
? $parameter->getDefaultValue()
: $this->container->make($class->name);
}
}
/**
* Determine if an object of the given class is in a list of parameters.
*
* @param string $class
* @param array $parameters
* @return bool
*/
protected function alreadyInParameters($class, array $parameters)
{
return ! is_null(Arr::first($parameters, function ($value) use ($class) {
return $value instanceof $class;
}));
}
/**
* Splice the given value into the parameter list.
*
Arguments
"Modules\Karyawaf\Http\Requests\UpdateKaryawafKaryawan"
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/RouteDependencyResolverTrait.php
$parameters, new ReflectionMethod($instance, $method)
);
}
/**
* Resolve the given method's type-hinted dependencies.
*
* @param array $parameters
* @param \ReflectionFunctionAbstract $reflector
* @return array
*/
public function resolveMethodDependencies(array $parameters, ReflectionFunctionAbstract $reflector)
{
$instanceCount = 0;
$values = array_values($parameters);
foreach ($reflector->getParameters() as $key => $parameter) {
$instance = $this->transformDependency(
$parameter, $parameters
);
if (! is_null($instance)) {
$instanceCount++;
$this->spliceIntoParameters($parameters, $key, $instance);
} elseif (! isset($values[$key - $instanceCount]) &&
$parameter->isDefaultValueAvailable()) {
$this->spliceIntoParameters($parameters, $key, $parameter->getDefaultValue());
}
}
return $parameters;
}
/**
* Attempt to transform the given parameter into a class instance.
*
* @param \ReflectionParameter $parameter
* @param array $parameters
Arguments
ReflectionParameter {#5194
+name: "request"
position: 0
typeHint: "Modules\Karyawaf\Http\Requests\UpdateKaryawafKaryawan"
}
array:1 [
"karyawan" => "1"
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/RouteDependencyResolverTrait.php
use ReflectionFunctionAbstract;
trait RouteDependencyResolverTrait
{
/**
* Resolve the object method's type-hinted dependencies.
*
* @param array $parameters
* @param object $instance
* @param string $method
* @return array
*/
protected function resolveClassMethodDependencies(array $parameters, $instance, $method)
{
if (! method_exists($instance, $method)) {
return $parameters;
}
return $this->resolveMethodDependencies(
$parameters, new ReflectionMethod($instance, $method)
);
}
/**
* Resolve the given method's type-hinted dependencies.
*
* @param array $parameters
* @param \ReflectionFunctionAbstract $reflector
* @return array
*/
public function resolveMethodDependencies(array $parameters, ReflectionFunctionAbstract $reflector)
{
$instanceCount = 0;
$values = array_values($parameters);
foreach ($reflector->getParameters() as $key => $parameter) {
$instance = $this->transformDependency(
$parameter, $parameters
);
Arguments
array:1 [
"karyawan" => "1"
]
ReflectionMethod {#5186
+name: "update"
+class: "Modules\Karyawaf\Http\Controllers\KaryawanController"
parameters: {
$request: ReflectionParameter {#5264
+name: "request"
position: 0
typeHint: "Modules\Karyawaf\Http\Requests\UpdateKaryawafKaryawan"
}
$id: ReflectionParameter {#5272
+name: "id"
position: 1
}
}
modifiers: "public"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/ControllerDispatcher.php
* @param \Illuminate\Container\Container $container
* @return void
*/
public function __construct(Container $container)
{
$this->container = $container;
}
/**
* Dispatch a request to a given controller and method.
*
* @param \Illuminate\Routing\Route $route
* @param mixed $controller
* @param string $method
* @return mixed
*/
public function dispatch(Route $route, $controller, $method)
{
$parameters = $this->resolveClassMethodDependencies(
$route->parametersWithoutNulls(), $controller, $method
);
if (method_exists($controller, 'callAction')) {
return $controller->callAction($method, $parameters);
}
return $controller->{$method}(...array_values($parameters));
}
/**
* Get the middleware for the controller instance.
*
* @param \Illuminate\Routing\Controller $controller
* @param string $method
* @return array
*/
public function getMiddleware($controller, $method)
{
if (! method_exists($controller, 'getMiddleware')) {
return [];
Arguments
array:1 [
"karyawan" => "1"
]
KaryawanController {#5157}
"update"
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Route.php
protected function runCallable()
{
$callable = $this->action['uses'];
return $callable(...array_values($this->resolveMethodDependencies(
$this->parametersWithoutNulls(), new ReflectionFunction($this->action['uses'])
)));
}
/**
* Run the route action and return the response.
*
* @return mixed
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
protected function runController()
{
return $this->controllerDispatcher()->dispatch(
$this, $this->getController(), $this->getControllerMethod()
);
}
/**
* Get the controller instance for the route.
*
* @return mixed
*/
public function getController()
{
if (! $this->controller) {
$class = $this->parseControllerCallback()[0];
$this->controller = $this->container->make(ltrim($class, '\\'));
}
return $this->controller;
}
/**
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Route.php
*
* @throws \UnexpectedValueException
*/
protected function parseAction($action)
{
return RouteAction::parse($this->uri, $action);
}
/**
* Run the route action and return the response.
*
* @return mixed
*/
public function run()
{
$this->container = $this->container ?: new Container;
try {
if ($this->isControllerAction()) {
return $this->runController();
}
return $this->runCallable();
} catch (HttpResponseException $e) {
return $e->getResponse();
}
}
/**
* Checks whether the route's action is a controller.
*
* @return bool
*/
protected function isControllerAction()
{
return is_string($this->action['uses']);
}
/**
* Run the route action and return the response.
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
/**
* Run the given route within a Stack "onion" instance.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
->then(function ($request) use ($route) {
return $this->prepareResponse(
$request, $route->run()
);
});
}
/**
* Gather the middleware for the given route with resolved class names.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
public function gatherRouteMiddleware(Route $route)
{
$middleware = collect($route->gatherMiddleware())->map(function ($name) {
return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups);
})->flatten();
return $this->sortMiddleware($middleware);
}
/**
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
use Symfony\Component\Debug\Exception\FatalThrowableError;
/**
* This extended pipeline catches any exceptions that occur during each slice.
*
* The exceptions are converted to HTTP responses for proper middleware handling.
*/
class Pipeline extends BasePipeline
{
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Middleware
/SubstituteBindings.php
*/
public function __construct(Registrar $router)
{
$this->router = $router;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$this->router->substituteBindings($route = $request->route());
$this->router->substituteImplicitBindings($route);
return $next($request);
}
}
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
return method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
$parameters = explode(',', $parameters);
}
return [$name, $parameters];
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure {#5179
class: "Illuminate\Routing\Pipeline"
this: Pipeline {#5178 …}
parameters: {
$passable: {}
}
use: {
$destination: Closure {#5174 …}
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Auth
/Middleware
/Authenticate.php
public function __construct(Auth $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string[] ...$guards
* @return mixed
*
* @throws \Illuminate\Auth\AuthenticationException
*/
public function handle($request, Closure $next, ...$guards)
{
$this->authenticate($guards);
return $next($request);
}
/**
* Determine if the user is logged in to any of the given guards.
*
* @param array $guards
* @return void
*
* @throws \Illuminate\Auth\AuthenticationException
*/
protected function authenticate(array $guards)
{
if (empty($guards)) {
return $this->auth->authenticate();
}
foreach ($guards as $guard) {
if ($this->auth->guard($guard)->check()) {
return $this->auth->shouldUse($guard);
}
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
return method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
$parameters = explode(',', $parameters);
}
return [$name, $parameters];
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure {#5182
class: "Illuminate\Routing\Pipeline"
this: Pipeline {#5178 …}
parameters: {
$passable: {}
}
use: {
$stack: Closure {#5179 …}
$pipe: "Illuminate\Routing\Middleware\SubstituteBindings"
}
}
"api"
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Middleware
/ThrottleRequests.php
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param int|string $maxAttempts
* @param float|int $decayMinutes
* @return mixed
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
*/
public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes = 1)
{
$key = $this->resolveRequestSignature($request);
$maxAttempts = $this->resolveMaxAttempts($request, $maxAttempts);
if ($this->limiter->tooManyAttempts($key, $maxAttempts, $decayMinutes)) {
throw $this->buildException($key, $maxAttempts);
}
$this->limiter->hit($key, $decayMinutes);
$response = $next($request);
return $this->addHeaders(
$response, $maxAttempts,
$this->calculateRemainingAttempts($key, $maxAttempts)
);
}
/**
* Resolve the number of attempts if the user is authenticated or not.
*
* @param \Illuminate\Http\Request $request
* @param int|string $maxAttempts
* @return int
*/
protected function resolveMaxAttempts($request, $maxAttempts)
{
if (Str::contains($maxAttempts, '|')) {
$maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0];
}
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
return method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
$parameters = explode(',', $parameters);
}
return [$name, $parameters];
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure {#5183
class: "Illuminate\Routing\Pipeline"
this: Pipeline {#5178 …}
parameters: {
$passable: {}
}
use: {
$stack: Closure {#5182 …}
$pipe: "Illuminate\Auth\Middleware\Authenticate:api"
}
}
60
"1"
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
return $destination($passable);
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
->then(function ($request) use ($route) {
return $this->prepareResponse(
$request, $route->run()
);
});
}
/**
* Gather the middleware for the given route with resolved class names.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
public function gatherRouteMiddleware(Route $route)
{
$middleware = collect($route->gatherMiddleware())->map(function ($name) {
return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups);
})->flatten();
return $this->sortMiddleware($middleware);
}
/**
* Sort the given middleware by priority.
*
Arguments
Closure {#5174
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
parameters: {
$request: {}
}
use: {
$route: Route {#4248 …}
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
return $route;
}
/**
* Return the response for the given route.
*
* @param Route $route
* @param Request $request
* @return mixed
*/
protected function runRoute(Request $request, Route $route)
{
$request->setRouteResolver(function () use ($route) {
return $route;
});
$this->events->dispatch(new Events\RouteMatched($route, $request));
return $this->prepareResponse($request,
$this->runRouteWithinStack($route, $request)
);
}
/**
* Run the given route within a Stack "onion" instance.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
Arguments
Route {#4248}
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function dispatch(Request $request)
{
$this->currentRequest = $request;
return $this->dispatchToRoute($request);
}
/**
* Dispatch the request to a route and return the response.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function dispatchToRoute(Request $request)
{
return $this->runRoute($request, $this->findRoute($request));
}
/**
* Find the route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*/
protected function findRoute($request)
{
$this->current = $route = $this->routes->match($request);
$this->container->instance(Route::class, $route);
return $route;
}
/**
* Return the response for the given route.
*
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Route {#4248}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Router.php
* @return mixed
*/
public function respondWithRoute($name)
{
$route = tap($this->routes->getByName($name))->bind($this->currentRequest);
return $this->runRoute($this->currentRequest, $route);
}
/**
* Dispatch the request to the application.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function dispatch(Request $request)
{
$this->currentRequest = $request;
return $this->dispatchToRoute($request);
}
/**
* Dispatch the request to a route and return the response.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function dispatchToRoute(Request $request)
{
return $this->runRoute($request, $this->findRoute($request));
}
/**
* Find the route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*/
protected function findRoute($request)
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Kernel.php
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
*
* @return \Closure
*/
protected function dispatchToRouter()
{
return function ($request) {
$this->app->instance('request', $request);
return $this->router->dispatch($request);
};
}
/**
* Call the terminate method on any terminable middleware.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Response $response
* @return void
*/
public function terminate($request, $response)
{
$this->terminateMiddleware($request, $response);
$this->app->terminate();
}
/**
* Call the terminate method on any terminable middleware.
*
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
use Symfony\Component\Debug\Exception\FatalThrowableError;
/**
* This extended pipeline catches any exceptions that occur during each slice.
*
* The exceptions are converted to HTTP responses for proper middleware handling.
*/
class Pipeline extends BasePipeline
{
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/fideloper
/proxy
/src
/TrustProxies.php
{
$this->config = $config;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
*
* @return mixed
*/
public function handle($request, Closure $next)
{
$this->setTrustedProxyHeaderNames($request);
$this->setTrustedProxyIpAddresses($request);
return $next($request);
}
/**
* Sets the trusted proxies on the request to the value of trustedproxy.proxies
*
* @param \Illuminate\Http\Request $request
*/
protected function setTrustedProxyIpAddresses($request)
{
$trustedIps = $this->proxies ?: $this->config->get('trustedproxy.proxies');
// We only trust specific IP addresses
if (is_array($trustedIps)) {
return $this->setTrustedProxyIpAddressesToSpecificIps($request, $trustedIps);
}
// We trust any IP address that calls us, but not proxies further
// up the forwarding chain.
// TODO: Determine if this should only trust the first IP address
// Currently it trusts the entire chain (array of IPs),
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
return method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
$parameters = explode(',', $parameters);
}
return [$name, $parameters];
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure {#4106
class: "Illuminate\Routing\Pipeline"
this: Pipeline {#4119 …}
parameters: {
$passable: {}
}
use: {
$destination: Closure {#4125 …}
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/TransformsRequest.php
* The additional attributes passed to the middleware.
*
* @var array
*/
protected $attributes = [];
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next, ...$attributes)
{
$this->attributes = $attributes;
$this->clean($request);
return $next($request);
}
/**
* Clean the request's data.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function clean($request)
{
$this->cleanParameterBag($request->query);
if ($request->isJson()) {
$this->cleanParameterBag($request->json());
} else {
$this->cleanParameterBag($request->request);
}
}
/**
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
return method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
$parameters = explode(',', $parameters);
}
return [$name, $parameters];
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure {#4117
class: "Illuminate\Routing\Pipeline"
this: Pipeline {#4119 …}
parameters: {
$passable: {}
}
use: {
$stack: Closure {#4106 …}
$pipe: "App\Http\Middleware\TrustProxies"
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/TransformsRequest.php
* The additional attributes passed to the middleware.
*
* @var array
*/
protected $attributes = [];
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next, ...$attributes)
{
$this->attributes = $attributes;
$this->clean($request);
return $next($request);
}
/**
* Clean the request's data.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function clean($request)
{
$this->cleanParameterBag($request->query);
if ($request->isJson()) {
$this->cleanParameterBag($request->json());
} else {
$this->cleanParameterBag($request->request);
}
}
/**
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
return method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
$parameters = explode(',', $parameters);
}
return [$name, $parameters];
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure {#4123
class: "Illuminate\Routing\Pipeline"
this: Pipeline {#4119 …}
parameters: {
$passable: {}
}
use: {
$stack: Closure {#4117 …}
$pipe: "Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull"
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/ValidatePostSize.php
class ValidatePostSize
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*
* @throws \Illuminate\Http\Exceptions\PostTooLargeException
*/
public function handle($request, Closure $next)
{
$max = $this->getPostMaxSize();
if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
throw new PostTooLargeException;
}
return $next($request);
}
/**
* Determine the server 'post_max_size' as bytes.
*
* @return int
*/
protected function getPostMaxSize()
{
if (is_numeric($postMaxSize = ini_get('post_max_size'))) {
return (int) $postMaxSize;
}
$metric = strtoupper(substr($postMaxSize, -1));
$postMaxSize = (int) $postMaxSize;
switch ($metric) {
case 'K':
return $postMaxSize * 1024;
case 'M':
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
return method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
$parameters = explode(',', $parameters);
}
return [$name, $parameters];
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure {#4116
class: "Illuminate\Routing\Pipeline"
this: Pipeline {#4119 …}
parameters: {
$passable: {}
}
use: {
$stack: Closure {#4123 …}
$pipe: "App\Http\Middleware\TrimStrings"
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Middleware
/CheckForMaintenanceMode.php
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
*/
public function handle($request, Closure $next)
{
if ($this->app->isDownForMaintenance()) {
$data = json_decode(file_get_contents($this->app->storagePath().'/framework/down'), true);
throw new MaintenanceModeException($data['time'], $data['retry'], $data['message']);
}
return $next($request);
}
}
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
return method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
$parameters = explode(',', $parameters);
}
return [$name, $parameters];
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
Closure {#5153
class: "Illuminate\Routing\Pipeline"
this: Pipeline {#4119 …}
parameters: {
$passable: {}
}
use: {
$stack: Closure {#4116 …}
$pipe: "Illuminate\Foundation\Http\Middleware\ValidatePostSize"
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Routing
/Pipeline.php
return $this->handleException($passable, new FatalThrowableError($e));
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
$slice = parent::carry();
$callable = $slice($stack, $pipe);
return $callable($passable);
} catch (Exception $e) {
return $this->handleException($passable, $e);
} catch (Throwable $e) {
return $this->handleException($passable, new FatalThrowableError($e));
}
};
};
}
/**
* Handle the given exception.
*
* @param mixed $passable
* @param \Exception $e
* @return mixed
*
* @throws \Exception
*/
protected function handleException($passable, Exception $e)
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Pipeline
/Pipeline.php
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
return $destination($passable);
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Kernel.php
}
/**
* Send the given request through the middleware / router.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
protected function sendRequestThroughRouter($request)
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
}
/**
* Bootstrap the application for HTTP requests.
*
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
*
* @return \Closure
*/
protected function dispatchToRouter()
Arguments
Closure {#4125
class: "Illuminate\Foundation\Http\Kernel"
this: Kernel {#4120 …}
parameters: {
$request: {}
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Http
/Kernel.php
$router->middlewareGroup($key, $middleware);
}
foreach ($this->routeMiddleware as $key => $middleware) {
$router->aliasMiddleware($key, $middleware);
}
}
/**
* Handle an incoming HTTP request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function handle($request)
{
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Exception $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
} catch (Throwable $e) {
$this->reportException($e = new FatalThrowableError($e));
$response = $this->renderException($request, $e);
}
$this->app['events']->dispatch(
new Events\RequestHandled($request, $response)
);
return $response;
}
/**
* Send the given request through the middleware / router.
*
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Application.php
/**
* Call the booting callbacks for the application.
*
* @param array $callbacks
* @return void
*/
protected function fireAppCallbacks(array $callbacks)
{
foreach ($callbacks as $callback) {
call_user_func($callback, $this);
}
}
/**
* {@inheritdoc}
*/
public function handle(SymfonyRequest $request, $type = self::MASTER_REQUEST, $catch = true)
{
return $this[HttpKernelContract::class]->handle(Request::createFromBase($request));
}
/**
* Determine if middleware has been disabled for the application.
*
* @return bool
*/
public function shouldSkipMiddleware()
{
return $this->bound('middleware.disable') &&
$this->make('middleware.disable') === true;
}
/**
* Get the path to the cached services.php file.
*
* @return string
*/
public function getCachedServicesPath()
{
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Lib
/Connector
/Laravel5.php
/**
* Execute a request.
*
* @param SymfonyRequest $request
* @return Response
*/
protected function doRequest($request)
{
if (!$this->firstRequest) {
$this->initialize($request);
}
$this->firstRequest = false;
$this->applyBindings();
$this->applyContextualBindings();
$this->applyInstances();
$this->applyApplicationHandlers();
$request = Request::createFromBase($request);
$response = $this->kernel->handle($request);
$this->app->make('Illuminate\Contracts\Http\Kernel')->terminate($request, $response);
return $response;
}
/**
* Make sure files are \Illuminate\Http\UploadedFile instances with the private $test property set to true.
* Fixes issue https://github.com/Codeception/Codeception/pull/3417.
*
* @param array $files
* @return array
*/
protected function filterFiles(array $files)
{
$files = parent::filterFiles($files);
if (! class_exists('Illuminate\Http\UploadedFile')) {
// The \Illuminate\Http\UploadedFile class was introduced in Laravel 5.2.15,
// so don't change the $files array if it does not exist.
return $files;
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/symfony
/browser-kit
/Client.php
}
if (empty($server['HTTP_HOST'])) {
$server['HTTP_HOST'] = $this->extractHost($uri);
}
$server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME);
$this->internalRequest = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);
$this->request = $this->filterRequest($this->internalRequest);
if (true === $changeHistory) {
$this->history->add($this->internalRequest);
}
if ($this->insulated) {
$this->response = $this->doRequestInProcess($this->request);
} else {
$this->response = $this->doRequest($this->request);
}
$this->internalResponse = $this->filterResponse($this->response);
$this->cookieJar->updateFromResponse($this->internalResponse, $uri);
$status = $this->internalResponse->getStatus();
if ($status >= 300 && $status < 400) {
$this->redirect = $this->internalResponse->getHeader('Location');
} else {
$this->redirect = null;
}
if ($this->followRedirects && $this->redirect) {
$this->redirects[serialize($this->history->current())] = true;
return $this->crawler = $this->followRedirect();
}
Arguments
Request {#5141
#json: ParameterBag {#5214}
#convertedFiles: null
#userResolver: Closure {#5175
class: "Illuminate\Auth\AuthServiceProvider"
this: AuthServiceProvider {#4105 …}
parameters: {
$guard: {
default: null
}
}
use: {
$app: Application {#3040 …}
}
}
#routeResolver: Closure {#5165
class: "Illuminate\Routing\Router"
this: Router {#4093 …}
use: {
$route: Route {#4248 …}
}
}
+attributes: ParameterBag {#5149}
+request: ParameterBag {#5150}
+query: ParameterBag {#5170}
+server: ServerBag {#5147}
+files: FileBag {#5145}
+cookies: ParameterBag {#5130}
+headers: HeaderBag {#5164}
#content: "nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:4 [
0 => "text/html"
1 => "application/xhtml+xml"
2 => "application/xml"
3 => "*/*"
]
#pathInfo: "/api/karyawaf/karyawans/1"
#requestUri: "/api/karyawaf/karyawans/1"
#baseUrl: ""
#basePath: null
#method: "PUT"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Lib
/InnerBrowser.php
$hostname = parse_url($uri, PHP_URL_HOST);
if (!$this->isInternalDomain($hostname)) {
throw new ExternalUrlException(get_class($this) . " can't open external URL: " . $uri);
}
}
if ($method !== 'GET' && $content === null && !empty($parameters)) {
$content = http_build_query($parameters);
}
}
if (!ReflectionHelper::readPrivateProperty($this->client, 'followRedirects')) {
$result = $this->client->request($method, $uri, $parameters, $files, $server, $content, $changeHistory);
$this->debugResponse($uri);
return $result;
}
$maxRedirects = ReflectionHelper::readPrivateProperty($this->client, 'maxRedirects', 'Symfony\Component\BrowserKit\Client');
$this->client->followRedirects(false);
$result = $this->client->request($method, $uri, $parameters, $files, $server, $content, $changeHistory);
$this->debugResponse($uri);
return $this->redirectIfNecessary($result, $maxRedirects, 0);
}
protected function isInternalDomain($domain)
{
if ($this->internalDomains === null) {
$this->internalDomains = $this->getInternalDomains();
}
foreach ($this->internalDomains as $pattern) {
if (preg_match($pattern, $domain)) {
return true;
}
}
return false;
}
/**
* Opens a page with arbitrary request parameters.
Arguments
"PUT"
"http://laraland.test/api/karyawaf/karyawans/1"
array:6 [
"nama" => "Gregorio"
"posisi" => "Gaming Dealer"
"tempat_lahir" => "Hazelville"
"tanggal_lahir" => Carbon @417291656 {#4993
date: 1983-03-23 18:20:56.0 UTC (+00:00)
}
"rekrut" => "2013-11-05 02:11:05"
"status" => "1"
]
[]
array:5 [
"HTTP_USER_AGENT" => "Symfony BrowserKit"
"HTTP_HOST" => "laraland.test"
"REQUEST_TIME" => 1532744935
"REQUEST_TIME_FLOAT" => 1532744935.4527
"HTTPS" => false
]
"nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
true
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Lib
/InnerBrowser.php
* @api
* @param $method
* @param $uri
* @param array $parameters
* @param array $files
* @param array $server
* @param null $content
* @return mixed|Crawler
* @throws ExternalUrlException
* @see `_loadPage`
*/
public function _request(
$method,
$uri,
array $parameters = [],
array $files = [],
array $server = [],
$content = null
) {
$this->clientRequest($method, $uri, $parameters, $files, $server, $content, true);
return $this->_getResponseContent();
}
/**
* Returns content of the last response
* Use it in Helpers when you want to retrieve response of request performed by another module.
*
* ```php
* <?php
* // in Helper class
* public function seeResponseContains($text)
* {
* $this->assertContains($text, $this->getModule('{{MODULE_NAME}}')->_getResponseContent(), "response contains");
* }
* ?>
* ```
*
* @api
* @return string
* @throws ModuleException
Arguments
"PUT"
"/api/karyawaf/karyawans/1"
array:6 [
"nama" => "Gregorio"
"posisi" => "Gaming Dealer"
"tempat_lahir" => "Hazelville"
"tanggal_lahir" => Carbon @417291656 {#4993
date: 1983-03-23 18:20:56.0 UTC (+00:00)
}
"rekrut" => "2013-11-05 02:11:05"
"status" => "1"
]
[]
array:2 [
"REQUEST_TIME" => 1532744935
"REQUEST_TIME_FLOAT" => 1532744935.4527
]
"nama=Gregorio&posisi=Gaming+Dealer&tempat_lahir=Hazelville&tanggal_lahir%5Bdate%5D=1983-03-23+18%3A20%3A56.000000&tanggal_lahir%5Btimezone_type%5D=3&tanggal_lahir%5Btimezone%5D=UTC&rekrut=2013-11-05+02%3A11%3A05&status=1"
true
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Module
/REST.php
$parameters = $this->encodeApplicationJson($method, $parameters);
if (is_array($parameters) || $method === 'GET') {
if (!empty($parameters) && $method === 'GET') {
if (strpos($url, '?') !== false) {
$url .= '&';
} else {
$url .= '?';
}
$url .= http_build_query($parameters);
}
if ($method == 'GET') {
$this->debugSection("Request", "$method $url");
$files = [];
} else {
$this->debugSection("Request", "$method $url " . json_encode($parameters));
$files = $this->formatFilesArray($files);
}
$this->response = (string)$this->connectionModule->_request($method, $url, $parameters, $files);
} else {
$requestData = $parameters;
if ($this->isBinaryData($requestData)) {
$requestData = $this->binaryToDebugString($requestData);
}
$this->debugSection("Request", "$method $url " . $requestData);
$this->response = (string)$this->connectionModule->_request($method, $url, [], $files, [], $parameters);
}
$printedResponse = $this->response;
if ($this->isBinaryData($printedResponse)) {
$printedResponse = $this->binaryToDebugString($printedResponse);
}
$this->debugSection("Response", $printedResponse);
}
/**
* Check if data has non-printable bytes and it is not a valid unicode string
*
* @param string $data the text or binary data string
* @return boolean
Arguments
"PUT"
"/api/karyawaf/karyawans/1"
array:6 [
"nama" => "Gregorio"
"posisi" => "Gaming Dealer"
"tempat_lahir" => "Hazelville"
"tanggal_lahir" => Carbon @417291656 {#4993
date: 1983-03-23 18:20:56.0 UTC (+00:00)
}
"rekrut" => "2013-11-05 02:11:05"
"status" => "1"
]
[]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Module
/REST.php
* @part json
* @part xml
*/
public function sendGET($url, $params = [])
{
$this->execute('GET', $url, $params);
}
/**
* Sends PUT request to given uri.
*
* @param $url
* @param array $params
* @param array $files
* @part json
* @part xml
*/
public function sendPUT($url, $params = [], $files = [])
{
$this->execute('PUT', $url, $params, $files);
}
/**
* Sends PATCH request to given uri.
*
* @param $url
* @param array $params
* @param array $files
* @part json
* @part xml
*/
public function sendPATCH($url, $params = [], $files = [])
{
$this->execute('PATCH', $url, $params, $files);
}
/**
* Sends DELETE request to given uri.
*
* @param $url
Arguments
"PUT"
"/api/karyawaf/karyawans/1"
array:6 [
"nama" => "Gregorio"
"posisi" => "Gaming Dealer"
"tempat_lahir" => "Hazelville"
"tanggal_lahir" => Carbon @417291656 {#4993
date: 1983-03-23 18:20:56.0 UTC (+00:00)
}
"rekrut" => "2013-11-05 02:11:05"
"status" => "1"
]
[]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Step.php
$text = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1 \\2', $text);
$text = preg_replace('/([a-z\d])([A-Z])/', '\\1 \\2', $text);
$text = preg_replace('~\bdont\b~', 'don\'t', $text);
return mb_strtolower($text, 'UTF-8');
}
public function run(ModuleContainer $container = null)
{
$this->executed = true;
if (!$container) {
return null;
}
$activeModule = $container->moduleForAction($this->action);
if (!is_callable([$activeModule, $this->action])) {
throw new \RuntimeException("Action '{$this->action}' can't be called");
}
try {
$res = call_user_func_array([$activeModule, $this->action], $this->arguments);
} catch (\Exception $e) {
$this->failed = true;
if ($this->getMetaStep()) {
$this->getMetaStep()->setFailed(true);
}
throw $e;
}
return $res;
}
/**
* If steps are combined into one method they can be reproduced as meta-step.
* We are using stack trace to analyze if steps were called from test, if not - they were called from meta-step.
*
* @param $step
* @param $stack
*/
protected function addMetaStep($step, $stack)
{
if (($this->isTestFile($this->file)) || ($step['class'] == 'Codeception\Scenario')) {
Arguments
"/api/karyawaf/karyawans/1"
array:6 [
"nama" => "Gregorio"
"posisi" => "Gaming Dealer"
"tempat_lahir" => "Hazelville"
"tanggal_lahir" => Carbon @417291656 {#4993
date: 1983-03-23 18:20:56.0 UTC (+00:00)
}
"rekrut" => "2013-11-05 02:11:05"
"status" => "1"
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Step.php
$text = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1 \\2', $text);
$text = preg_replace('/([a-z\d])([A-Z])/', '\\1 \\2', $text);
$text = preg_replace('~\bdont\b~', 'don\'t', $text);
return mb_strtolower($text, 'UTF-8');
}
public function run(ModuleContainer $container = null)
{
$this->executed = true;
if (!$container) {
return null;
}
$activeModule = $container->moduleForAction($this->action);
if (!is_callable([$activeModule, $this->action])) {
throw new \RuntimeException("Action '{$this->action}' can't be called");
}
try {
$res = call_user_func_array([$activeModule, $this->action], $this->arguments);
} catch (\Exception $e) {
$this->failed = true;
if ($this->getMetaStep()) {
$this->getMetaStep()->setFailed(true);
}
throw $e;
}
return $res;
}
/**
* If steps are combined into one method they can be reproduced as meta-step.
* We are using stack trace to analyze if steps were called from test, if not - they were called from meta-step.
*
* @param $step
* @param $stack
*/
protected function addMetaStep($step, $stack)
{
if (($this->isTestFile($this->file)) || ($step['class'] == 'Codeception\Scenario')) {
Arguments
array:2 [
0 => REST {#351}
1 => "sendPUT"
]
array:2 [
0 => "/api/karyawaf/karyawans/1"
1 => array:6 [
"nama" => "Gregorio"
"posisi" => "Gaming Dealer"
"tempat_lahir" => "Hazelville"
"tanggal_lahir" => Carbon @417291656 {#4993
date: 1983-03-23 18:20:56.0 UTC (+00:00)
}
"rekrut" => "2013-11-05 02:11:05"
"status" => "1"
]
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Scenario.php
{
return $this->metadata->getGroups();
}
public function current($key)
{
return $this->metadata->getCurrent($key);
}
public function runStep(Step $step)
{
$step->saveTrace();
if ($this->metaStep instanceof Step\Meta) {
$step->setMetaStep($this->metaStep);
}
$this->steps[] = $step;
$result = null;
$this->metadata->getService('dispatcher')->dispatch(Events::STEP_BEFORE, new StepEvent($this->test, $step));
try {
$result = $step->run($this->metadata->getService('modules'));
} catch (ConditionalAssertionFailed $f) {
$result = $this->test->getTestResultObject();
if (is_null($result)) {
$this->metadata->getService('dispatcher')->dispatch(Events::STEP_AFTER, new StepEvent($this->test, $step));
throw $f;
} else {
$result->addFailure(clone($this->test), $f, $result->time());
}
} catch (\Exception $e) {
$this->metadata->getService('dispatcher')->dispatch(Events::STEP_AFTER, new StepEvent($this->test, $step));
throw $e;
}
$this->metadata->getService('dispatcher')->dispatch(Events::STEP_AFTER, new StepEvent($this->test, $step));
$step->executed = true;
return $result;
}
public function addStep(Step $step)
{
$this->steps[] = $step;
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/Modules
/Karyawaf
/Tests
/_support
/_generated
/FunctionalTesterActions.php
*/
public function sendGET($url, $params = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendGET', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Sends PUT request to given uri.
*
* @param $url
* @param array $params
* @param array $files
* @part json
* @part xml
* @see \Codeception\Module\REST::sendPUT()
*/
public function sendPUT($url, $params = null, $files = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPUT', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Sends PATCH request to given uri.
*
* @param $url
* @param array $params
* @param array $files
* @part json
* @part xml
* @see \Codeception\Module\REST::sendPATCH()
*/
public function sendPATCH($url, $params = null, $files = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPATCH', func_get_args()));
}
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/Modules
/Karyawaf
/Tests
/functional
/ApiKaryawansCest.php
$I->seeResponseContainsJson([
'data' => [
'nama' => $karyawan['nama']
]
]);
}
public function updateData(FunctionalTester $I)
{
Auth::user()->can('update-karyawan');
$karyawan = Karyawan::find(1);
$I->sendPUT($this->endpoint . '/' . $karyawan->id, [
'nama' => 'Gregorio',
'posisi' => $karyawan->posisi,
'tempat_lahir' => $karyawan->tempat_lahir,
'tanggal_lahir' => $karyawan->tanggal_lahir,
'rekrut' => $karyawan->rekrut,
'status' => $karyawan->status
]);
$I->seeResponseContainsJson([
'data' => [
'nama' => 'Gregorio'
]
]);
}
public function deleteData(FunctionalTester $I)
{
$karyawan = Karyawan::find(1);
$I->sendDELETE($this->endpoint . '/' . $karyawan->id);
$I->seeResponseCodeIsSuccessful();
$I->seeResponseContains('deleted');
}
}
Arguments
"/api/karyawaf/karyawans/1"
array:6 [
"nama" => "Gregorio"
"posisi" => "Gaming Dealer"
"tempat_lahir" => "Hazelville"
"tanggal_lahir" => Carbon @417291656 {#4993
date: 1983-03-23 18:20:56.0 UTC (+00:00)
}
"rekrut" => "2013-11-05 02:11:05"
"status" => "1"
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Lib
/Di.php
return;
}
$reflectedMethod = $reflectedObject->getMethod($injectMethodName);
try {
$args = $this->prepareArgs($reflectedMethod, $defaults);
} catch (\Exception $e) {
$msg = $e->getMessage();
if ($e->getPrevious()) { // injection failed because PHP code is invalid. See #3869
$msg .= '; '. $e->getPrevious();
}
throw new InjectionException(
"Failed to inject dependencies in instance of '{$reflectedObject->name}'. $msg"
);
}
if (!$reflectedMethod->isPublic()) {
$reflectedMethod->setAccessible(true);
}
$reflectedMethod->invokeArgs($object, $args);
}
/**
* @param \ReflectionMethod $method
* @param $defaults
* @throws InjectionException
* @return array
*/
protected function prepareArgs(\ReflectionMethod $method, $defaults = [])
{
$args = [];
$parameters = $method->getParameters();
foreach ($parameters as $k => $parameter) {
$dependency = $parameter->getClass();
if (is_null($dependency)) {
if (!$parameter->isOptional()) {
if (!isset($defaults[$k])) {
throw new InjectionException("Parameter '$parameter->name' must have default value.");
}
$args[] = $defaults[$k];
Arguments
ApiKaryawansCest {#322}
array:1 [
0 => FunctionalTester {#2992}
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Test
/Cest.php
protected function executeContextMethod($context, $I)
{
if (method_exists($this->testClassInstance, $context)) {
$this->executeBeforeMethods($context, $I);
$this->invoke($context, [$I, $this->scenario]);
$this->executeAfterMethods($context, $I);
return;
}
throw new \LogicException(
"Method $context defined in annotation but does not exist in " . get_class($this->testClassInstance)
);
}
protected function invoke($methodName, array $context)
{
foreach ($context as $class) {
$this->getMetadata()->getService('di')->set($class);
}
$this->getMetadata()->getService('di')->injectDependencies($this->testClassInstance, $methodName, $context);
}
protected function executeTestMethod($I)
{
if (!method_exists($this->testClassInstance, $this->testMethod)) {
throw new \Exception("Method {$this->testMethod} can't be found in tested class");
}
if ($this->getMetadata()->getCurrent('example')) {
$this->invoke($this->testMethod, [$I, $this->scenario, new Example($this->getMetadata()->getCurrent('example'))]);
return;
}
$this->invoke($this->testMethod, [$I, $this->scenario]);
}
public function toString()
{
return sprintf('%s: %s', ReflectionHelper::getClassShortName($this->getTestClass()), Message::ucfirst($this->getFeature()));
}
public function getSignature()
Arguments
ApiKaryawansCest {#322}
"updateData"
array:2 [
0 => FunctionalTester {#2992}
1 => Scenario {#338}
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Test
/Cest.php
}
protected function invoke($methodName, array $context)
{
foreach ($context as $class) {
$this->getMetadata()->getService('di')->set($class);
}
$this->getMetadata()->getService('di')->injectDependencies($this->testClassInstance, $methodName, $context);
}
protected function executeTestMethod($I)
{
if (!method_exists($this->testClassInstance, $this->testMethod)) {
throw new \Exception("Method {$this->testMethod} can't be found in tested class");
}
if ($this->getMetadata()->getCurrent('example')) {
$this->invoke($this->testMethod, [$I, $this->scenario, new Example($this->getMetadata()->getCurrent('example'))]);
return;
}
$this->invoke($this->testMethod, [$I, $this->scenario]);
}
public function toString()
{
return sprintf('%s: %s', ReflectionHelper::getClassShortName($this->getTestClass()), Message::ucfirst($this->getFeature()));
}
public function getSignature()
{
return get_class($this->getTestClass()) . ":" . $this->getTestMethod();
}
public function getTestClass()
{
return $this->testClassInstance;
}
public function getTestMethod()
{
return $this->testMethod;
Arguments
"updateData"
array:2 [
0 => FunctionalTester {#2992}
1 => Scenario {#338}
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Test
/Cest.php
return implode("", array_slice($source, $start_line, $end_line - $start_line));
}
public function getSpecFromMethod()
{
$text = $this->testMethod;
$text = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1 \\2', $text);
$text = preg_replace('/([a-z\d])([A-Z])/', '\\1 \\2', $text);
$text = strtolower($text);
return $text;
}
public function test()
{
$actorClass = $this->getMetadata()->getCurrent('actor');
$I = new $actorClass($this->getScenario());
try {
$this->executeHook($I, 'before');
$this->executeBeforeMethods($this->testMethod, $I);
$this->executeTestMethod($I);
$this->executeAfterMethods($this->testMethod, $I);
$this->executeHook($I, 'passed');
} catch (\Exception $e) {
$this->executeHook($I, 'failed');
// fails and errors are now handled by Codeception\PHPUnit\Listener
throw $e;
} finally {
$this->executeHook($I, 'after');
}
}
protected function executeHook($I, $hook)
{
if (is_callable([$this->testClassInstance, "_$hook"])) {
$this->invoke("_$hook", [$I, $this->scenario]);
}
}
protected function executeBeforeMethods($testMethod, $I)
{
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Test
/Test.php
$status = self::STATUS_PENDING;
$time = 0;
$e = null;
$result->startTest($this);
foreach ($this->hooks as $hook) {
if (method_exists($this, $hook.'Start')) {
$this->{$hook.'Start'}();
}
}
$failedToStart = ReflectionHelper::readPrivateProperty($result, 'lastTestFailed');
if (!$this->ignored && !$failedToStart) {
Timer::start();
try {
$this->test();
$status = self::STATUS_OK;
} catch (\PHPUnit\Framework\AssertionFailedError $e) {
$status = self::STATUS_FAIL;
} catch (\PHPUnit\Framework\Exception $e) {
$status = self::STATUS_ERROR;
} catch (\Throwable $e) {
$e = new \PHPUnit\Framework\ExceptionWrapper($e);
$status = self::STATUS_ERROR;
} catch (\Exception $e) {
$e = new \PHPUnit\Framework\ExceptionWrapper($e);
$status = self::STATUS_ERROR;
}
$time = Timer::stop();
}
foreach (array_reverse($this->hooks) as $hook) {
if (method_exists($this, $hook.'End')) {
$this->{$hook.'End'}($status, $time, $e);
}
}
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/phpunit
/phpunit
/src
/Framework
/TestSuite.php
$this->tearDown();
$result->endTestSuite($this);
return $result;
}
foreach ($this as $test) {
if ($result->shouldStop()) {
break;
}
if ($test instanceof TestCase || $test instanceof self) {
$test->setBeStrictAboutChangesToGlobalState($this->beStrictAboutChangesToGlobalState);
$test->setBackupGlobals($this->backupGlobals);
$test->setBackupStaticAttributes($this->backupStaticAttributes);
$test->setRunTestInSeparateProcess($this->runTestInSeparateProcess);
}
$test->run($result);
}
foreach ($hookMethods['afterClass'] as $afterClassMethod) {
if ($this->testCase === true && \class_exists($this->name, false) && \method_exists($this->name, $afterClassMethod)) {
\call_user_func([$this->name, $afterClassMethod]);
}
}
$this->tearDown();
$result->endTestSuite($this);
return $result;
}
/**
* @param bool $runTestInSeparateProcess
*
* @throws Exception
*/
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/phpunit-wrapper
/src
/Runner.php
$result->beStrictAboutOutputDuringTests((bool)$arguments['disallow_test_output']);
}
if (empty(self::$persistentListeners)) {
$this->applyReporters($result, $arguments);
}
if (class_exists('\Symfony\Bridge\PhpUnit\SymfonyTestsListener')) {
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : [];
$arguments['listeners'][] = new \Symfony\Bridge\PhpUnit\SymfonyTestsListener();
}
$arguments['listeners'][] = $this->printer;
// clean up listeners between suites
foreach ($arguments['listeners'] as $listener) {
$result->addListener($listener);
}
$suite->run($result);
unset($suite);
foreach ($arguments['listeners'] as $listener) {
$result->removeListener($listener);
}
return $result;
}
/**
* @param \PHPUnit\Framework\TestResult $result
* @param array $arguments
*
* @return array
*/
protected function applyReporters(\PHPUnit\Framework\TestResult $result, array $arguments)
{
foreach ($this->defaultListeners as $listener => $value) {
if (!isset($arguments[$listener])) {
$arguments[$listener] = $value;
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/SuiteManager.php
$name = $this->settings['namespace'] . ".$name";
}
$suite->setName($name);
if (isset($this->settings['backup_globals'])) {
$suite->setBackupGlobals((bool) $this->settings['backup_globals']);
}
if (isset($this->settings['be_strict_about_changes_to_global_state']) && method_exists($suite, 'setbeStrictAboutChangesToGlobalState')) {
$suite->setbeStrictAboutChangesToGlobalState((bool)$this->settings['be_strict_about_changes_to_global_state']);
}
$suite->setModules($this->moduleContainer->all());
return $suite;
}
public function run(PHPUnit\Runner $runner, \PHPUnit\Framework\TestResult $result, $options)
{
$runner->prepareSuite($this->suite, $options);
$this->dispatcher->dispatch(Events::SUITE_BEFORE, new Event\SuiteEvent($this->suite, $result, $this->settings));
$runner->doEnhancedRun($this->suite, $result, $options);
$this->dispatcher->dispatch(Events::SUITE_AFTER, new Event\SuiteEvent($this->suite, $result, $this->settings));
}
/**
* @return \Codeception\Suite
*/
public function getSuite()
{
return $this->suite;
}
/**
* @return ModuleContainer
*/
public function getModuleContainer()
{
return $this->moduleContainer;
}
protected function getActor()
Arguments
Suite {#295}
TestResult {#170}
array:72 [
"silent" => false
"debug" => false
"steps" => false
"html" => false
"xml" => false
"json" => false
"tap" => false
"report" => false
"colors" => true
"coverage" => false
"coverage-xml" => false
"coverage-html" => false
"coverage-text" => false
"coverage-crap4j" => false
"coverage-phpunit" => false
"groups" => []
"excludeGroups" => []
"filter" => false
"env" => null
"fail-fast" => false
"ansi" => true
"verbosity" => 32
"interactive" => true
"no-rebuild" => false
"quiet" => false
"bootstrap" => false
"strict_xml" => false
"lint" => true
"backup_globals" => true
"log_incomplete_skipped" => false
"report_useless_tests" => false
"disallow_test_output" => false
"be_strict_about_changes_to_global_state" => false
"listeners" => array:1 [
0 => UI {#221}
]
"addUncoveredFilesFromWhitelist" => true
"backupGlobals" => null
"backupStaticAttributes" => null
"beStrictAboutChangesToGlobalState" => null
"beStrictAboutResourceUsageDuringSmallTests" => false
"cacheTokens" => false
"columns" => 80
"convertDeprecationsToExceptions" => true
"convertErrorsToExceptions" => true
"convertNoticesToExceptions" => true
"convertWarningsToExceptions" => true
"crap4jThreshold" => 30
"disallowTestOutput" => false
"disallowTodoAnnotatedTests" => false
"enforceTimeLimit" => false
"failOnRisky" => false
"failOnWarning" => false
"processIsolation" => false
"processUncoveredFilesFromWhitelist" => false
"registerMockObjectsFromTestArgumentsRecursively" => false
"repeat" => false
"reportHighLowerBound" => 90
"reportLowUpperBound" => 50
"reportUselessTests" => true
"reverseList" => false
"stopOnError" => false
"stopOnFailure" => false
"stopOnIncomplete" => false
"stopOnRisky" => false
"stopOnSkipped" => false
"stopOnWarning" => false
"strictCoverage" => false
"testdoxExcludeGroups" => []
"testdoxGroups" => []
"timeoutForLargeTests" => 60
"timeoutForMediumTests" => 10
"timeoutForSmallTests" => 1
"verbose" => false
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Codecept.php
$config['current_environment'] = implode(',', $currentEnvironment);
}
}
if (empty($config)) {
continue;
}
$suiteToRun = $suite;
if (!empty($envList)) {
$suiteToRun .= ' (' . implode(', ', $envArray) . ')';
}
$this->runSuite($config, $suiteToRun, $test);
}
}
public function runSuite($settings, $suite, $test = null)
{
$suiteManager = new SuiteManager($this->dispatcher, $suite, $settings);
$suiteManager->initialize();
$suiteManager->loadTests($test);
$suiteManager->run($this->runner, $this->result, $this->options);
return $this->result;
}
public static function versionString()
{
return 'Codeception PHP Testing Framework v' . self::VERSION;
}
public function printResult()
{
$result = $this->getResult();
$result->flushListeners();
$printer = $this->runner->getPrinter();
$printer->printResult($result);
$this->dispatcher->dispatch(Events::RESULT_PRINT_AFTER, new Event\PrintResultEvent($result, $printer));
}
/**
Arguments
Runner {#222}
TestResult {#170}
array:72 [
"silent" => false
"debug" => false
"steps" => false
"html" => false
"xml" => false
"json" => false
"tap" => false
"report" => false
"colors" => true
"coverage" => false
"coverage-xml" => false
"coverage-html" => false
"coverage-text" => false
"coverage-crap4j" => false
"coverage-phpunit" => false
"groups" => []
"excludeGroups" => []
"filter" => false
"env" => null
"fail-fast" => false
"ansi" => true
"verbosity" => 32
"interactive" => true
"no-rebuild" => false
"quiet" => false
"bootstrap" => false
"strict_xml" => false
"lint" => true
"backup_globals" => true
"log_incomplete_skipped" => false
"report_useless_tests" => false
"disallow_test_output" => false
"be_strict_about_changes_to_global_state" => false
"listeners" => []
"addUncoveredFilesFromWhitelist" => true
"backupGlobals" => null
"backupStaticAttributes" => null
"beStrictAboutChangesToGlobalState" => null
"beStrictAboutResourceUsageDuringSmallTests" => false
"cacheTokens" => false
"columns" => 80
"convertDeprecationsToExceptions" => true
"convertErrorsToExceptions" => true
"convertNoticesToExceptions" => true
"convertWarningsToExceptions" => true
"crap4jThreshold" => 30
"disallowTestOutput" => false
"disallowTodoAnnotatedTests" => false
"enforceTimeLimit" => false
"failOnRisky" => false
"failOnWarning" => false
"processIsolation" => false
"processUncoveredFilesFromWhitelist" => false
"registerMockObjectsFromTestArgumentsRecursively" => false
"repeat" => false
"reportHighLowerBound" => 90
"reportLowUpperBound" => 50
"reportUselessTests" => true
"reverseList" => false
"stopOnError" => false
"stopOnFailure" => false
"stopOnIncomplete" => false
"stopOnRisky" => false
"stopOnSkipped" => false
"stopOnWarning" => false
"strictCoverage" => false
"testdoxExcludeGroups" => []
"testdoxGroups" => []
"timeoutForLargeTests" => 60
"timeoutForMediumTests" => 10
"timeoutForSmallTests" => 1
"verbose" => false
]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Codecept.php
$this->dispatcher->addSubscriber($this->extensionLoader);
$this->extensionLoader->registerGlobalExtensions();
}
public function run($suite, $test = null, array $config = null)
{
ini_set(
'memory_limit',
isset($this->config['settings']['memory_limit']) ? $this->config['settings']['memory_limit'] : '1024M'
);
$config = $config ?: Configuration::config();
$settings = Configuration::suiteSettings($suite, $config);
$selectedEnvironments = $this->options['env'];
$environments = Configuration::suiteEnvironments($suite);
if (!$selectedEnvironments or empty($environments)) {
$this->runSuite($settings, $suite, $test);
return;
}
foreach (array_unique($selectedEnvironments) as $envList) {
$envArray = explode(',', $envList);
$config = [];
foreach ($envArray as $env) {
if (isset($environments[$env])) {
$currentEnvironment = isset($config['current_environment']) ? [$config['current_environment']] : [];
$config = Configuration::mergeConfigs($config, $environments[$env]);
$currentEnvironment[] = $config['current_environment'];
$config['current_environment'] = implode(',', $currentEnvironment);
}
}
if (empty($config)) {
continue;
}
$suiteToRun = $suite;
if (!empty($envList)) {
$suiteToRun .= ' (' . implode(', ', $envArray) . ')';
Arguments
array:22 [
"actor" => "FunctionalTester"
"modules" => array:3 [
"enabled" => array:3 [
0 => array:1 [
"Laravel5" => array:3 [
"environment_file" => ".env.testing"
"packages" => "Modules/Karyawaf"
"cleanup" => true
]
]
1 => array:1 [
"REST" => array:1 [
"depends" => "Laravel5"
]
]
2 => "\Helper\Functional"
]
"config" => []
"depends" => []
]
"colors" => true
"bootstrap" => false
"strict_xml" => false
"lint" => true
"backup_globals" => true
"log_incomplete_skipped" => false
"report_useless_tests" => false
"disallow_test_output" => false
"be_strict_about_changes_to_global_state" => false
"coverage" => []
"namespace" => ""
"groups" => array:1 [
"failed" => "Tests/_output/failed"
]
"gherkin" => []
"extensions" => array:3 [
"enabled" => array:1 [
0 => "Codeception\Extension\RunFailed"
]
"config" => []
"commands" => []
]
"class_name" => null
"path" => "/home/gregorio/Documents/codes/laraland/Modules/Karyawaf/Tests/functional/"
"extends" => null
"formats" => []
"shuffle" => false
"error_level" => "E_ALL & ~E_STRICT & ~E_DEPRECATED"
]
"functional"
null
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Command
/Run.php
throw new \RuntimeException(
"Can't include into runner suite without a namespace;\n"
. "Please add `namespace` section into included codeception.yml file"
);
}
return $config['namespace'];
}
protected function runSuites($suites, $skippedSuites = [])
{
$executed = 0;
foreach ($suites as $suite) {
if (in_array($suite, $skippedSuites)) {
continue;
}
if (!in_array($suite, Configuration::suites())) {
continue;
}
$this->codecept->run($suite);
$executed++;
}
return $executed;
}
protected function matchTestFromFilename($filename, $testsPath)
{
$testsPath = str_replace(['//', '\/', '\\'], '/', $testsPath);
$filename = str_replace(['//', '\/', '\\'], '/', $filename);
$res = preg_match("~^$testsPath/(.*?)(?>/(.*))?$~", $filename, $matches);
if (!$res) {
throw new \InvalidArgumentException("Test file can't be matched");
}
if (!isset($matches[2])) {
$matches[2] = null;
}
return $matches;
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Command
/Run.php
list(, $suite, $test) = $result;
}
}
}
if ($test) {
$filter = $this->matchFilteredTestName($test);
$userOptions['filter'] = $filter;
}
$this->codecept = new Codecept($userOptions);
if ($suite and $test) {
$this->codecept->run($suite, $test, $config);
}
// Run all tests of given suite or all suites
if (!$test) {
$suites = $suite ? explode(',', $suite) : Configuration::suites();
$this->executed = $this->runSuites($suites, $this->options['skip']);
if (!empty($config['include']) and !$suite) {
$current_dir = Configuration::projectDir();
$suites += $config['include'];
$this->runIncludedSuites($config['include'], $current_dir);
}
if ($this->executed === 0) {
throw new \RuntimeException(
sprintf("Suite '%s' could not be found", implode(', ', $suites))
);
}
}
$this->codecept->printResult();
if (!$input->getOption('no-exit')) {
if (!$this->codecept->getResult()->wasSuccessful()) {
exit(1);
}
Arguments
array:1 [
0 => "functional"
]
[]
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/symfony
/console
/Command
/Command.php
}
}
if ($input->isInteractive()) {
$this->interact($input, $output);
}
// The command name argument is often omitted when a command is executed directly with its run() method.
// It would fail the validation if we didn't make sure the command argument is present,
// since it's required by the application.
if ($input->hasArgument('command') && null === $input->getArgument('command')) {
$input->setArgument('command', $this->getName());
}
$input->validate();
if ($this->code) {
$statusCode = call_user_func($this->code, $input, $output);
} else {
$statusCode = $this->execute($input, $output);
}
return is_numeric($statusCode) ? (int) $statusCode : 0;
}
/**
* Sets the code to execute when running this command.
*
* If this method is used, it overrides the code defined
* in the execute() method.
*
* @param callable $code A callable(InputInterface $input, OutputInterface $output)
*
* @return $this
*
* @throws InvalidArgumentException
*
* @see execute()
*/
public function setCode(callable $code)
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/symfony
/console
/Application.php
}
/**
* Runs the current command.
*
* If an event dispatcher has been attached to the application,
* events are also dispatched during the life-cycle of the command.
*
* @return int 0 if everything went fine, or an error code
*/
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
{
foreach ($command->getHelperSet() as $helper) {
if ($helper instanceof InputAwareInterface) {
$helper->setInput($input);
}
}
if (null === $this->dispatcher) {
return $command->run($input, $output);
}
// bind before the console.command event, so the listeners have access to input options/arguments
try {
$command->mergeApplicationDefinition();
$input->bind($command->getDefinition());
} catch (ExceptionInterface $e) {
// ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition
}
$event = new ConsoleCommandEvent($command, $input, $output);
$e = null;
try {
$this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event);
if ($event->commandShouldRun()) {
$exitCode = $command->run($input, $output);
} else {
$exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/symfony
/console
/Application.php
$command = $this->find($name);
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
if (null !== $e) {
if (null !== $this->dispatcher) {
$event = new ConsoleErrorEvent($input, $output, $e);
$this->dispatcher->dispatch(ConsoleEvents::ERROR, $event);
$e = $event->getError();
if (0 === $event->getExitCode()) {
return 0;
}
}
throw $e;
}
$this->runningCommand = $command;
$exitCode = $this->doRunCommand($command, $input, $output);
$this->runningCommand = null;
return $exitCode;
}
public function setHelperSet(HelperSet $helperSet)
{
$this->helperSet = $helperSet;
}
/**
* Get the helper set associated with the command.
*
* @return HelperSet The HelperSet instance associated with this command
*/
public function getHelperSet()
{
if (!$this->helperSet) {
$this->helperSet = $this->getDefaultHelperSet();
}
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/symfony
/console
/Application.php
$this->renderException($e, $output);
}
};
if ($phpHandler = set_exception_handler($renderException)) {
restore_exception_handler();
if (!is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) {
$debugHandler = true;
} elseif ($debugHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
$phpHandler[0]->setExceptionHandler($debugHandler);
}
}
if (null !== $this->dispatcher && $this->dispatcher->hasListeners(ConsoleEvents::EXCEPTION)) {
@trigger_error(sprintf('The "ConsoleEvents::EXCEPTION" event is deprecated since Symfony 3.3 and will be removed in 4.0. Listen to the "ConsoleEvents::ERROR" event instead.'), E_USER_DEPRECATED);
}
$this->configureIO($input, $output);
try {
$exitCode = $this->doRun($input, $output);
} catch (\Exception $e) {
if (!$this->catchExceptions) {
throw $e;
}
$renderException($e);
$exitCode = $e->getCode();
if (is_numeric($exitCode)) {
$exitCode = (int) $exitCode;
if (0 === $exitCode) {
$exitCode = 1;
}
} else {
$exitCode = 1;
}
} finally {
// if the exception handler changed, keep it
// otherwise, unregister $renderException
if (!$phpHandler) {
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/src
/Codeception
/Application.php
return $commandClass::getCommandName();
}
/**
* To cache Class ArgvInput
*
* @inheritDoc
*/
public function run(InputInterface $input = null, OutputInterface $output = null)
{
if ($input === null) {
$input = $this->getCoreArguments();
}
if (!ini_get('register_argc_argv') && empty($_SERVER['argv'])) {
//register_argc_argv is always off on HHVM, but it has no effect
throw new ConfigurationException('register_argc_argv must be set to On for running Codeception');
}
return parent::run($input, $output);
}
/**
* Add global a --config option.
*
* @return InputDefinition
*/
protected function getDefaultInputDefinition()
{
$inputDefinition = parent::getDefaultInputDefinition();
$inputDefinition->addOption(
new InputOption('config', 'c', InputOption::VALUE_OPTIONAL, 'Use custom path for config')
);
return $inputDefinition;
}
/**
* Search for --config Option and if found will be loaded
*
* example:
Arguments
/home
/gregorio
/Documents
/codes
/laraland
/vendor
/codeception
/codeception
/codecept
$app->add(new Codeception\Command\Clean('clean'));
$app->add(new Codeception\Command\GenerateGroup('generate:groupobject'));
$app->add(new Codeception\Command\GeneratePageObject('generate:pageobject'));
$app->add(new Codeception\Command\GenerateStepObject('generate:stepobject'));
$app->add(new Codeception\Command\GenerateEnvironment('generate:environment'));
$app->add(new Codeception\Command\GenerateFeature('generate:feature'));
$app->add(new Codeception\Command\GherkinSnippets('gherkin:snippets'));
$app->add(new Codeception\Command\GherkinSteps('gherkin:steps'));
$app->add(new Codeception\Command\DryRun('dry-run'));
$app->add(new Codeception\Command\ConfigValidate('config:validate'));
// Suggests package
if (class_exists('Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand')) {
$app->add(new Codeception\Command\Completion());
} else {
$app->add(new Codeception\Command\CompletionFallback());
}
$app->registerCustomCommands();
$app->run();