Full Code of jkocik/laravel-profiler for AI

master cda42631f802 cached
174 files
292.3 KB
75.3k tokens
752 symbols
1 requests
Download .txt
Showing preview only (332K chars total). Download the full file or copy to clipboard to get everything.
Repository: jkocik/laravel-profiler
Branch: master
Commit: cda42631f802
Files: 174
Total size: 292.3 KB

Directory structure:
gitextract_22nd0g50/

├── .docker/
│   ├── etc/
│   │   └── php/
│   │       ├── entrypoint.sh
│   │       ├── php-v1.ini
│   │       └── php-v2.ini
│   └── images/
│       └── php/
│           ├── .bashrc-v1
│           ├── .bashrc-v2
│           ├── Dockerfile-v1
│           └── Dockerfile-v2
├── .gitignore
├── .travis.yml
├── LICENSE.md
├── README.md
├── composer.json
├── config/
│   └── profiler.php
├── docker-compose.yml
├── phpunit-laravel-52.xml
├── phpunit-laravel-53.xml
├── phpunit-laravel-54.xml
├── phpunit-laravel-55.xml
├── phpunit-laravel-56.xml
├── phpunit-laravel-57.xml
├── phpunit-laravel-58.xml
├── phpunit-laravel-6.xml
├── phpunit-laravel-7.xml
├── phpunit-laravel-8.xml
├── src/
│   ├── BaseProfiler.php
│   ├── Console/
│   │   ├── ClientCommand.php
│   │   ├── ServerCommand.php
│   │   └── StatusCommand.php
│   ├── Contracts/
│   │   ├── DataProcessor.php
│   │   ├── DataTracker.php
│   │   ├── ExecutionContent.php
│   │   ├── ExecutionData.php
│   │   ├── ExecutionRequest.php
│   │   ├── ExecutionResponse.php
│   │   ├── ExecutionRoute.php
│   │   ├── ExecutionServer.php
│   │   ├── ExecutionSession.php
│   │   ├── ExecutionWatcher.php
│   │   ├── LaravelListener.php
│   │   ├── Memory.php
│   │   ├── Processor.php
│   │   ├── Profiler.php
│   │   ├── Timer.php
│   │   └── Tracker.php
│   ├── DisabledProfiler.php
│   ├── Events/
│   │   ├── ExceptionHandling.php
│   │   ├── ProfilerBound.php
│   │   ├── ProfilerServerConnectionFailed.php
│   │   ├── ProfilerServerConnectionSuccessful.php
│   │   ├── ResetTrackers.php
│   │   ├── Terminating.php
│   │   └── Tracking.php
│   ├── LaravelDataProcessor.php
│   ├── LaravelDataTracker.php
│   ├── LaravelExecution/
│   │   ├── ConsoleFinishedRequest.php
│   │   ├── ConsoleFinishedResponse.php
│   │   ├── ConsoleStartingRequest.php
│   │   ├── ConsoleStartingResponse.php
│   │   ├── ExceptionHandlerFromVersion7.php
│   │   ├── ExceptionHandlerTillVersion6.php
│   │   ├── HttpContent.php
│   │   ├── HttpRequest.php
│   │   ├── HttpResponse.php
│   │   ├── HttpRoute.php
│   │   ├── HttpServer.php
│   │   ├── HttpSession.php
│   │   ├── LaravelExecutionData.php
│   │   ├── NullContent.php
│   │   ├── NullRequest.php
│   │   ├── NullResponse.php
│   │   ├── NullRoute.php
│   │   ├── NullServer.php
│   │   └── NullSession.php
│   ├── LaravelExecutionWatcher.php
│   ├── LaravelListeners/
│   │   ├── AuthListener.php
│   │   ├── ConsoleCommandFinishedListener.php
│   │   ├── EventsListener.php
│   │   ├── ExceptionListener.php
│   │   ├── HttpRequestHandledListener.php
│   │   ├── PerformanceListener.php
│   │   ├── QueriesListener.php
│   │   ├── RedisListener.php
│   │   └── ViewsListener.php
│   ├── LaravelProfiler.php
│   ├── Processors/
│   │   ├── BroadcastingProcessor.php
│   │   └── StatusCommandProcessor.php
│   ├── ProfilerResolver.php
│   ├── ServiceProvider.php
│   ├── Services/
│   │   ├── ConfigService.php
│   │   ├── ConsoleService.php
│   │   ├── GeneratorService.php
│   │   ├── LogService.php
│   │   ├── ParamsService.php
│   │   ├── Performance/
│   │   │   ├── MemoryService.php
│   │   │   ├── NullTimerService.php
│   │   │   ├── TimerException.php
│   │   │   └── TimerService.php
│   │   └── helpers.php
│   └── Trackers/
│       ├── ApplicationTracker.php
│       ├── AuthTracker.php
│       ├── BaseTracker.php
│       ├── BindingsTracker.php
│       ├── ConfigTracker.php
│       ├── ContentTracker.php
│       ├── EventsTracker.php
│       ├── ExceptionTracker.php
│       ├── PathsTracker.php
│       ├── PerformanceTracker.php
│       ├── QueriesTracker.php
│       ├── RedisTracker.php
│       ├── RequestTracker.php
│       ├── ResponseTracker.php
│       ├── RouteTracker.php
│       ├── ServerTracker.php
│       ├── ServiceProvidersTracker.php
│       ├── SessionTracker.php
│       └── ViewsTracker.php
└── tests/
    ├── Feature/
    │   ├── CommandsTest.php
    │   ├── LaravelConsoleExecutionTest.php
    │   ├── LaravelExecutionTest.php
    │   ├── LaravelHttpExecutionTest.php
    │   ├── LaravelNullExecutionTest.php
    │   ├── PerformanceTest.php
    │   ├── PerformanceTrackerTest.php
    │   ├── RegisterProfilerTest.php
    │   ├── RunningProfilerTest.php
    │   ├── TrackersResetTest.php
    │   └── TrackersTest.php
    ├── Support/
    │   ├── Fixtures/
    │   │   ├── DummyClassA.php
    │   │   ├── DummyClassB.php
    │   │   ├── DummyCommand.php
    │   │   ├── DummyContractA.php
    │   │   ├── DummyContractB.php
    │   │   ├── DummyController.php
    │   │   ├── DummyEventA.php
    │   │   ├── DummyEventB.php
    │   │   ├── DummyException.php
    │   │   ├── DummyFormRequest.php
    │   │   ├── PerformanceProcessor.php
    │   │   ├── ProcessorA.php
    │   │   ├── ProcessorB.php
    │   │   ├── TrackerA.php
    │   │   ├── TrackerB.php
    │   │   ├── dummy-view-a.blade.php
    │   │   └── dummy-view-b.blade.php
    │   ├── Framework.php
    │   ├── PHPMock.php
    │   └── TestListener.php
    ├── TestCase.php
    ├── Unit/
    │   ├── LaravelExecution/
    │   │   ├── ConsoleFinishedRequestTest.php
    │   │   ├── ConsoleStartingRequestTest.php
    │   │   └── ConsoleStartingResponseTest.php
    │   ├── Services/
    │   │   ├── ConfigServiceTest.php
    │   │   ├── HelpersTest.php
    │   │   ├── ParamsServiceTest.php
    │   │   └── Performance/
    │   │       └── TimerServiceTest.php
    │   └── Trackers/
    │       ├── ApplicationTrackerTest.php
    │       ├── AuthTrackerTest.php
    │       ├── BindingsTrackerTest.php
    │       ├── ConfigTrackerTest.php
    │       ├── ContentTrackerTest.php
    │       ├── EventsTrackerTest.php
    │       ├── ExceptionTrackerTest.php
    │       ├── PathsTrackerTest.php
    │       ├── QueriesTrackerTest.php
    │       ├── RedisTrackerTest.php
    │       ├── RequestTrackerTest.php
    │       ├── ResponseTrackerTest.php
    │       ├── RouteTrackerTest.php
    │       ├── ServerTrackerTest.php
    │       ├── ServiceProvidersTrackerTest.php
    │       ├── SessionTrackerTest.php
    │       └── ViewsTrackerTest.php
    └── bootstrap/
        └── phpunit.php

================================================
FILE CONTENTS
================================================

================================================
FILE: .docker/etc/php/entrypoint.sh
================================================
#!/bin/sh

redis-server --daemonize yes

setfacl -dR -m u:www-data:rwX /var/www/html
setfacl -R -m u:www-data:rwX /var/www/html

docker-php-entrypoint $@


================================================
FILE: .docker/etc/php/php-v1.ini
================================================
memory_limit = 256M
max_execution_time = 600


================================================
FILE: .docker/etc/php/php-v2.ini
================================================
memory_limit = 256M
max_execution_time = 600
xdebug.mode=coverage


================================================
FILE: .docker/images/php/.bashrc-v1
================================================
alias la52='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-52.xml'
alias la53='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-53.xml'
alias la54='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-54.xml'
alias la55='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-55.xml'
alias la56='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-56.xml'
alias la57='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-57.xml'
alias la58='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-58.xml'
alias la6='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-6.xml'
alias la7='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-7.xml'

alias phpunit-all='la7 && la6 && la58 && la57 && la56 && la55 && la54 && la53 && la52'
alias phpunit-c='la7 --coverage-html coverage'


================================================
FILE: .docker/images/php/.bashrc-v2
================================================
alias la6='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-6.xml'
alias la7='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-7.xml'
alias la8='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-8.xml'

alias la-all='la8 && la7 && la6'
alias la-c='la8 --coverage-html coverage'


================================================
FILE: .docker/images/php/Dockerfile-v1
================================================
FROM php:7.3.10-fpm

COPY ./.bashrc-v1 /root/.bashrc

RUN apt-get update > /dev/null && apt-get install -y \
    acl \
    unzip \
    libzip-dev \
    zlib1g-dev \
    libpng-dev \
    libjpeg-dev \
    nodejs \
    redis-server

RUN docker-php-ext-install zip pdo_mysql bcmath gd > /dev/null

RUN pecl install xdebug > /dev/null \
    && docker-php-ext-enable xdebug > /dev/null

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer > /dev/null

RUN rm -rf /var/lib/apt/lists/*


================================================
FILE: .docker/images/php/Dockerfile-v2
================================================
FROM php:8.0.6-fpm

COPY ./.bashrc-v2 /root/.bashrc

RUN apt-get update > /dev/null && apt-get install -y \
    acl \
    unzip \
    libzip-dev \
    zlib1g-dev \
    libpng-dev \
    libjpeg-dev \
    nodejs \
    redis-server

RUN docker-php-ext-install zip pdo_mysql bcmath gd > /dev/null

RUN pecl install xdebug > /dev/null \
    && docker-php-ext-enable xdebug > /dev/null

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer > /dev/null

RUN rm -rf /var/lib/apt/lists/*


================================================
FILE: .gitignore
================================================
/client
/coverage
/frameworks
/vendor
.phpunit.result.cache
composer.lock


================================================
FILE: .travis.yml
================================================
language: php

php:
    - 7.3.24
    - 7.4.0
    - 8.0

services:
    - redis-server

before_script:
    - composer install --no-interaction

script:
    - vendor/bin/phpunit -c phpunit-laravel-6.xml --coverage-clover build/logs/clover.xml
    - vendor/bin/phpunit -c phpunit-laravel-7.xml
    - vendor/bin/phpunit -c phpunit-laravel-8.xml

after_success:
    - travis_retry php vendor/bin/php-coveralls  -v


================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)

Copyright (c) Janusz Kocik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
## Laravel Profiler

[![Build Status](https://travis-ci.org/jkocik/laravel-profiler.svg?branch=master)](https://travis-ci.org/jkocik/laravel-profiler)
[![Coverage Status](https://coveralls.io/repos/github/jkocik/laravel-profiler/badge.svg?branch=master)](https://coveralls.io/github/jkocik/laravel-profiler?branch=master)

The aim of this project is to track console and web Laravel framework execution and give developers
better understanding what is going on under the hood. Laravel Profiler is designed for Laravel Framework.

![Laravel Profiler](https://drive.google.com/uc?export=view&id=12TSAEW1butnLfmFxO3Pw4GhF96B8PUSk)

### Supported versions

| Laravel Framework version you have | Laravel Profiler version you should use |
| ---------------------------------- | --------------------------------------- |
| 5.2.x - 5.8.x | 1.x |
| 6.x - 8.x | 2.x |

### How does it work?

Profiler delivers data about Laravel framework execution:
- when **tests are run** (PHPUnit, Laravel Dusk)
- when Laravel is executed via **console** (artisan)
- when Laravel is executed via **browser request**
- when Laravel is executed via web request not expecting HTML response (**API**)
- on any other **action that terminates** Laravel framework.

Profiler does not add any routes to your application and does not modify the content of the response.

Profiler is divided into 3 parts:
- Profiler Package - PHP package for Laravel (this repository)
- Profiler Client - Single Page Application to review data delivered by Profiler Package
- Profiler Server - bridge between Profiler Package and Profiler Client.

Profiler Client and Profiler Server both live in [laravel-profiler-client](https://github.com/jkocik/laravel-profiler-client) repository

#### Data flow

Profiler Package tracks Laravel execution and sends collected data to Profiler Server using HTTP.
Profiler Server passes data to Profiler Client using WebSockets.

#### Trackers

Data tracked, collected and delivered to Profiler Client are:
- auth
- redis
- route
- views
- events
- session
- exceptions
- server status
- database queries
- performance metrics
- request (web) / input (console)
- response (web) / output (console)
- application (Laravel status, config, loaded service providers, container bindings, framework paths)

Profiler and its trackers do their job after request / artisan command is finished.
That keeps your framework execution time and peak of memory usage as close to real values (without Profiler impact)
as possible.

## Installation and configuration

### Step 1: Install Profiler Package

Requirements: PHP 7.2+

It is recommended to install Profiler Package only for development

```shell
composer require jkocik/laravel-profiler --dev
```

### Step 2: Publish configuration file

Run command

```shell
php artisan vendor:publish --provider="JKocik\Laravel\Profiler\ServiceProvider"
```

... and check config/profiler.php file for Profiler settings.

### Step 3: Install Profiler Server and Profiler Client

It is recommended to install Profiler Server and Profiler Client only for development

```shell
npm install laravel-profiler-client --save-dev
```

### Step 4: Run Profiler Server and Profiler Client

_Windows users: If you have any issue with running Profiler Server or Profiler Client
check Installation options / issues section below._

Run command

```shell
php artisan profiler:server
```
and

a) for your local machine

```shell
php artisan profiler:client
```

After that your browser should have new tab opened with Profiler Client connected to Profiler Server.

b) for Docker, Vagrant or any other machine different from local

```shell
php artisan profiler:client -m
```

... and open new browser tab according to instructions in console. Remember that you need
to connect Profiler Client to Profiler Server yourself because by default Profiler Client uses localhost.
You can do that in Profiler Client interface.

### Step 5: Verify installation

Run command

```shell
php artisan profiler:status
```

... to check Profiler status and see first data of Laravel execution in Profiler Client.

### Installation options / issues

a) If you have any issue with running Profiler Server or Profiler Client use npm scripts instead of artisan commands.
Add new scripts to your package.json file

```json
"scripts": {
    "profiler-server": "node node_modules/laravel-profiler-client/server/server.js http=8099 ws=1901",
    "profiler-client": "http-server node_modules/laravel-profiler-client/dist/ -o -s",
    "ps": "npm run profiler-server",
    "pc": "npm run profiler-client"    
}
```

... then run Profiler Server

```shell
npm run ps
```

... and Profiler Client

```shell
npm run pc
```

b) If you don't want to open new browser tab every time you run Profiler Client command use manual option

```shell
php artisan profiler:client -m
```

c) If default ports used by Profiler are taken on your machine configure them in config/profiler.php file.

### Done!
 
You are ready to use Laravel Profiler. Enjoy!

### Usage

#### Performance metrics

Profiler delivers basic performance metrics including peak of memory usage and Laravel execution time.
You can extend metrics by using Profiler helper functions:

```php
profiler_start('my time metric name');

// my code to track execution time

profiler_finish('my time metric name');
``` 

Then check results in Profiler Client (Performance > Custom tab). You should keep unique metric names
otherwise duplicates will be skipped and reported as an error (in a way according to your exception handling
settings in config/profiler.php file).

_Important notice: remove Profiler helper functions from your code
before moving to production or any environment without Profiler installed._

#### Laravel Profiler for testing environment

When testing Profiler will deliver the same data as for regular request / artisan command. However application should be
terminated. Lets see two default tests Laravel is shipped with:

```php
public function testBasicTest()
{
    $response = $this->get('/');

    $response->assertStatus(200);
}
``` 

First test will terminate application and Profiler will work as expected. However second test

```php
public function testBasicTest()
{
    $this->assertTrue(true);
}
```

... will not provide any data because this time application is not terminated. You can force
Profiler to work by adding terminate method:

```php
public function testBasicTest()
{
    $this->assertTrue(true);
    
    $this->app->terminate();
}
```

If you want to reset Profiler trackers you can use Profiler helper:
```php
public function testBasicTest()
{
    factory(User::class)->create();
    
    profiler_reset();
    
    // act and assert
}
```

_Important notice related to testing environment: peak of memory usage can not be tracked for each test separately
so is not shown in Profiler Client._

#### Using together with Laravel Debugbar

It is not recommended using Laravel Profiler and Laravel Debugbar together. Profiler will finish
its work after Debugbar and Profiler report of framework execution time and peak of memory usage will
be increased by Debugbar activity. Use Profiler or Debugbar one at a time.


================================================
FILE: composer.json
================================================
{
    "name": "jkocik/laravel-profiler",
    "description": "Profiler for Laravel Framework",
    "keywords": ["laravel", "profiler", "debugbar"],
    "homepage": "https://github.com/jkocik/laravel-profiler",
    "license": "MIT",
    "authors": [
        {
            "name": "Janusz Kocik",
            "email": "janusz.kocik@gmail.com"
        }
    ],
    "require": {
        "php": ">=7.2",
        "guzzlehttp/guzzle": "^5.0 || ^6.0 || ^7.0"
    },
    "require-dev": {
        "mockery/mockery": "^1.0",
        "php-mock/php-mock": "^2.0",
        "php-coveralls/php-coveralls": "^2.1",
        "predis/predis": "^1.1",
        "fzaninotto/faker": "^1.5",
        "phpunit/phpunit": "^8"
    },
    "autoload": {
        "psr-4": {
            "JKocik\\Laravel\\Profiler\\": "src/"
        },
        "files": [
            "src/Services/helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "JKocik\\Laravel\\Profiler\\Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "providers": [
                "JKocik\\Laravel\\Profiler\\ServiceProvider"
            ]
        }
    }
}


================================================
FILE: config/profiler.php
================================================
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | General Laravel Profiler enable / disable setting
    |--------------------------------------------------------------------------
    |
    | This value enables / disables Profiler. If set to false all settings
    | below it do not take effect.
    |
    */

    'enabled' => env('PROFILER_ENABLED', true),

    /*
    |--------------------------------------------------------------------------
    | Override general Laravel Profiler enable / disable setting
    |--------------------------------------------------------------------------
    |
    | Can disable Profiler on particular env. Profiler is disabled by default
    | on production (be aware that installation on production is not recommended).
    | Setting takes effect only if above (enabled) is set to true.
    |
    */

    'enabled_overrides' => [
        'production' => false,
//        'testing' => false,
//        'local' => false,
    ],

    /*
    |--------------------------------------------------------------------------
    | Profiler trackers
    |--------------------------------------------------------------------------
    |
    | Trackers collect data of framework execution. You can decide what data
    | you want to collect by commenting / uncommenting particular trackers.
    |
    */

    'trackers' => [
        \JKocik\Laravel\Profiler\Trackers\ConfigTracker::class, // App > Config tab
        \JKocik\Laravel\Profiler\Trackers\ServiceProvidersTracker::class, // App > Service Providers tab
        \JKocik\Laravel\Profiler\Trackers\BindingsTracker::class, // App > Bindings tab
        \JKocik\Laravel\Profiler\Trackers\PathsTracker::class, // App > Paths tab
        \JKocik\Laravel\Profiler\Trackers\SessionTracker::class, // Request > Session tab
        \JKocik\Laravel\Profiler\Trackers\RouteTracker::class, // Request > Route tab
        \JKocik\Laravel\Profiler\Trackers\ServerTracker::class, // Request > Server tab
        \JKocik\Laravel\Profiler\Trackers\ContentTracker::class, // Response > Content and JSON tabs
        \JKocik\Laravel\Profiler\Trackers\ViewsTracker::class, // Views tab
        \JKocik\Laravel\Profiler\Trackers\EventsTracker::class, // Events tab
        \JKocik\Laravel\Profiler\Trackers\QueriesTracker::class, // Queries tab
//        \JKocik\Laravel\Profiler\Trackers\RedisTracker::class, // Redis tab (from Laravel 5.7)
        \JKocik\Laravel\Profiler\Trackers\AuthTracker::class, // Auth tab
        \JKocik\Laravel\Profiler\Trackers\ExceptionTracker::class, // Exception tab
    ],

    /*
    |--------------------------------------------------------------------------
    | Profiler Server and Profiler Client connections
    |--------------------------------------------------------------------------
    |
    | These settings let you set up connections between Profiler Package
    | (this Laravel package) and Profiler Server using HTTP protocol
    | and finally pass data from Profiler Server to Profiler Client
    | (Single Page Application accessible via browser) using WebSockets.
    |
    */

    'server_http' => [
        'address' => 'http://localhost',
        'port' => '8099',
    ],

    'server_sockets' => [
        'port' => '1901',
    ],

    /*
    |--------------------------------------------------------------------------
    | Profiler processors
    |--------------------------------------------------------------------------
    |
    | Processors process data collected by trackers. Default processor
    | broadcasts data through Profiler Server to Profiler Client.
    |
    */

    'processors' => [
        \JKocik\Laravel\Profiler\Processors\BroadcastingProcessor::class,
    ],

    'turn_off_processors_for_paths' => [
        'telescope',
        '_debugbar',
    ],

    /*
    |--------------------------------------------------------------------------
    | Data passed to tracked items
    |--------------------------------------------------------------------------
    |
    | That can be very heavy when your views or events receive a lot of data.
    | Avoid using it on testing env specially when running whole test suite.
    |
    */

    'data' => [
        'views' => false,
        'events' => false,
    ],

    /*
    |--------------------------------------------------------------------------
    | Grouping
    |--------------------------------------------------------------------------
    |
    | There can be a lot of the same events fired one by one. Grouping can
    | help you review them on better organized list of events.
    |
    */

    'group' => [
        'events' => true,
    ],

    /*
    |--------------------------------------------------------------------------
    | Handle exceptions
    |--------------------------------------------------------------------------
    |
    | Profiler processors and helper functions can throw exceptions.
    | They are logged by default to let you know about current issues
    | like problems with connection to Profiler Server.
    |
    | Handle exceptions settings are [int]:
    | 0 - catch exceptions and do not report them
    | 1 - catch exceptions and report them in logs
    | 666 - do not catch exceptions, let them be thrown
    |
    */

    'handle_exceptions' => 1,

];


================================================
FILE: docker-compose.yml
================================================
version: '3.5'

services:
    profiler_v1:
        build:
            dockerfile: Dockerfile-v1
            context: ./.docker/images/php
        container_name: profiler_v1
        hostname: profiler_v1
        entrypoint: sh /bin/entrypoint.sh php-fpm
        volumes:
            - ./.docker/etc/php/entrypoint.sh:/bin/entrypoint.sh:ro
            - ./.docker/etc/php/php-v1.ini:/usr/local/etc/php/php.ini
            - .:/var/www/html

    profiler_v2:
        build:
            dockerfile: Dockerfile-v2
            context: ./.docker/images/php
        container_name: profiler_v2
        hostname: profiler_v2
        entrypoint: sh /bin/entrypoint.sh php-fpm
        volumes:
            - ./.docker/etc/php/entrypoint.sh:/bin/entrypoint.sh:ro
            - ./.docker/etc/php/php-v2.ini:/usr/local/etc/php/php.ini
            - .:/var/www/html


================================================
FILE: phpunit-laravel-52.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="5.2"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-53.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="5.3"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-54.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="5.4"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-55.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="5.5"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-56.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="5.6"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-57.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="5.7"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-58.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="5.8"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-6.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">./src/</directory>
            <exclude>
                <file>./src/LaravelExecution/ExceptionHandlerFromVersion7.php</file>
            </exclude>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="6"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
        <env name="REDIS_CLIENT" value="predis"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-7.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="7"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
        <env name="REDIS_CLIENT" value="predis"/>
    </php>
</phpunit>


================================================
FILE: phpunit-laravel-8.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap/phpunit.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          stopOnFailure="false"
>
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
    <listeners>
        <listener class="\JKocik\Laravel\Profiler\Tests\Support\TestListener">
        </listener>
    </listeners>
    <php>
        <const name="TESTS_FRAMEWORK_VERSION" value="8"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
        <env name="REDIS_CLIENT" value="predis"/>
    </php>
</phpunit>


================================================
FILE: src/BaseProfiler.php
================================================
<?php

namespace JKocik\Laravel\Profiler;

use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Application;
use Illuminate\Console\Events\ArtisanStarting;
use JKocik\Laravel\Profiler\Contracts\Profiler;
use JKocik\Laravel\Profiler\Events\ResetTrackers;
use Illuminate\Foundation\Bootstrap\BootProviders;
use JKocik\Laravel\Profiler\Console\StatusCommand;
use JKocik\Laravel\Profiler\Console\ServerCommand;
use JKocik\Laravel\Profiler\Console\ClientCommand;

abstract class BaseProfiler implements Profiler
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * BaseProfiler constructor.
     * @param Application $app
     */
    public function __construct(Application $app)
    {
        $this->app = $app;
    }

    /**
     * @return void
     */
    public function resetTrackers(): void
    {
        event(new ResetTrackers());
    }

    /**
     * @return void
     */
    public function listenForBoot(): void
    {
        $this->app->beforeBootstrapping(BootProviders::class, function () {
            $this->commands();
            $this->boot();
        });
    }

    /**
     * @return void
     */
    abstract protected function boot(): void;

    /**
     * @return void
     */
    private function commands(): void
    {
        Event::listen(ArtisanStarting::class, function (ArtisanStarting $event) {
            $event->artisan->resolveCommands([
                StatusCommand::class,
                ServerCommand::class,
                ClientCommand::class,
            ]);
        });
    }
}


================================================
FILE: src/Console/ClientCommand.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Console;

use Illuminate\Console\Command;
use JKocik\Laravel\Profiler\Services\ConsoleService;

class ClientCommand extends Command
{
    /**
     * @var string
     */
    protected $signature = 'profiler:client {--m|manual}';

    /**
     * @var string
     */
    protected $description = 'Start Profiler Client';

    /**
     * @var ConsoleService
     */
    protected $consoleService;

    /**
     * ClientCommand constructor.
     * @param ConsoleService $consoleService
     */
    public function __construct(ConsoleService $consoleService)
    {
        parent::__construct();

        $this->consoleService = $consoleService;
    }

    /**
     * @return void
     */
    public function handle(): void
    {
        $this->line('Starting Profiler Client ...');

        passthru($this->consoleService->profilerClientCmd($this->option('manual')));
    }
}


================================================
FILE: src/Console/ServerCommand.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Console;

use Illuminate\Console\Command;
use JKocik\Laravel\Profiler\Services\ConsoleService;

class ServerCommand extends Command
{
    /**
     * @var string
     */
    protected $signature = 'profiler:server';

    /**
     * @var string
     */
    protected $description = 'Start Profiler Server';

    /**
     * @var ConsoleService
     */
    protected $consoleService;

    /**
     * ServerCommand constructor.
     * @param ConsoleService $consoleService
     */
    public function __construct(ConsoleService $consoleService)
    {
        parent::__construct();

        $this->consoleService = $consoleService;
    }

    /**
     * @return void
     */
    public function handle(): void
    {
        $this->line('Starting Profiler Server ...');

        passthru($this->consoleService->profilerServerCmd());
    }
}


================================================
FILE: src/Console/StatusCommand.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Console;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Event;
use JKocik\Laravel\Profiler\Services\ConfigService;
use JKocik\Laravel\Profiler\Services\ConsoleService;
use JKocik\Laravel\Profiler\Processors\StatusCommandProcessor;
use JKocik\Laravel\Profiler\Events\ProfilerServerConnectionFailed;
use JKocik\Laravel\Profiler\Events\ProfilerServerConnectionSuccessful;

class StatusCommand extends Command
{
    /**
     * @var string
     */
    protected $signature = 'profiler:status';

    /**
     * @var string
     */
    protected $description = 'Check Laravel Profiler status';

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * @var ConsoleService
     */
    protected $consoleService;

    /**
     * @var bool
     */
    protected $connectionStatusIsUnknown = true;

    /**
     * StatusCommand constructor.
     * @param ConfigService $configService
     * @param ConsoleService $consoleService
     */
    public function __construct(ConfigService $configService, ConsoleService $consoleService)
    {
        parent::__construct();

        $this->configService = $configService;
        $this->consoleService = $consoleService;
    }

    /**
     * @return void
     */
    public function handle(): void
    {
        $this->configService->overrideProcessors([
            StatusCommandProcessor::class,
        ]);

        $this->printProfilerStatus();

        if (! $this->configService->isProfilerEnabled()) {
            return;
        }

        $this->printTrackersStatus();

        $this->printConnectionStatus();
    }

    /**
     * @return void
     */
    protected function printProfilerStatus(): void
    {
        $this->line("1) {$this->consoleService->envInfo()}");
        $this->info($this->consoleService->profilerStatusInfo());
    }

    /**
     * @return void
     */
    protected function printTrackersStatus(): void
    {
        $this->line('');
        $this->line("2) {$this->consoleService->trackersStatusInfo()}");

        $this->configService->trackers()->each(function ($tracker) {
            $this->info("- {$tracker}");
        });

        $this->comment($this->consoleService->trackersCommentLine1());
        $this->comment($this->consoleService->trackersCommentLine2());
    }

    /**
     * @return void
     */
    protected function printConnectionStatus(): void
    {
        $this->line('');
        $this->line("3) {$this->consoleService->connectionStatusInfo()}");

        Event::listen(ProfilerServerConnectionSuccessful::class, function (ProfilerServerConnectionSuccessful $event) {
            $this->info($this->consoleService->connectionSuccessfulInfo());
            $this->info($this->consoleService->connectionSuccessfulSocketsInfo($event->socketsPort));
            $this->info($this->consoleService->connectionSuccessfulClientsInfo($event->countClients));

            $this->connectionStatusIsUnknown = false;
        });

        Event::listen(ProfilerServerConnectionFailed::class, function () {
            $this->error($this->error($this->consoleService->connectionFailedInfo()));

            $this->connectionStatusIsUnknown = false;
        });

        app()->terminating(function () {
            if (! $this->connectionStatusIsUnknown) {
                return;
            }

            $this->error($this->consoleService->connectionStatusUnknownInfo());
        });
    }
}


================================================
FILE: src/Contracts/DataProcessor.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

interface DataProcessor
{
    /**
     * @param DataTracker $dataTracker
     * @return void
     */
    public function process(DataTracker $dataTracker): void;
}


================================================
FILE: src/Contracts/DataTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

use Illuminate\Support\Collection;

interface DataTracker
{
    /**
     * @return void
     */
    public function track(): void;

    /**
     * @return void
     */
    public function terminate(): void;

    /**
     * @return Collection
     */
    public function meta(): Collection;

    /**
     * @return Collection
     */
    public function data(): Collection;
}


================================================
FILE: src/Contracts/ExecutionContent.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

use Illuminate\Support\Collection;

interface ExecutionContent
{
    /**
     * @return Collection
     */
    public function meta(): Collection;

    /**
     * @return Collection
     */
    public function data(): Collection;
}


================================================
FILE: src/Contracts/ExecutionData.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

interface ExecutionData
{
    /**
     * @param ExecutionRequest $request
     * @return void
     */
    public function setRequest(ExecutionRequest $request): void;

    /**
     * @return ExecutionRequest
     */
    public function request(): ExecutionRequest;

    /**
     * @param ExecutionRoute $route
     * @return void
     */
    public function setRoute(ExecutionRoute $route): void;

    /**
     * @return ExecutionRoute
     */
    public function route(): ExecutionRoute;

    /**
     * @param ExecutionSession $session
     * @return void
     */
    public function setSession(ExecutionSession $session): void;

    /**
     * @return ExecutionSession
     */
    public function session(): ExecutionSession;

    /**
     * @param ExecutionServer $server
     * @return void
     */
    public function setServer(ExecutionServer $server): void;

    /**
     * @return ExecutionServer
     */
    public function server(): ExecutionServer;

    /**
     * @param ExecutionResponse $response
     * @return void
     */
    public function setResponse(ExecutionResponse $response): void;

    /**
     * @return ExecutionResponse
     */
    public function response(): ExecutionResponse;

    /**
     * @param ExecutionContent $content
     * @return void
     */
    public function setContent(ExecutionContent $content): void;

    /**
     * @return ExecutionContent
     */
    public function content(): ExecutionContent;
}


================================================
FILE: src/Contracts/ExecutionRequest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

use Illuminate\Support\Collection;

interface ExecutionRequest
{
    /**
     * @return Collection
     */
    public function meta(): Collection;

    /**
     * @return Collection
     */
    public function data(): Collection;
}


================================================
FILE: src/Contracts/ExecutionResponse.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

use Illuminate\Support\Collection;

interface ExecutionResponse
{
    /**
     * @return Collection
     */
    public function meta(): Collection;

    /**
     * @return Collection
     */
    public function data(): Collection;
}


================================================
FILE: src/Contracts/ExecutionRoute.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

use Illuminate\Support\Collection;

interface ExecutionRoute
{
    /**
     * @return Collection
     */
    public function meta(): Collection;

    /**
     * @return Collection
     */
    public function data(): Collection;
}


================================================
FILE: src/Contracts/ExecutionServer.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

use Illuminate\Support\Collection;

interface ExecutionServer
{
    /**
     * @return Collection
     */
    public function meta(): Collection;

    /**
     * @return Collection
     */
    public function data(): Collection;
}


================================================
FILE: src/Contracts/ExecutionSession.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

use Illuminate\Support\Collection;

interface ExecutionSession
{
    /**
     * @return Collection
     */
    public function meta(): Collection;

    /**
     * @return Collection
     */
    public function data(): Collection;
}


================================================
FILE: src/Contracts/ExecutionWatcher.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

interface ExecutionWatcher
{
    /**
     * @return void
     */
    public function watch(): void;
}


================================================
FILE: src/Contracts/LaravelListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

interface LaravelListener
{
    /**
     * @return void
     */
    public function listen(): void;
}


================================================
FILE: src/Contracts/Memory.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

interface Memory
{

}


================================================
FILE: src/Contracts/Processor.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

interface Processor
{
    /**
     * @param DataTracker $dataTracker
     * @return void
     */
    public function process(DataTracker $dataTracker): void;
}


================================================
FILE: src/Contracts/Profiler.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

interface Profiler
{
    /**
     * @return void
     */
    public function resetTrackers(): void;

    /**
     * @return void
     */
    public function listenForBoot(): void;
}


================================================
FILE: src/Contracts/Timer.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

interface Timer
{
    /**
     * @param string $name
     * @return void
     */
    public function startCustom(string $name): void;

    /**
     * @param string $name
     * @return void
     */
    public function finishCustom(string $name): void;

    /**
     * @param string $name
     * @return float
     */
    public function millisecondsCustom(string $name): float;
}


================================================
FILE: src/Contracts/Tracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Contracts;

use Illuminate\Support\Collection;

interface Tracker
{
    /**
     * @return Collection
     */
    public function meta(): Collection;

    /**
     * @return Collection
     */
    public function data(): Collection;

    /**
     * @return void
     */
    public function terminate(): void;
}


================================================
FILE: src/DisabledProfiler.php
================================================
<?php

namespace JKocik\Laravel\Profiler;

use JKocik\Laravel\Profiler\Contracts\Timer;
use JKocik\Laravel\Profiler\Events\ProfilerBound;
use JKocik\Laravel\Profiler\Services\Performance\NullTimerService;

class DisabledProfiler extends BaseProfiler
{
    /**
     * @return void
     */
    protected function boot(): void
    {
        $this->bind();
    }

    /**
     * @return void
     */
    protected function bind(): void
    {
        $this->app->singleton(Timer::class, function ($app) {
            return $app->make(NullTimerService::class);
        });

        event(ProfilerBound::class);
    }
}


================================================
FILE: src/Events/ExceptionHandling.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Events;

use Throwable;

class ExceptionHandling
{
    /**
     * @var Throwable
     */
    public $exception;

    /**
     * ExceptionHandling constructor.
     * @param Throwable $exception
     */
    public function __construct(Throwable $exception)
    {
        $this->exception = $exception;
    }
}


================================================
FILE: src/Events/ProfilerBound.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Events;

class ProfilerBound
{

}


================================================
FILE: src/Events/ProfilerServerConnectionFailed.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Events;

class ProfilerServerConnectionFailed
{

}


================================================
FILE: src/Events/ProfilerServerConnectionSuccessful.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Events;

class ProfilerServerConnectionSuccessful
{
    /**
     * @var int
     */
    public $socketsPort;

    /**
     * @var int
     */
    public $countClients;

    /**
     * ProfilerServerConnectionSuccessful constructor.
     * @param int $socketsPort
     * @param int $countClients
     */
    public function __construct(int $socketsPort, int $countClients)
    {
        $this->socketsPort = $socketsPort;
        $this->countClients = $countClients;
    }
}


================================================
FILE: src/Events/ResetTrackers.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Events;

class ResetTrackers
{

}


================================================
FILE: src/Events/Terminating.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Events;

class Terminating
{

}


================================================
FILE: src/Events/Tracking.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Events;

class Tracking
{

}


================================================
FILE: src/LaravelDataProcessor.php
================================================
<?php

namespace JKocik\Laravel\Profiler;

use Exception;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Services\LogService;
use JKocik\Laravel\Profiler\Contracts\Processor;
use JKocik\Laravel\Profiler\Contracts\DataTracker;
use JKocik\Laravel\Profiler\Services\ConfigService;
use JKocik\Laravel\Profiler\Contracts\DataProcessor;

class LaravelDataProcessor implements DataProcessor
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var LogService
     */
    protected $logService;

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * LaravelDataProcessor constructor.
     * @param Application $app
     * @param LogService $logService
     * @param ConfigService $configService
     */
    public function __construct(
        Application $app,
        LogService $logService,
        ConfigService $configService
    ) {
        $this->app = $app;
        $this->logService = $logService;
        $this->configService = $configService;
    }

    /**
     * @param DataTracker $dataTracker
     * @return void
     */
    public function process(DataTracker $dataTracker): void
    {
        if ($this->shouldNotProcess($dataTracker)) {
            return;
        }

        $this->configService->processors()->each(function (string $processor) use ($dataTracker) {
            try {
                $this->make($processor)->process($dataTracker);
            } catch (Exception $e) {
                $this->logService->error($e);
            }
        });
    }

    /**
     * @param string $processor
     * @return Processor
     */
    protected function make(string $processor): Processor
    {
        return $this->app->make($processor);
    }

    /**
     * @param DataTracker $dataTracker
     * @return bool
     */
    protected function shouldNotProcess(DataTracker $dataTracker): bool
    {
        if (! $dataTracker->meta()->has('path')) {
            return false;
        }

        return $this->configService->pathsToTurnOffProcessors()->map(function ($path) use ($dataTracker) {
            return stripos($dataTracker->meta()->get('path'), $path) !== false;
        })->contains(true);
    }
}


================================================
FILE: src/LaravelDataTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler;

use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\Tracker;
use JKocik\Laravel\Profiler\Contracts\DataTracker;
use JKocik\Laravel\Profiler\Services\ConfigService;
use JKocik\Laravel\Profiler\Trackers\RequestTracker;
use JKocik\Laravel\Profiler\Trackers\ResponseTracker;
use JKocik\Laravel\Profiler\Trackers\ApplicationTracker;
use JKocik\Laravel\Profiler\Trackers\PerformanceTracker;

class LaravelDataTracker implements DataTracker
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * @var Collection
     */
    protected $trackers;

    /**
     * @var Collection
     */
    protected $meta;

    /**
     * @var Collection
     */
    protected $data;

    /**
     * LaravelDataTracker constructor.
     * @param Application $app
     * @param ConfigService $configService
     */
    public function __construct(Application $app, ConfigService $configService)
    {
        $this->app = $app;
        $this->configService = $configService;

        $this->trackers = new Collection();
        $this->meta = new Collection();
        $this->data = new Collection();
    }

    /**
     * @return void
     */
    public function track(): void
    {
        $this->bootTrackers(Collection::make([
            ApplicationTracker::class,
            PerformanceTracker::class,
            RequestTracker::class,
            ResponseTracker::class,
        ]));

        $this->bootTrackers($this->configService->trackers());
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $this->trackers->each(function (Tracker $tracker) {
            $tracker->terminate();
            $this->meta = $this->meta->merge($tracker->meta());
            $this->data = $this->data->merge($tracker->data());
        });
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return $this->meta;
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return $this->data;
    }

    /**
     * @param Collection $trackers
     * @return void
     */
    protected function bootTrackers(Collection $trackers): void
    {
        $trackers->each(function (string $tracker) {
            $this->trackers->push($this->app->make($tracker));
        });
    }
}


================================================
FILE: src/LaravelExecution/ConsoleFinishedRequest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use Symfony\Component\Console\Input\InputInterface;
use JKocik\Laravel\Profiler\Contracts\ExecutionRequest;

class ConsoleFinishedRequest implements ExecutionRequest
{
    /**
     * @var null|string
     */
    protected $command;

    /**
     * @var InputInterface
     */
    protected $input;

    /**
     * ConsoleFinishedRequest constructor.
     * @param null|string $command
     * @param InputInterface $input
     */
    public function __construct(?string $command, InputInterface $input)
    {
        $this->command = $command;
        $this->input = $input;
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make([
            'type' => 'command-finished',
            'path' => $this->command,
        ]);
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make([
            'arguments' => $this->input->getArguments(),
            'options' => $this->input->getOptions(),
        ]);
    }
}


================================================
FILE: src/LaravelExecution/ConsoleFinishedResponse.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionResponse;

class ConsoleFinishedResponse implements ExecutionResponse
{
    /**
     * @var int
     */
    protected $exitCode;

    /**
     * ConsoleFinishedResponse constructor.
     * @param int $exitCode
     */
    public function __construct(int $exitCode)
    {
        $this->exitCode = $exitCode;
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make([
            'status' => $this->exitCode,
        ]);
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecution/ConsoleStartingRequest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionRequest;

class ConsoleStartingRequest implements ExecutionRequest
{
    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make([
            'type' => 'command-starting',
        ]);
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecution/ConsoleStartingResponse.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionResponse;

class ConsoleStartingResponse implements ExecutionResponse
{
    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make([
            'status' => null,
        ]);
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecution/ExceptionHandlerFromVersion7.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Throwable;
use App\Exceptions\Handler;
use JKocik\Laravel\Profiler\Events\ExceptionHandling;

class ExceptionHandlerFromVersion7 extends Handler
{
    /**
     * @param Throwable $exception
     * @return void
     */
    public function report(Throwable $exception)
    {
        event(new ExceptionHandling($exception));

        parent::report($exception);
    }
}


================================================
FILE: src/LaravelExecution/ExceptionHandlerTillVersion6.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Exception;
use App\Exceptions\Handler;
use JKocik\Laravel\Profiler\Events\ExceptionHandling;

class ExceptionHandlerTillVersion6 extends Handler
{
    /**
     * @param Exception $exception
     * @return void
     */
    public function report(Exception $exception)
    {
        event(new ExceptionHandling($exception));

        parent::report($exception);
    }
}


================================================
FILE: src/LaravelExecution/HttpContent.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use Symfony\Component\HttpFoundation\Response;
use JKocik\Laravel\Profiler\Contracts\ExecutionContent;

class HttpContent implements ExecutionContent
{
    /**
     * @var Response
     */
    protected $response;

    /**
     * HttpContent constructor.
     * @param Response $response
     */
    public function __construct(Response $response)
    {
        $this->response = $response;
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make([
            'content' => $this->response->getContent(),
        ]);
    }
}


================================================
FILE: src/LaravelExecution/HttpRequest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionRequest;

class HttpRequest implements ExecutionRequest
{
    /**
     * @var Request
     */
    protected $request;

    /**
     * HttpRequest constructor.
     * @param Request $request
     */
    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make([
            'type' => 'http',
            'method' => $this->request->method(),
            'path' => $this->request->path(),
            'ajax' => $this->request->ajax(),
            'json' => $this->request->isJson(),
        ]);
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make([
            'pjax' => $this->request->pjax(),
            'url' => $this->request->url(),
            'query' => $this->request->query(),
            'ip' => $this->request->ip(),
            'header' => $this->request->header(),
            'input' => $this->request->input(),
            'files' => $this->files(),
            'cookie' => $this->request->cookie(),
        ]);
    }

    /**
     * @return Collection
     */
    protected function files(): Collection
    {
        $files = Collection::make($this->request->allFiles());

        return $this->filesMap($files);
    }

    /**
     * @param Collection $files
     * @return Collection
     */
    protected function filesMap(Collection $files): Collection
    {
        return $files->map(function ($file) {
            if (is_array($file)) {
                $files = Collection::make($file);
                return $this->filesMap($files);
            }

            return [get_class($file) => $this->file($file)];
        });
    }

    /**
     * @param UploadedFile $file
     * @return array
     */
    protected function file(UploadedFile $file): array
    {
        return [
            'client original name' => $file->getClientOriginalName(),
            'client original extension' => $file->getClientOriginalExtension(),
            'client mime type' => $file->getClientMimeType(),
            'client size' => $this->clientSize($file),
            'path' => $file->path(),
        ];
    }

    /**
     * @param UploadedFile $file
     * @return int
     */
    protected function clientSize(UploadedFile $file): int
    {
        return method_exists($file, 'getClientSize')
            ? $file->getClientSize()
            : $file->getSize();
    }
}


================================================
FILE: src/LaravelExecution/HttpResponse.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use Symfony\Component\HttpFoundation\Response;
use JKocik\Laravel\Profiler\Contracts\ExecutionResponse;

class HttpResponse implements ExecutionResponse
{
    /**
     * @var Response
     */
    protected $response;

    /**
     * HttpResponse constructor.
     * @param Response $response
     */
    public function __construct(Response $response)
    {
        $this->response = $response;
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make([
            'status' => $this->response->getStatusCode(),
            'status_text' => $this->getStatusText(),
        ]);
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make([
            'headers' => $this->response->headers->all(),
        ]);
    }

    /**
     * @return string
     */
    protected function getStatusText(): string
    {
        return $this->response::$statusTexts[$this->response->getStatusCode()] ?? 'unknown status';
    }
}


================================================
FILE: src/LaravelExecution/HttpRoute.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Closure;
use ReflectionMethod;
use ReflectionFunction;
use ReflectionException;
use ReflectionParameter;
use Illuminate\Routing\Route;
use Illuminate\Support\Collection;
use Illuminate\Foundation\Http\FormRequest;
use JKocik\Laravel\Profiler\Contracts\ExecutionRoute;

class HttpRoute implements ExecutionRoute
{
    /**
     * @var Route
     */
    protected $route;

    /**
     * HttpRoute constructor.
     * @param Route $route
     */
    public function __construct(Route $route)
    {
        $this->route = $route;
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make([
            'methods' => $this->route->methods(),
            'uri' => $this->route->uri(),
            'name' => $this->route->getName(),
            'middleware' => $this->route->middleware(),
            'parameters' => $this->route->parameters(),
            'prefix' => $this->route->getPrefix(),
            'uses' => $this->uses(),
        ]);
    }

    /**
     * @return array
     */
    protected function uses(): array
    {
        $uses = $this->route->getAction();

        try {
            if ($this->isClosureIn($uses)) {
                return $this->closure($uses);
            }

            if ($this->isControllerIn($uses)) {
                return $this->controller($uses);
            }
        } catch (ReflectionException $e) {}

        return [];
    }

    /**
     * @param array $uses
     * @return bool
     */
    protected function isClosureIn(array $uses): bool
    {
        return isset($uses['uses']) && $uses['uses'] instanceof Closure;
    }

    /**
     * @param array $uses
     * @return array
     */
    protected function closure(array $uses): array
    {
        $action = new ReflectionFunction($uses['uses']);

        return [
            'closure' => $action->getFileName() . ':' . $action->getStartLine() . '-' . $action->getEndLine(),
            'form_request' => $this->formRequest($action->getParameters()),
        ];
    }

    /**
     * @param array $uses
     * @return bool
     */
    protected function isControllerIn(array $uses): bool
    {
        return isset($uses['uses']) && count(explode('@', $uses['uses'])) == 2;
    }

    /**
     * @param array $uses
     * @return array
     */
    protected function controller(array $uses): array
    {
        list($controller, $method) = explode('@', $uses['uses']);

        $action = new ReflectionMethod($controller, $method);

        return [
            'controller' => $uses['uses'] . ':' . $action->getStartLine() . '-' . $action->getEndLine(),
            'form_request' => $this->formRequest($action->getParameters()),
        ];
    }

    /**
     * @param array $parameters
     * @return string
     */
    protected function formRequest(array $parameters): string
    {
        $formRequest = Collection::make($parameters)->filter(function (ReflectionParameter $parameter) {
            return $parameter->getType() && is_subclass_of($parameter->getType()->getName(), FormRequest::class);
        })->first();

        return $formRequest ? $formRequest->getType()->getName() : '';
    }
}


================================================
FILE: src/LaravelExecution/HttpServer.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionServer;

class HttpServer implements ExecutionServer
{
    /**
     * @var Request
     */
    protected $request;

    /**
     * HttpServer constructor.
     * @param Request $request
     */
    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make(
            $this->request->server()
        );
    }
}


================================================
FILE: src/LaravelExecution/HttpSession.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use Illuminate\Session\SessionManager;
use JKocik\Laravel\Profiler\Contracts\ExecutionSession;

class HttpSession implements ExecutionSession
{
    /**
     * @var SessionManager
     */
    protected $session;

    /**
     * HttpSession constructor.
     * @param SessionManager $session
     */
    public function __construct(SessionManager $session)
    {
        $this->session = $session;
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make($this->session->all());
    }
}


================================================
FILE: src/LaravelExecution/LaravelExecutionData.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use JKocik\Laravel\Profiler\Contracts\ExecutionData;
use JKocik\Laravel\Profiler\Contracts\ExecutionRoute;
use JKocik\Laravel\Profiler\Contracts\ExecutionServer;
use JKocik\Laravel\Profiler\Contracts\ExecutionRequest;
use JKocik\Laravel\Profiler\Contracts\ExecutionContent;
use JKocik\Laravel\Profiler\Contracts\ExecutionSession;
use JKocik\Laravel\Profiler\Contracts\ExecutionResponse;

class LaravelExecutionData implements ExecutionData
{
    /**
     * @var ExecutionRequest
     */
    protected $request;

    /**
     * @var ExecutionRoute
     */
    protected $route;

    /**
     * @var ExecutionSession
     */
    protected $session;

    /**
     * @var ExecutionServer
     */
    protected $server;

    /**
     * @var ExecutionResponse
     */
    protected $response;

    /**
     * @var ExecutionContent
     */
    protected $content;

    /**
     * LaravelExecutionData constructor.
     */
    public function __construct()
    {
        $this->setRequest(new NullRequest());
        $this->setRoute(new NullRoute());
        $this->setSession(new NullSession());
        $this->setServer(new NullServer());
        $this->setResponse(new NullResponse());
        $this->setContent(new NullContent());
    }

    /**
     * @param ExecutionRequest $request
     * @return void
     */
    public function setRequest(ExecutionRequest $request): void
    {
        $this->request = $request;
    }

    /**
     * @return ExecutionRequest
     */
    public function request(): ExecutionRequest
    {
        return $this->request;
    }

    /**
     * @param ExecutionRoute $route
     * @return void
     */
    public function setRoute(ExecutionRoute $route): void
    {
        $this->route = $route;
    }

    /**
     * @return ExecutionRoute
     */
    public function route(): ExecutionRoute
    {
        return $this->route;
    }

    /**
     * @param ExecutionSession $session
     * @return void
     */
    public function setSession(ExecutionSession $session): void
    {
        $this->session = $session;
    }

    /**
     * @return ExecutionSession
     */
    public function session(): ExecutionSession
    {
        return $this->session;
    }

    /**
     * @param ExecutionServer $server
     * @return void
     */
    public function setServer(ExecutionServer $server): void
    {
        $this->server = $server;
    }

    /**
     * @return ExecutionServer
     */
    public function server(): ExecutionServer
    {
        return $this->server;
    }

    /**
     * @param ExecutionResponse $response
     * @return void
     */
    public function setResponse(ExecutionResponse $response): void
    {
        $this->response = $response;
    }

    /**
     * @return ExecutionResponse
     */
    public function response(): ExecutionResponse
    {
        return $this->response;
    }

    /**
     * @param ExecutionContent $content
     * @return void
     */
    public function setContent(ExecutionContent $content): void
    {
        $this->content = $content;
    }

    /**
     * @return ExecutionContent
     */
    public function content(): ExecutionContent
    {
        return $this->content;
    }
}


================================================
FILE: src/LaravelExecution/NullContent.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionContent;

class NullContent implements ExecutionContent
{
    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecution/NullRequest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionRequest;

class NullRequest implements ExecutionRequest
{
    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make([
            'type' => null,
        ]);
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecution/NullResponse.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionResponse;

class NullResponse implements ExecutionResponse
{
    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecution/NullRoute.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionRoute;

class NullRoute implements ExecutionRoute
{
    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecution/NullServer.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionServer;

class NullServer implements ExecutionServer
{
    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecution/NullSession.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelExecution;

use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Contracts\ExecutionSession;

class NullSession implements ExecutionSession
{
    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return Collection::make();
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return Collection::make();
    }
}


================================================
FILE: src/LaravelExecutionWatcher.php
================================================
<?php

namespace JKocik\Laravel\Profiler;

use JKocik\Laravel\Profiler\Contracts\ExecutionWatcher;
use JKocik\Laravel\Profiler\LaravelListeners\HttpRequestHandledListener;
use JKocik\Laravel\Profiler\LaravelListeners\ConsoleCommandFinishedListener;

class LaravelExecutionWatcher implements ExecutionWatcher
{
    /**
     * @var HttpRequestHandledListener
     */
    protected $httpRequestHandledListener;

    /**
     * @var ConsoleCommandFinishedListener
     */
    protected $consoleCommandFinishedListener;

    /**
     * LaravelExecutionWatcher constructor.
     * @param HttpRequestHandledListener $httpRequestHandledListener
     * @param ConsoleCommandFinishedListener $consoleCommandFinishedListener
     */
    public function __construct(
        HttpRequestHandledListener $httpRequestHandledListener,
        ConsoleCommandFinishedListener $consoleCommandFinishedListener
    ) {
        $this->httpRequestHandledListener = $httpRequestHandledListener;
        $this->consoleCommandFinishedListener = $consoleCommandFinishedListener;
    }

    /**
     * @return void
     */
    public function watch(): void
    {
        $this->httpRequestHandledListener->listen();
        $this->consoleCommandFinishedListener->listen();
    }
}


================================================
FILE: src/LaravelListeners/AuthListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Illuminate\Auth\Events\Logout;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Event;
use Illuminate\Database\Eloquent\Model;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;

class AuthListener implements LaravelListener
{
    /**
     * @var User
     */
    protected $user;

    /**
     * @return void
     */
    public function listen(): void
    {
        Event::listen(Logout::class, function (Logout $logout) {
            $this->user = $logout->user;
        });
    }

    /**
     * @return User|null
     */
    public function user(): ?Model
    {
        return $this->user ?? Auth::user();
    }
}


================================================
FILE: src/LaravelListeners/ConsoleCommandFinishedListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Illuminate\Support\Facades\Event;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;
use JKocik\Laravel\Profiler\LaravelExecution\ConsoleStartingRequest;
use JKocik\Laravel\Profiler\LaravelExecution\ConsoleFinishedRequest;
use JKocik\Laravel\Profiler\LaravelExecution\ConsoleStartingResponse;
use JKocik\Laravel\Profiler\LaravelExecution\ConsoleFinishedResponse;

class ConsoleCommandFinishedListener implements LaravelListener
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * ConsoleCommandFinishedListener constructor.
     * @param ExecutionData $executionData
     */
    public function __construct(ExecutionData $executionData)
    {
        $this->executionData = $executionData;
    }

    /**
     * @return void
     */
    public function listen(): void
    {
        Event::listen(\Illuminate\Console\Events\ArtisanStarting::class, function ($event) {
            $this->executionData->setRequest(new ConsoleStartingRequest());
            $this->executionData->setResponse(new ConsoleStartingResponse());
        });

        Event::listen(\Illuminate\Console\Events\CommandFinished::class, function ($event) {
            $this->executionData->setRequest(new ConsoleFinishedRequest($event->command, $event->input));
            $this->executionData->setResponse(new ConsoleFinishedResponse($event->exitCode));
        });
    }
}


================================================
FILE: src/LaravelListeners/EventsListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use JKocik\Laravel\Profiler\Events\ResetTrackers;
use JKocik\Laravel\Profiler\Services\ConfigService;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;

class EventsListener implements LaravelListener
{
    /**
     * @var Dispatcher
     */
    protected $dispatcher;

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * @var array
     */
    protected $events = [];

    /**
     * @var string
     */
    protected $previousEventName = '';

    /**
     * @var int
     */
    protected $count = 0;

    /**
     * EventsListener constructor.
     * @param Dispatcher $dispatcher
     * @param ConfigService $configService
     */
    public function __construct(Dispatcher $dispatcher, ConfigService $configService)
    {
        $this->dispatcher = $dispatcher;
        $this->configService = $configService;
    }

    /**
     * @return void
     */
    public function listen(): void
    {
        $this->listenEvents();
        $this->listenResetTrackers();
    }

    /**
     * @return Collection
     */
    public function events(): Collection
    {
        return Collection::make($this->events);
    }

    /**
     * @return int
     */
    public function count(): int
    {
        return $this->count;
    }

    /**
     * @return void
     */
    protected function listenEvents(): void
    {
        $this->dispatcher->listen('*', function ($event, $payload = null) {
            $name = $this->resolveName($event, $payload);

            if ($this->shouldSkip($name)) {
                return;
            }

            $this->count++;

            if ($this->shouldGroup($name)) {
                return $this->groupToPreviousEvent();
            }

            $this->previousEventName = $name;

            array_push($this->events, $this->resolveEvent($name, $event, $payload));
        });
    }

    /**
     * @return void
     */
    protected function listenResetTrackers(): void
    {
        $this->dispatcher->listen(ResetTrackers::class, function () {
            $this->events = [];
            $this->previousEventName = '';
            $this->count = 0;
        });
    }

    /**
     * @param string $name
     * @param $event
     * @param $payload
     * @return array
     */
    protected function resolveEvent(string $name, $event, $payload): array
    {
        if ($this->configService->isEventsDataEnabled()) {
            return [$event, $payload, $name, 1];
        }

        return [null, null, $name, 1];
    }

    /**
     * @param $event
     * @param $payload
     * @return string
     */
    protected function resolveName($event, $payload): string
    {
        return is_array($payload) ? $event : $this->dispatcher->firing();
    }

    /**
     * @param string $name
     * @return bool
     */
    protected function shouldGroup(string $name): bool
    {
        return $this->configService->isEventsGroupEnabled() && $name == $this->previousEventName;
    }

    /**
     * @return void
     */
    protected function groupToPreviousEvent(): void
    {
        $this->events[count($this->events) - 1][3]++;
    }

    /**
     * @param string $name
     * @return bool
     */
    protected function shouldSkip(string $name): bool
    {
        $shouldSkip = Collection::make([
            'bootstrapped: ' . \Illuminate\Foundation\Bootstrap\BootProviders::class,
            \JKocik\Laravel\Profiler\Events\ExceptionHandling::class,
            \JKocik\Laravel\Profiler\Events\ProfilerBound::class,
            \JKocik\Laravel\Profiler\Events\ResetTrackers::class,
            \JKocik\Laravel\Profiler\Events\Terminating::class,
            \JKocik\Laravel\Profiler\Events\Tracking::class,
        ]);

        return $shouldSkip->contains($name);
    }
}


================================================
FILE: src/LaravelListeners/ExceptionListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Throwable;
use Illuminate\Support\Facades\Event;
use JKocik\Laravel\Profiler\Events\ExceptionHandling;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;

class ExceptionListener implements LaravelListener
{
    /**
     * @var Throwable
     */
    protected $exception;

    /**
     * @return void
     */
    public function listen(): void
    {
        Event::listen(ExceptionHandling::class, function (ExceptionHandling $exceptionHandling) {
            $this->exception = $exceptionHandling->exception;
        });
    }

    public function exception(): ?Throwable
    {
        return $this->exception;
    }
}


================================================
FILE: src/LaravelListeners/HttpRequestHandledListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Event;
use Symfony\Component\HttpFoundation\Response;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;
use JKocik\Laravel\Profiler\Contracts\ExecutionRoute;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;
use JKocik\Laravel\Profiler\LaravelExecution\NullRoute;
use JKocik\Laravel\Profiler\LaravelExecution\HttpRoute;
use JKocik\Laravel\Profiler\LaravelExecution\HttpServer;
use JKocik\Laravel\Profiler\LaravelExecution\HttpSession;
use JKocik\Laravel\Profiler\LaravelExecution\HttpContent;
use JKocik\Laravel\Profiler\LaravelExecution\HttpRequest;
use JKocik\Laravel\Profiler\LaravelExecution\HttpResponse;

class HttpRequestHandledListener implements LaravelListener
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * HttpRequestHandledListener constructor.
     * @param ExecutionData $executionData
     */
    public function __construct(ExecutionData $executionData)
    {
        $this->executionData = $executionData;
    }

    /**
     * @return void
     */
    public function listen(): void
    {
        /** @codeCoverageIgnoreStart */
        Event::listen('kernel.handled', function (Request $request, Response $response) {
            $this->executionData->setRequest(new HttpRequest($request));
            $this->executionData->setRoute($this->routeOf($request));
            $this->executionData->setSession(new HttpSession(session()));
            $this->executionData->setServer(new HttpServer($request));
            $this->executionData->setResponse(new HttpResponse($response));
            $this->executionData->setContent(new HttpContent($response));
        });
        /** @codeCoverageIgnoreEnd */

        Event::listen(\Illuminate\Foundation\Http\Events\RequestHandled::class, function ($event) {
            $this->executionData->setRequest(new HttpRequest($event->request));
            $this->executionData->setRoute($this->routeOf($event->request));
            $this->executionData->setSession(new HttpSession(session()));
            $this->executionData->setServer(new HttpServer($event->request));
            $this->executionData->setResponse(new HttpResponse($event->response));
            $this->executionData->setContent(new HttpContent($event->response));
        });
    }

    /**
     * @param Request $request
     * @return ExecutionRoute
     */
    protected function routeOf(Request $request): ExecutionRoute
    {
        return $request->route() ? new HttpRoute($request->route()) : new NullRoute();
    }
}


================================================
FILE: src/LaravelListeners/PerformanceListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Application;
use Illuminate\Routing\Events\RouteMatched;
use JKocik\Laravel\Profiler\Events\Tracking;
use JKocik\Laravel\Profiler\Contracts\Timer;
use JKocik\Laravel\Profiler\Contracts\Memory;
use Illuminate\Console\Events\ArtisanStarting;
use JKocik\Laravel\Profiler\Events\Terminating;
use Illuminate\Foundation\Http\Events\RequestHandled;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;

class PerformanceListener implements LaravelListener
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var Timer
     */
    protected $timer;

    /**
     * @var Memory
     */
    protected $memory;

    /**
     * PerformanceListener constructor.
     * @param Application $app
     * @param Timer $timer
     * @param Memory $memory
     */
    public function __construct(
        Application $app,
        Timer $timer,
        Memory $memory
    ) {
        $this->app = $app;
        $this->timer = $timer;
        $this->memory = $memory;
    }

    /**
     * @return void
     */
    public function listen(): void
    {
        $this->listenHttp();
        $this->listenConsole();
    }

    /**
     * @return void
     */
    protected function listenHttp(): void
    {
        Event::listen(Tracking::class, function () {
            $this->timer->startLaravel();
        });

        $this->app->booting(function () {
            $this->timer->start('boot');
        });

        $this->app->booted(function () {
            $this->timer->finish('boot');
            $this->timer->start($this->resolveRouteName());
        });

        Event::listen(RouteMatched::class, function () {
            $this->timer->finish($this->resolveRouteName());
            $this->timer->start('request');
        });

        /** @codeCoverageIgnoreStart */
        Event::listen('kernel.handled', function () {
            $this->timer->finish('request');
            $this->timer->start('response');
        });
        /** @codeCoverageIgnoreEnd */

        Event::listen(RequestHandled::class, function () {
            $this->timer->finish('request');
            $this->timer->start('response');
        });

        Event::listen(Terminating::class, function () {
            $this->memory->recordPeak();
            $this->timer->finish('response');
            $this->timer->finishLaravel();
        });
    }

    /**
     * @return void
     */
    protected function listenConsole(): void
    {
        Event::listen(ArtisanStarting::class, function () {
            $this->timer->start('command');
        });

        Event::listen(Terminating::class, function () {
            $this->timer->finish('command');
        });
    }

    /**
     * @return string
     */
    protected function resolveRouteName(): string
    {
        if ($this->app->runningUnitTests()) {
            return 'setup';
        }

        return 'route';
    }
}


================================================
FILE: src/LaravelListeners/QueriesListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Event;
use Illuminate\Database\Events\QueryExecuted;
use JKocik\Laravel\Profiler\Events\ResetTrackers;
use Illuminate\Database\Events\TransactionBeginning;
use Illuminate\Database\Events\TransactionCommitted;
use Illuminate\Database\Events\TransactionRolledBack;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;

class QueriesListener implements LaravelListener
{
    /**
     * @var array
     */
    protected $queries = [];

    /**
     * @var int
     */
    protected $count = 0;

    /**
     * @return void
     */
    public function listen(): void
    {
        $this->listenQueries();
        $this->listenTransactions();
        $this->listenResetTrackers();
    }

    /**
     * @return Collection
     */
    public function queries(): Collection
    {
        return Collection::make($this->queries);
    }

    /**
     * @return int
     */
    public function count(): int
    {
        return $this->count;
    }

    /**
     * @return void
     */
    protected function listenQueries(): void
    {
        Event::listen(QueryExecuted::class, function (QueryExecuted $event) {
            $this->count++;

            list($bindings, $bindingsQuoted) = $this->formatBindings($event);

            array_push($this->queries, [
                'query',
                $event->sql,
                $event->time,
                $event->connection->getDatabaseName(),
                $event->connectionName,
                $bindings,
                $bindingsQuoted,
            ]);
        });
    }

    /**
     * @return void
     */
    protected function listenTransactions(): void
    {
        Event::listen(TransactionBeginning::class, function (TransactionBeginning $event) {
            array_push($this->queries, [
                'transaction-begin',
                $event->connection->getDatabaseName(),
                $event->connectionName,
            ]);
        });

        Event::listen(TransactionCommitted::class, function (TransactionCommitted $event) {
            array_push($this->queries, [
                'transaction-commit',
                $event->connection->getDatabaseName(),
                $event->connectionName,
            ]);
        });

        Event::listen(TransactionRolledBack::class, function (TransactionRolledBack $event) {
            array_push($this->queries, [
                'transaction-rollback',
                $event->connection->getDatabaseName(),
                $event->connectionName,
            ]);
        });
    }

    /**
     * @return void
     */
    protected function listenResetTrackers(): void
    {
        Event::listen(ResetTrackers::class, function () {
            $this->queries = [];
            $this->count = 0;
        });
    }

    /**
     * @param QueryExecuted $event
     * @return array
     */
    protected function formatBindings(QueryExecuted $event): array
    {
        $preparedBindings = $event->connection->prepareBindings($event->bindings);

        foreach ($preparedBindings as $key => $binding) {
            $bindings[$key] = $this->truncate($binding);
            $bindingsQuoted[$key] = $this->quote($event, $bindings[$key]);
        }

        return [
            $bindings ?? [],
            $bindingsQuoted ?? [],
        ];
    }

    /**
     * @param $binding
     * @return mixed
     */
    protected function truncate($binding)
    {
        if (is_string($binding) && strlen($binding) > 255) {
            return substr($binding, 0, 255) . '...{truncated}';
        }

        return $binding;
    }

    /**
     * @param QueryExecuted $event
     * @param $binding
     * @return mixed
     */
    protected function quote(QueryExecuted $event, $binding)
    {
        if (is_int($binding) || is_float($binding) || is_object($binding)) {
            return $binding;
        }

        return $event->connection->getPdo()->quote($binding);
    }
}


================================================
FILE: src/LaravelListeners/RedisListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Event;
use Illuminate\Redis\Events\CommandExecuted;
use JKocik\Laravel\Profiler\Events\ResetTrackers;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;

class RedisListener implements LaravelListener
{
    /**
     * @var array
     */
    protected $commands = [];

    /**
     * @var int
     */
    protected $count = 0;

    /**
     * @return void
     */
    public function listen(): void
    {
        $this->listenCommands();
        $this->listenResetTrackers();
    }

    /**
     * @return Collection
     */
    public function commands(): Collection
    {
        return Collection::make($this->commands);
    }

    /**
     * @return int
     */
    public function count(): int
    {
        return $this->count;
    }

    /**
     * @return void
     */
    protected function listenCommands(): void
    {
        Event::listen(CommandExecuted::class, function (CommandExecuted $event) {
            $this->count++;

            array_push($this->commands, [
                $event->command,
                $event->time,
                $event->connectionName,
                $event->parameters,
            ]);
        });
    }

    /**
     * @return void
     */
    protected function listenResetTrackers(): void
    {
        Event::listen(ResetTrackers::class, function () {
            $this->commands = [];
            $this->count = 0;
        });
    }
}


================================================
FILE: src/LaravelListeners/ViewsListener.php
================================================
<?php

namespace JKocik\Laravel\Profiler\LaravelListeners;

use Illuminate\View\View;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Event;
use JKocik\Laravel\Profiler\Events\ResetTrackers;
use JKocik\Laravel\Profiler\Contracts\LaravelListener;

class ViewsListener implements LaravelListener
{
    /**
     * @var array
     */
    protected $views = [];

    /**
     * @return void
     */
    public function listen(): void
    {
        $this->listenViews();
        $this->listenResetTrackers();
    }

    /**
     * @return Collection
     */
    public function views(): Collection
    {
        return Collection::make($this->views);
    }

    /**
     * @return void
     */
    protected function listenViews(): void
    {
        Event::listen('composing:*', function (...$view) {
            array_push($this->views, $this->resolveView($view));
        });
    }

    /**
     * @return void
     */
    protected function listenResetTrackers(): void
    {
        Event::listen(ResetTrackers::class, function () {
            $this->views = [];
        });
    }

    /**
     * @param array $view
     * @return View
     */
    protected function resolveView(array $view): View
    {
        return $view[1][0] ?? $view[0];
    }
}


================================================
FILE: src/LaravelProfiler.php
================================================
<?php

namespace JKocik\Laravel\Profiler;

use JKocik\Laravel\Profiler\Events\Tracking;
use JKocik\Laravel\Profiler\Contracts\Timer;
use JKocik\Laravel\Profiler\Contracts\Memory;
use JKocik\Laravel\Profiler\Events\Terminating;
use JKocik\Laravel\Profiler\Events\ProfilerBound;
use Illuminate\Foundation\Bootstrap\BootProviders;
use JKocik\Laravel\Profiler\Contracts\DataTracker;
use JKocik\Laravel\Profiler\Contracts\DataProcessor;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;
use JKocik\Laravel\Profiler\Contracts\ExecutionWatcher;
use JKocik\Laravel\Profiler\Services\Performance\TimerService;
use JKocik\Laravel\Profiler\Services\Performance\MemoryService;
use JKocik\Laravel\Profiler\LaravelExecution\LaravelExecutionData;

class LaravelProfiler extends BaseProfiler
{
    /**
     * @var DataTracker
     */
    protected $dataTracker;

    /**
     * @return void
     */
    protected function boot(): void
    {
        $this->bind();

        $this->track();

        $this->listenForTerminating();
    }

    /**
     * @return void
     */
    protected function bind(): void
    {
        $this->app->bind(DataTracker::class, LaravelDataTracker::class);

        $this->app->bind(DataProcessor::class, LaravelDataProcessor::class);

        $this->app->bind(ExecutionWatcher::class, LaravelExecutionWatcher::class);

        $this->app->singleton(ExecutionData::class, function ($app) {
            return $app->make(LaravelExecutionData::class);
        });

        $this->app->singleton(Timer::class, function ($app) {
            return $app->make(TimerService::class);
        });

        $this->app->singleton(Memory::class, function ($app) {
            return $app->make(MemoryService::class);
        });

        event(new ProfilerBound());
    }

    /**
     * @return void
     */
    protected function track(): void
    {
        $this->app->make(ExecutionWatcher::class)->watch();

        $this->dataTracker = $this->app->make(DataTracker::class);
        $this->dataTracker->track();

        event(new Tracking());
    }

    /**
     * @return void
     */
    protected function listenForTerminating(): void
    {
        $this->app->afterBootstrapping(BootProviders::class, function () {
            $this->registerTerminating();
        });
    }

    /**
     * @return void
     */
    protected function registerTerminating(): void
    {
        $this->app->terminating(function () {
            event(new Terminating());

            $this->dataTracker->terminate();
            $this->app->make(DataProcessor::class)->process($this->dataTracker);
        });
    }
}


================================================
FILE: src/Processors/BroadcastingProcessor.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Processors;

use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Response;
use JKocik\Laravel\Profiler\Contracts\Processor;
use JKocik\Laravel\Profiler\Contracts\DataTracker;
use JKocik\Laravel\Profiler\Services\ConfigService;

class BroadcastingProcessor implements Processor
{
    /**
     * @var Client
     */
    protected $client;

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * BroadcastingProcessor constructor.
     * @param Client $client
     * @param ConfigService $configService
     */
    public function __construct(Client $client, ConfigService $configService)
    {
        $this->client = $client;
        $this->configService = $configService;
    }

    /**
     * @param DataTracker $dataTracker
     * @return void
     */
    public function process(DataTracker $dataTracker): void
    {
        $this->broadcast(
            $dataTracker,
            $this->configService->serverHttpConnectionUrl()
        );
    }

    /**
     * @param DataTracker $dataTracker
     * @param string $url
     * @return Response
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    protected function broadcast(DataTracker $dataTracker, string $url): Response
    {
        return $this->client->request('POST', $url, [
            'json' => [
                'meta' => $dataTracker->meta()->toArray(),
                'data' => $dataTracker->data()->toArray(),
            ],
        ]);
    }
}


================================================
FILE: src/Processors/StatusCommandProcessor.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Processors;

use GuzzleHttp\Exception\ConnectException;
use JKocik\Laravel\Profiler\Contracts\DataTracker;
use JKocik\Laravel\Profiler\Events\ProfilerServerConnectionFailed;
use JKocik\Laravel\Profiler\Events\ProfilerServerConnectionSuccessful;

class StatusCommandProcessor extends BroadcastingProcessor
{
    /**
     * @param DataTracker $dataTracker
     * @return void
     */
    public function process(DataTracker $dataTracker): void
    {
        try {
            $response = $this->broadcast(
                $dataTracker,
                $this->configService->serverHttpConnectionUrl() . '/status'
            );

            $body = json_decode($response->getBody());

            event(new ProfilerServerConnectionSuccessful($body->sockets, $body->clients));
        } catch (ConnectException $e) {
            event(new ProfilerServerConnectionFailed());
            throw $e;
        }
    }
}


================================================
FILE: src/ProfilerResolver.php
================================================
<?php

namespace JKocik\Laravel\Profiler;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\Profiler;
use JKocik\Laravel\Profiler\Services\ConfigService;

class ProfilerResolver
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * ProfilerResolver constructor.
     * @param Application $app
     * @param ConfigService $configService
     */
    public function __construct(Application $app, ConfigService $configService)
    {
        $this->app = $app;
        $this->configService = $configService;
    }

    /**
     * @return Profiler
     */
    public function resolve(): Profiler
    {
        if (! $this->configService->isProfilerEnabled()) {
            return $this->app->make(DisabledProfiler::class);
        }

        return $this->app->make(LaravelProfiler::class);
    }
}


================================================
FILE: src/ServiceProvider.php
================================================
<?php

namespace JKocik\Laravel\Profiler;

use JKocik\Laravel\Profiler\Contracts\Profiler;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;

class ServiceProvider extends BaseServiceProvider
{
    /**
     * @return void
     */
    public function register(): void
    {
        $this->mergeConfigFrom(static::profilerConfigPath(), 'profiler');

        $this->app->singleton(Profiler::class, function ($app) {
            return $app->make(ProfilerResolver::class)->resolve();
        });

        $this->app->make(Profiler::class)->listenForBoot();
    }

    /**
     * @return void
     */
    public function boot(): void
    {
        $this->allowConfigFileToBePublished();
    }

    /**
     * @return void
     */
    public function allowConfigFileToBePublished(): void
    {
        $this->publishes([
            static::profilerConfigPath() => config_path('profiler.php'),
        ]);
    }

    /**
     * @return string
     */
    public static function profilerConfigPath(): string
    {
        return __DIR__ . '/../config/profiler.php';
    }
}


================================================
FILE: src/Services/ConfigService.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services;

use Illuminate\Config\Repository;
use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;

class ConfigService
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var Repository
     */
    protected $config;

    /**
     * ConfigService constructor.
     * @param Application $app
     * @param Repository $config
     */
    public function __construct(Application $app, Repository $config)
    {
        $this->app = $app;
        $this->config = $config;
    }

    /**
     * @return bool
     */
    public function isProfilerEnabled(): bool
    {
        $enabledOverrides = Collection::make($this->config->get('profiler.enabled_overrides'));
        $envToDisable = $enabledOverrides->filter(function ($enabled) {
            return ! $enabled;
        })->keys();

        if ($this->app->environment($envToDisable->toArray())) {
            return false;
        }

        return $this->config->get('profiler.enabled') === true;
    }

    /**
     * @return Collection
     */
    public function trackers(): Collection
    {
        return Collection::make($this->config->get('profiler.trackers'));
    }

    /**
     * @return Collection
     */
    public function processors(): Collection
    {
        return Collection::make($this->config->get('profiler.processors'));
    }

    /**
     * @param array $processors
     */
    public function overrideProcessors(array $processors): void
    {
        $this->config->set('profiler.processors', $processors);
    }

    /**
     * @return Collection
     */
    public function pathsToTurnOffProcessors(): Collection
    {
        return Collection::make($this->config->get('profiler.turn_off_processors_for_paths'));
    }

    /**
     * @return string
     */
    public function serverHttpConnectionUrl(): string
    {
        $address = $this->config->get('profiler.server_http.address');
        $port = $this->config->get('profiler.server_http.port');

        return  $address . ':' . $port;
    }

    /**
     * @return string
     */
    public function serverHttpPort(): string
    {
        return $this->config->get('profiler.server_http.port');
    }

    /**
     * @return string
     */
    public function serverSocketsPort(): string
    {
        return $this->config->get('profiler.server_sockets.port');
    }

    /**
     * @return bool
     */
    public function isViewsDataEnabled(): bool
    {
        return $this->config->get('profiler.data.views');
    }

    /**
     * @return bool
     */
    public function isEventsDataEnabled(): bool
    {
        return $this->config->get('profiler.data.events');
    }

    /**
     * @return bool
     */
    public function isEventsGroupEnabled(): bool
    {
        return $this->config->get('profiler.group.events');
    }

    /**
     * @param int $level
     * @return bool
     */
    public function handleExceptions(int $level): bool
    {
        return $this->config->get('profiler.handle_exceptions') === $level;
    }
}


================================================
FILE: src/Services/ConsoleService.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services;

use Illuminate\Foundation\Application;

class ConsoleService
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * ConsoleService constructor.
     * @param Application $app
     * @param ConfigService $configService
     */
    public function __construct(Application $app, ConfigService $configService)
    {
        $this->app = $app;
        $this->configService = $configService;
    }

    /**
     * @return string
     */
    public function envInfo(): string
    {
        return "Your current environment is: {$this->app->environment()}";
    }

    /**
     * @return string
     */
    public function profilerStatusInfo(): string
    {
        $status = $this->configService->isProfilerEnabled() ? 'enabled' : 'disabled';

        return "Laravel Profiler is: {$status}";
    }

    /**
     * @return string
     */
    public function trackersStatusInfo(): string
    {
        return "You have {$this->configService->trackers()->count()} tracker(s) turned on";
    }

    /**
     * @return string
     */
    public function trackersCommentLine1(): string
    {
        return 'There are 14 trackers available out of the box';
    }

    /**
     * @return string
     */
    public function trackersCommentLine2(): string
    {
        return 'turn them on and off in profiler.php configuration file';
    }

    /**
     * @return string
     */
    public function connectionStatusInfo(): string
    {
        return "Trying to connect to Profiler Server on {$this->configService->serverHttpConnectionUrl()} ...";
    }

    /**
     * @return string
     */
    public function connectionSuccessfulInfo(): string
    {
        return 'Connected successfully';
    }

    /**
     * @param int $socketsPort
     * @return string
     */
    public function connectionSuccessfulSocketsInfo(int $socketsPort): string
    {
        return "Profiler Server sockets listening on port: {$socketsPort}";
    }

    /**
     * @param int $countClients
     * @return string
     */
    public function connectionSuccessfulClientsInfo(int $countClients): string
    {
        return "You have {$countClients} Profiler Client(s) connected at the moment";
    }

    /**
     * @return string
     */
    public function connectionFailedInfo(): string
    {
        return 'Connection failed';
    }

    /**
     * @return string
     */
    public function connectionStatusUnknownInfo(): string
    {
        return 'BroadcastingProcessor did not report connection status, connection status is unknown';
    }

    /**
     * @return string
     */
    public function profilerServerCmd(): string
    {
        $http = $this->configService->serverHttpPort();
        $ws = $this->configService->serverSocketsPort();

        return "node node_modules/laravel-profiler-client/server/server.js http={$http} ws={$ws}";
    }

    /**
     * @param bool $manual
     * @return string
     */
    public function profilerClientCmd(bool $manual): string
    {
        $options = $manual ? '' : ' -o -s';

        return "node_modules/.bin/http-server node_modules/laravel-profiler-client/dist/{$options}";
    }
}


================================================
FILE: src/Services/GeneratorService.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services;

class GeneratorService
{
    /**
     * @return string
     */
    public function unique32CharsId(): string
    {
        return md5(uniqid('', true));
    }
}


================================================
FILE: src/Services/LogService.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services;

use Exception;
use Illuminate\Support\Facades\Log;

class LogService
{
    const HANDLE_EXCEPTIONS_LOG = 1;
    const HANDLE_EXCEPTIONS_THROW = 666;

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * LogService constructor.
     * @param ConfigService $configService
     */
    public function __construct(ConfigService $configService)
    {
        $this->configService = $configService;
    }

    /**
     * @param Exception $e
     * @throws Exception
     * @return void
     */
    public function error(Exception $e): void
    {
        if ($this->configService->handleExceptions(self::HANDLE_EXCEPTIONS_THROW)) {
            throw $e;
        }

        if ($this->configService->handleExceptions(self::HANDLE_EXCEPTIONS_LOG)) {
            Log::error($e);
        }
    }
}


================================================
FILE: src/Services/ParamsService.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services;

use Illuminate\Support\Collection;

class ParamsService
{
    /**
     * @param $param
     * @return mixed
     */
    public function resolve($param)
    {
        if (is_object($param)) {
            return $this->resolveObject($param);
        }

        if (is_array($param)) {
            return array_map(function ($item) {
                return $this->resolve($item);
            }, $param);
        }

        return $param;
    }

    /**
     * @param array $params
     * @return array
     */
    public function resolveFlattenFromArray(array $params): array
    {
        return array_map(function ($param) {
            return $this->resolveFlatten($param);
        }, $params);
    }

    /**
     * @param $param
     * @return string
     */
    protected function resolveFlatten($param): string
    {
        if ($param instanceof Collection) {
            return get_class($param) . ': ' . $param->count() . ' item(s)';
        }

        if (is_object($param)) {
            return get_class($param);
        }

        if (is_array($param)) {
            return 'array: ' . count($param) . ' item(s)';
        }

        return gettype($param);
    }

    /**
     * @param $param
     * @return array|string
     */
    protected function resolveObject($param)
    {
        if (method_exists($param, 'toArray')) {
            return $this->resolve($param->toArray());
        }

        return get_class($param);
    }
}


================================================
FILE: src/Services/Performance/MemoryService.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services\Performance;

use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\Memory;

class MemoryService implements Memory
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var Collection
     */
    protected $memory;

    /**
     * MemoryService constructor.
     * @param Application $app
     */
    public function __construct(Application $app)
    {
        $this->app = $app;
        $this->memory = Collection::make();
    }

    /**
     * @return void
     */
    public function recordPeak(): void
    {
        $this->memory->put('peak', memory_get_peak_usage());
    }

    /**
     * @return Collection
     */
    public function all(): Collection
    {
        return $this->memory;
    }
}


================================================
FILE: src/Services/Performance/NullTimerService.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services\Performance;

use JKocik\Laravel\Profiler\Contracts\Timer;

class NullTimerService implements Timer
{
    /**
     * @param string $name
     * @return void
     */
    public function startCustom(string $name): void
    {

    }

    /**
     * @param string $name
     * @return void
     */
    public function finishCustom(string $name): void
    {

    }

    /**
     * @param string $name
     * @return float
     */
    public function millisecondsCustom(string $name): float
    {
        return -1;
    }
}


================================================
FILE: src/Services/Performance/TimerException.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services\Performance;

use Exception;

class TimerException extends Exception
{

}


================================================
FILE: src/Services/Performance/TimerService.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Services\Performance;

use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\Timer;

class TimerService implements Timer
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var Collection
     */
    protected $time;

    /**
     * @var string
     */
    protected $customNamePrefix = 'custom-';

    /**
     * TimerService constructor.
     * @param Application $app
     */
    public function __construct(Application $app)
    {
        $this->app = $app;
        $this->time = Collection::make();
    }

    /**
     * @param string $name
     * @return void
     */
    public function start(string $name): void
    {
        $this->time->put($name, [
            'start' => $this->now(),
        ]);
    }

    /**
     * @param string $name
     * @return void
     */
    public function finish(string $name): void
    {
        $this->time->put($name, array_merge($this->getByName($name), [
            'finish' => $this->now(),
        ]));
    }

    /**
     * @param string $name
     * @return void
     * @throws TimerException
     */
    public function startCustom(string $name): void
    {
        $customName = $this->customNamePrefix . $name;

        $this->guardTimerAlreadyStarted($customName);

        $this->start($customName);
    }

    /**
     * @param string $name
     * @return void
     * @throws TimerException
     */
    public function finishCustom(string $name): void
    {
        $customName = $this->customNamePrefix . $name;

        $this->guardTimerAlreadyFinished($customName);

        $this->guardTimerNotStartedYet($customName);

        $this->finish($customName);
    }

    /**
     * @return void
     */
    public function startLaravel(): void
    {
        $this->time->put('laravel', [
            'start' => $this->laravelStartTimeOrNow(),
        ]);
    }

    /**
     * @return void
     */
    public function finishLaravel(): void
    {
        $this->finish('laravel');
    }

    /**
     * @param string $name
     * @return float
     */
    public function milliseconds(string $name): float
    {
        return $this->millisecondsOf(
            $this->getByName($name)
        );
    }

    /**
     * @param string $name
     * @return float
     */
    public function millisecondsCustom(string $name): float
    {
        return $this->milliseconds($this->customNamePrefix . $name);
    }

    /**
     * @return array
     */
    public function all(): array
    {
        return $this->time->filter(function ($item) {
            return $this->isCompleted($item);
        })->map(function ($item) {
            return $this->millisecondsOf($item);
        })->toArray();
    }

    /**
     * @return float
     */
    protected function now(): float
    {
        return \microtime(true);
    }

    /**
     * @return float
     */
    protected function laravelStartTimeOrNow(): float
    {
        return defined('LARAVEL_START') && ! $this->app->environment('testing')
            ? LARAVEL_START
            : $this->now();
    }

    /**
     * @param string $name
     * @return array
     */
    protected function getByName(string $name): array
    {
        return $this->time->first(function ($a, $b) use ($name) {
            return $a === $name || $b === $name;
        }) ?? [];
    }

    /**
     * @param array $item
     * @return float
     */
    protected function millisecondsOf(array $item): float
    {
        if (! $this->isCompleted($item)) {
            return -1;
        }

        return ($item['finish'] - $item['start']) * 1000;
    }

    /**
     * @param array $item
     * @return bool
     */
    protected function isCompleted(array $item): bool
    {
        return isset($item['start']) && isset($item['finish']);
    }

    /**
     * @param string $name
     * @return void
     * @throws TimerException
     */
    protected function guardTimerAlreadyStarted(string $name): void
    {
        if ($this->time->has($name)) {
            throw new TimerException("Laravel Profiler custom time tracker for {$name} already exists and can not be started twice");
        }
    }

    /**
     * @param string $name
     * @return void
     * @throws TimerException
     */
    protected function guardTimerAlreadyFinished(string $name): void
    {
        if ($this->isCompleted($this->getByName($name))) {
            throw new TimerException("Laravel Profiler custom time tracker for {$name} already exists and can not be finished twice");
        }
    }

    /**
     * @param string $name
     * @return void
     * @throws TimerException
     */
    protected function guardTimerNotStartedYet(string $name): void
    {
        if (! $this->time->has($name)) {
            throw new TimerException("Laravel Profiler custom time tracker for {$name} is not started yet");
        }
    }
}


================================================
FILE: src/Services/helpers.php
================================================
<?php

use JKocik\Laravel\Profiler\Contracts\Timer;
use JKocik\Laravel\Profiler\Contracts\Profiler;
use JKocik\Laravel\Profiler\Services\LogService;
use JKocik\Laravel\Profiler\Services\Performance\TimerException;

if (! function_exists('profiler_start')) {
    function profiler_start(string $name): void
    {
        try {
            app()->make(Timer::class)->startCustom($name);
        } catch (TimerException $e) {
            app()->make(LogService::class)->error($e);
        }
    }
}

if (! function_exists('profiler_finish')) {
    function profiler_finish(string $name): void
    {
        try {
            app()->make(Timer::class)->finishCustom($name);
        } catch (TimerException $e) {
            app()->make(LogService::class)->error($e);
        }
    }
}

if (! function_exists('profiler_reset')) {
    function profiler_reset(): void
    {
        app()->make(Profiler::class)->resetTrackers();
    }
}


================================================
FILE: src/Trackers/ApplicationTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Services\GeneratorService;

class ApplicationTracker extends BaseTracker
{
    /**
     * @var GeneratorService
     */
    protected $generatorService;

    /**
     * ApplicationTracker constructor.
     * @param Application $app
     * @param GeneratorService $generatorService
     */
    public function __construct(Application $app, GeneratorService $generatorService)
    {
        parent::__construct($app);

        $this->generatorService = $generatorService;
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $this->meta->put('execution_at', time());
        $this->meta->put('id', $this->generatorService->unique32CharsId());
        $this->meta->put('laravel_version', $this->app->version());
        $this->meta->put('php_version', phpversion());
        $this->meta->put('env', $this->app->environment());
        $this->meta->put('is_running_in_console', $this->app->runningInConsole());

        $this->data->put('application', Collection::make([
            'locale' => $this->app->getLocale(),
            'configuration_is_cached' => $this->app->configurationIsCached(),
            'routes_are_cached' => $this->app->routesAreCached(),
            'is_down_for_maintenance' => $this->app->isDownForMaintenance(),
            'should_skip_middleware' => $this->app->shouldSkipMiddleware(),
        ]));
    }
}


================================================
FILE: src/Trackers/AuthTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\LaravelListeners\AuthListener;

class AuthTracker extends BaseTracker
{
    /**
     * @var AuthListener
     */
    protected $authListener;

    /**
     * AuthTracker constructor.
     * @param Application $app
     * @param AuthListener $authListener
     */
    public function __construct(Application $app, AuthListener $authListener)
    {
        parent::__construct($app);

        $this->authListener = $authListener;
        $this->authListener->listen();
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $this->data->put('auth', $this->authListener->user());
    }
}


================================================
FILE: src/Trackers/BaseTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\Tracker;

abstract class BaseTracker implements Tracker
{
    /**
     * @var Application
     */
    protected $app;

    /**
     * @var Collection
     */
    protected $meta;

    /**
     * @var Collection
     */
    protected $data;

    /**
     * BaseTracker constructor.
     * @param Application $app
     */
    public function __construct(Application $app)
    {
        $this->app = $app;
        $this->meta = new Collection();
        $this->data = new Collection();
    }

    /**
     * @return Collection
     */
    public function meta(): Collection
    {
        return $this->meta;
    }

    /**
     * @return Collection
     */
    public function data(): Collection
    {
        return $this->data;
    }
}


================================================
FILE: src/Trackers/BindingsTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Collection;
use Illuminate\Contracts\Container\BindingResolutionException;

class BindingsTracker extends BaseTracker
{
    /**
     * @return void
     */
    public function terminate(): void
    {
        $bindings = $this->abstracts()->map(function ($abstract) {
            try {
                $resolved = $this->resolved($abstract);
            } catch (BindingResolutionException $e) {}

            return [
                'abstract' => $abstract,
                'resolved' => $resolved ?? null,
            ];
        });

        $this->data->put('bindings', $bindings);
    }

    /**
     * @return Collection
     */
    protected function abstracts(): Collection
    {
        return Collection::make(
            array_keys($this->app->getBindings())
        );
    }

    /**
     * @param string $abstract
     * @return string
     * @throws BindingResolutionException
     */
    protected function resolved(string $abstract): string
    {
        if (! $this->app->resolved($abstract)) {
            throw new BindingResolutionException();
        }

        $concrete = $this->app->make($abstract);

        if (is_object($concrete)) {
            return get_class($concrete);
        }

        return gettype($concrete);
    }
}


================================================
FILE: src/Trackers/ConfigTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Collection;

class ConfigTracker extends BaseTracker
{
    /**
     * @return void
     */
    public function terminate(): void
    {
        $this->data->put('config', $this->config());
    }

    /**
     * @return Collection
     */
    protected function config(): Collection
    {
        return Collection::make(
            $this->hideSecretValues(
                $this->app->make('config')->all()
            )
        );
    }

    /**
     * @param array $config
     * @return array
     */
    protected function hideSecretValues(array $config): array
    {
        $keys = array_keys($config);

        return array_map(function ($value) use (&$keys) {
            $key = array_shift($keys);

            if (is_array($value)) {
                return $this->hideSecretValues($value);
            }

            if (is_string($value) && preg_match('/^(password|key|secret)$/i', $key)) {
                $value = str_repeat('*', strlen($value));
            }

            return $value;
        }, $config);
    }
}


================================================
FILE: src/Trackers/ContentTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;

class ContentTracker extends BaseTracker
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * ContentTracker constructor.
     * @param Application $app
     * @param ExecutionData $executionData
     */
    public function __construct(Application $app, ExecutionData $executionData)
    {
        parent::__construct($app);

        $this->executionData = $executionData;
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $content = $this->executionData->content();

        $this->meta = $content->meta();
        $this->data->put('content', $content->data()->get('content'));
    }
}


================================================
FILE: src/Trackers/EventsTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Services\ConfigService;
use JKocik\Laravel\Profiler\Services\ParamsService;
use JKocik\Laravel\Profiler\LaravelListeners\EventsListener;

class EventsTracker extends BaseTracker
{
    /**
     * @var ParamsService
     */
    protected $paramsService;

    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * @var EventsListener
     */
    protected $eventsListener;

    /**
     * EventsTracker constructor.
     * @param Application $app
     * @param ParamsService $paramsService
     * @param ConfigService $configService
     * @param EventsListener $eventsListener
     */
    public function __construct(
        Application $app,
        ParamsService $paramsService,
        ConfigService $configService,
        EventsListener $eventsListener
    ) {
        parent::__construct($app);

        $this->paramsService = $paramsService;
        $this->configService = $configService;
        $this->eventsListener = $eventsListener;
        $this->eventsListener->listen();
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $events = $this->eventsListener->events()->map(function ($item) {
            list($event, $payload, $name, $count) = $item;

            if ($this->shouldTrackData($count)) {
                return [
                    'name' => $name,
                    'count' => $count,
                    'data' => $this->resolveData($event, $payload),
                ];
            }

            return [
                'name' => $name,
                'count' => $count,
            ];
        });

        $this->meta->put('events_count', $this->eventsListener->count());
        $this->data->put('events', $events);
    }

    /**
     * @param int $count
     * @return bool
     */
    protected function shouldTrackData(int $count): bool
    {
        return $this->configService->isEventsDataEnabled() && $count == 1;
    }

    /**
     * @param $event
     * @param $payload
     * @return Collection
     */
    protected function resolveData($event, $payload): Collection
    {
        $event = is_array($payload) ? $payload[0] : $event;

        $class = new \ReflectionClass($event);

        $publicProps = Collection::make(
            $class->getProperties(\ReflectionProperty::IS_PUBLIC)
        );

        if (method_exists($publicProps, 'mapWithKeys')) {
            return $this->propsMapWithKeys($publicProps, $event);
        }

        return $this->propsMap($publicProps, $event); // @codeCoverageIgnore
    }

    /**
     * @param Collection $publicProps
     * @param $event
     * @return Collection
     */
    protected function propsMapWithKeys(Collection $publicProps, $event): Collection
    {
        return $publicProps->mapWithKeys(function ($prop) use ($event) {
            return [
                $prop->name => $this->paramsService->resolve($event->{$prop->name}),
            ];
        });
    }

    /**
     * @codeCoverageIgnore
     *
     * @param Collection $publicProps
     * @param $event
     * @return Collection
     */
    protected function propsMap(Collection $publicProps, $event): Collection
    {
        return $publicProps->map(function ($prop) use ($event) {
            return [
                $prop->name => $this->paramsService->resolve($event->{$prop->name}),
            ];
        })->flatten(1);
    }
}


================================================
FILE: src/Trackers/ExceptionTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\LaravelListeners\ExceptionListener;
use JKocik\Laravel\Profiler\LaravelExecution\ExceptionHandlerTillVersion6;
use JKocik\Laravel\Profiler\LaravelExecution\ExceptionHandlerFromVersion7;

class ExceptionTracker extends BaseTracker
{
    /**
     * @var ExceptionListener
     */
    protected $exceptionListener;

    /**
     * ExceptionTracker constructor.
     * @param Application $app
     * @param ExceptionListener $exceptionListener
     */
    public function __construct(Application $app, ExceptionListener $exceptionListener)
    {
        parent::__construct($app);

        $this->exceptionListener = $exceptionListener;
        $this->exceptionListener->listen();

        $this->bindExceptionHandler($app);
    }

    /**
     * @param Application $app
     * @return void
     */
    protected function bindExceptionHandler(Application $app): void
    {
        $version = (int) $app->version();

        $handler = $version < 7
            ? ExceptionHandlerTillVersion6::class
            : ExceptionHandlerFromVersion7::class; // @codeCoverageIgnore

        $app->singleton(\App\Exceptions\Handler::class, $handler);
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $exception = $this->exceptionListener->exception() ? $this->exception() : null;

        $this->data->put('exception', $exception);
    }

    /**
     * @return Collection
     */
    protected function exception(): Collection
    {
        $exception = $this->exceptionListener->exception();

        return Collection::make([
            'message' => $exception->getMessage(),
            'exception' => get_class($exception),
            'file' => $exception->getFile(),
            'line' => $exception->getLine(),
            'trace' => Collection::make($exception->getTrace())->map(function ($trace) {
                return Arr::except($trace, ['args', 'type']);
            }),
        ]);
    }
}


================================================
FILE: src/Trackers/PathsTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Collection;

class PathsTracker extends BaseTracker
{
    /**
     * @return void
     */
    public function terminate(): void
    {
        $paths = $this->paths()->map(function ($path, $name) {
            return [
                'name' => $name,
                'path' => $path,
            ];
        })->values();

        $this->data->put('paths', $paths);
    }

    /**
     * @return Collection
     */
    protected function paths(): Collection
    {
        return Collection::make([
            'app_path' => $this->app->path(),
            'base_path' => $this->app->basePath(),
            'lang_path' => $this->app->langPath(),
            'config_path' => $this->app->configPath(),
            'public_path' => $this->app->publicPath(),
            'storage_path' => $this->app->storagePath(),
            'resource_path' => $this->resourcePath(),
            'database_path' => $this->app->databasePath(),
            'bootstrap_path' => $this->app->bootstrapPath(),
            'cached_config_path' => $this->app->getCachedConfigPath(),
            'cached_routes_path' => $this->app->getCachedRoutesPath(),
            'cached_services_path' => $this->app->getCachedServicesPath(),
            'cached_packages_path' => $this->getCachedPackagesPath(),
            'environment_file_path' => $this->app->environmentFilePath(),
        ])->filter(function ($item) {
            return !! $item;
        });
    }

    /**
     * @return string
     */
    protected function resourcePath(): string
    {
        return method_exists($this->app, 'resourcePath')
            ? $this->app->resourcePath()
            : '';
    }

    /**
     * @return string
     */
    protected function getCachedPackagesPath(): string
    {
        return method_exists($this->app, 'getCachedPackagesPath')
            ? $this->app->getCachedPackagesPath()
            : '';
    }
}


================================================
FILE: src/Trackers/PerformanceTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\Timer;
use JKocik\Laravel\Profiler\Contracts\Memory;
use JKocik\Laravel\Profiler\LaravelListeners\PerformanceListener;

class PerformanceTracker extends BaseTracker
{
    /**
     * @var Timer
     */
    protected $timer;

    /**
     * @var Memory
     */
    protected $memory;

    /**
     * PerformanceTracker constructor.
     * @param Application $app
     * @param Timer $timer
     * @param Memory $memory
     * @param PerformanceListener $performanceListener
     */
    public function __construct(
        Application $app,
        Timer $timer,
        Memory $memory,
        PerformanceListener $performanceListener
    ) {
        parent::__construct($app);

        $this->timer = $timer;
        $this->memory = $memory;
        $performanceListener->listen();
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $this->data->put('performance', Collection::make([
            'timer' => $this->timer->all(),
            'memory' => $this->memory->all(),
        ]));
    }
}


================================================
FILE: src/Trackers/QueriesTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\LaravelListeners\QueriesListener;

class QueriesTracker extends BaseTracker
{
    /**
     * @var QueriesListener
     */
    protected $queriesListener;

    /**
     * QueriesTracker constructor.
     * @param Application $app
     * @param QueriesListener $queriesListener
     */
    public function __construct(Application $app, QueriesListener $queriesListener)
    {
        parent::__construct($app);

        $this->queriesListener = $queriesListener;
        $this->queriesListener->listen();
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $queries = $this->queriesListener->queries()->map(function ($item) {
            if ($this->isTransactionType($item[0])) {
                return $this->terminateTransaction($item);
            }

            return $this->terminateQuery($item);
        });

        $this->meta->put('queries_count', $this->queriesListener->count());
        $this->data->put('queries', $queries);
    }

    /**
     * @param array $item
     * @return array
     */
    protected function terminateTransaction(array $item): array
    {
        list($type, $database, $name) = $item;

        return [
            'type' => $type,
            'database' => $database,
            'name' => $name,
        ];
    }

    /**
     * @param array $item
     * @return array
     */
    protected function terminateQuery(array $item): array
    {
        list($type, $sql, $time, $database, $name, $bindings, $bindingsQuoted) = $item;

        $formattedSql = $this->formatSql($sql);

        return [
            'type' => $type,
            'sql' => $formattedSql,
            'bindings' => $bindings,
            'time' => $time,
            'database' => $database,
            'name' => $name,
            'query' => $this->queryWithBindings($bindingsQuoted, $formattedSql),
        ];
    }

    /**
     * @param string $type
     * @return bool
     */
    protected function isTransactionType(string $type): bool
    {
        $transactionTypes = [
            'transaction-begin',
            'transaction-commit',
            'transaction-rollback',
        ];

        return in_array($type, $transactionTypes);
    }

    /**
     * @param string $sql
     * @return string
     */
    protected function formatSql(string $sql): string
    {
        return preg_replace('/"/', '`', $sql);
    }

    /**
     * @param array $bindingsQuoted
     * @param string $formattedSql
     * @return string
     */
    protected function queryWithBindings(array $bindingsQuoted, string $formattedSql): string
    {
        foreach ($bindingsQuoted as $key => $binding) {
            $formattedSql = preg_replace($this->bindingRegex($key), $binding, $formattedSql, 1);
        }

        return $formattedSql;
    }

    /**
     * @param $key
     * @return string
     */
    protected function bindingRegex($key): string
    {
        return is_int($key) ? "/\?/" : "/:{$key}/";
    }
}


================================================
FILE: src/Trackers/RedisTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\LaravelListeners\RedisListener;

class RedisTracker extends BaseTracker
{
    /**
     * @var RedisListener
     */
    protected $redisListener;

    /**
     * @var bool
     */
    protected $redisCanBeTracked = false;

    /**
     * RedisTracker constructor.
     * @param Application $app
     * @param RedisListener $redisListener
     */
    public function __construct(Application $app, RedisListener $redisListener)
    {
        parent::__construct($app);

        $this->enableRedisEvents();

        $this->redisListener = $redisListener;
        $this->redisListener->listen();
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $commands = $this->redisListener->commands()->map(function ($item) {
            return $this->terminateCommands($item);
        });

        $this->meta->put('redis_count', $this->redisListener->count());
        $this->meta->put('redis_can_be_tracked', $this->redisCanBeTracked);
        $this->data->put('redis', $commands);
    }

    /**
     * @param array $item
     * @return array
     */
    protected function terminateCommands(array $item): array
    {
        list($command, $time, $name, $parameters) = $item;

        return [
            'command' => $command,
            'time' => $time,
            'name' => $name,
            'parameters' => $parameters,
        ];
    }

    /**
     * @return void
     */
    protected function enableRedisEvents(): void
    {
        $manager = $this->app->make('redis');

        if (! method_exists($manager, 'enableEvents')) {
            return; // @codeCoverageIgnore
        }

        $this->redisCanBeTracked = true;
        $manager->enableEvents();
    }
}


================================================
FILE: src/Trackers/RequestTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;

class RequestTracker extends BaseTracker
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * RequestTracker constructor.
     * @param Application $app
     * @param ExecutionData $executionData
     */
    public function __construct(Application $app, ExecutionData $executionData)
    {
        parent::__construct($app);

        $this->executionData = $executionData;
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $request = $this->executionData->request();

        $this->meta = $request->meta();
        $this->data->put('request', $request->data());
    }
}


================================================
FILE: src/Trackers/ResponseTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;

class ResponseTracker extends BaseTracker
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * RequestTracker constructor.
     * @param Application $app
     * @param ExecutionData $executionData
     */
    public function __construct(Application $app, ExecutionData $executionData)
    {
        parent::__construct($app);

        $this->executionData = $executionData;
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $response = $this->executionData->response();

        $this->meta = $response->meta();
        $this->data->put('response', $response->data());
    }
}


================================================
FILE: src/Trackers/RouteTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;

class RouteTracker extends BaseTracker
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * RequestTracker constructor.
     * @param Application $app
     * @param ExecutionData $executionData
     */
    public function __construct(Application $app, ExecutionData $executionData)
    {
        parent::__construct($app);

        $this->executionData = $executionData;
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $route = $this->executionData->route();

        $this->meta = $route->meta();
        $this->data->put('route', $route->data());
    }
}


================================================
FILE: src/Trackers/ServerTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;

class ServerTracker extends BaseTracker
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * ServerTracker constructor.
     * @param Application $app
     * @param ExecutionData $executionData
     */
    public function __construct(Application $app, ExecutionData $executionData)
    {
        parent::__construct($app);

        $this->executionData = $executionData;
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $server = $this->executionData->server();

        $this->meta = $server->meta();
        $this->data->put('server', $server->data());
    }
}


================================================
FILE: src/Trackers/ServiceProvidersTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Support\Collection;

class ServiceProvidersTracker extends BaseTracker
{
    /**
     * @return void
     */
    public function terminate(): void
    {
        $this->data->put('service_providers', $this->loadedProviders());
    }

    /**
     * @return Collection
     */
    protected function loadedProviders(): Collection
    {
        return Collection::make(
            array_keys($this->app->getLoadedProviders())
        );
    }
}


================================================
FILE: src/Trackers/SessionTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;

class SessionTracker extends BaseTracker
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * RequestTracker constructor.
     * @param Application $app
     * @param ExecutionData $executionData
     */
    public function __construct(Application $app, ExecutionData $executionData)
    {
        parent::__construct($app);

        $this->executionData = $executionData;
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $session = $this->executionData->session();

        $this->meta = $session->meta();
        $this->data->put('session', $session->data());
    }
}


================================================
FILE: src/Trackers/ViewsTracker.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Trackers;

use Illuminate\View\View;
use Illuminate\Foundation\Application;
use JKocik\Laravel\Profiler\Services\ConfigService;
use JKocik\Laravel\Profiler\Services\ParamsService;
use JKocik\Laravel\Profiler\LaravelListeners\ViewsListener;

class ViewsTracker extends BaseTracker
{
    /**
     * @var ConfigService
     */
    protected $configService;

    /**
     * @var ParamsService
     */
    protected $paramsService;

    /**
     * @var ViewsListener
     */
    protected $viewsListener;

    /**
     * ViewsTracker constructor.
     * @param Application $app
     * @param ConfigService $configService
     * @param ParamsService $paramsService
     * @param ViewsListener $viewsListener
     */
    public function __construct(
        Application $app,
        ConfigService $configService,
        ParamsService $paramsService,
        ViewsListener $viewsListener
    ) {
        parent::__construct($app);

        $this->configService = $configService;
        $this->paramsService = $paramsService;
        $this->viewsListener = $viewsListener;
        $this->viewsListener->listen();
    }

    /**
     * @return void
     */
    public function terminate(): void
    {
        $views = $this->viewsListener->views()->map(function (View $view) {
            if ($this->configService->isViewsDataEnabled()) {
                return [
                    'name' => $view->name(),
                    'path' => $view->getPath(),
                    'data' => $view->getData(),
                ];
            }

            return [
                'name' => $view->name(),
                'path' => $view->getPath(),
                'params' => $this->paramsService->resolveFlattenFromArray($view->getData()),
            ];
        })->values();

        $this->data->put('views', $views);
    }
}


================================================
FILE: tests/Feature/CommandsTest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Tests\Feature;

use Mockery;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Artisan;
use GuzzleHttp\Exception\ConnectException;
use JKocik\Laravel\Profiler\Tests\TestCase;
use JKocik\Laravel\Profiler\Contracts\DataTracker;
use JKocik\Laravel\Profiler\Services\ConfigService;
use JKocik\Laravel\Profiler\Services\ConsoleService;
use JKocik\Laravel\Profiler\Events\ServerConnectionFailed;
use JKocik\Laravel\Profiler\Tests\Support\Fixtures\TrackerA;
use JKocik\Laravel\Profiler\Tests\Support\Fixtures\TrackerB;
use JKocik\Laravel\Profiler\Processors\StatusCommandProcessor;
use JKocik\Laravel\Profiler\Events\ServerConnectionSuccessful;
use Illuminate\Foundation\Testing\Concerns\InteractsWithConsole;
use JKocik\Laravel\Profiler\Events\ProfilerServerConnectionFailed;
use JKocik\Laravel\Profiler\Events\ProfilerServerConnectionSuccessful;

class CommandsTest extends TestCase
{
    use InteractsWithConsole;

    /**
     * @return int
     */
    protected function countAllConfigurableTrackers(): int
    {
        $abstract = 1;
        $required = 4;
        $directoryDots = 2;
        $trackers = scandir(__DIR__ . '/../../src/Trackers/');

        return count($trackers) - $abstract - $required - $directoryDots;
    }

    /** @test */
    function tells_status_if_profiler_is_enabled()
    {
        $this->tapLaravelVersionFrom(5.7, function () {
            $this->artisan('profiler:status')
                ->expectsOutput('1) Your current environment is: ' . $this->app->environment())
                ->expectsOutput('Laravel Profiler is: enabled');
        });

        $this->tapLaravelVersionTill(5.6, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });
    }

    /** @test */
    function lists_trackers_if_profiler_is_enabled()
    {
        $this->app = $this->appWith(function (Application $app) {
            $app->make('config')->set('profiler.trackers', [
                TrackerA::class,
                TrackerB::class,
            ]);
        });

        $this->tapLaravelVersionFrom(5.7, function () {
            $this->artisan('profiler:status')
                ->expectsOutput('2) You have 2 tracker(s) turned on')
                ->expectsOutput('- ' . TrackerA::class)
                ->expectsOutput('- ' . TrackerB::class)
                ->expectsOutput("There are {$this->countAllConfigurableTrackers()} trackers available out of the box")
                ->expectsOutput('turn them on and off in profiler.php configuration file');
        });

        $this->tapLaravelVersionTill(5.6, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });
    }

    /** @test */
    function switches_processor_to_status_processor()
    {
        $this->artisan('profiler:status');

        $configService = $this->app->make(ConfigService::class);

        $this->assertCount(1, $configService->processors());
        $this->assertEquals(StatusCommandProcessor::class, $configService->processors()->first());
    }

    /** @test */
    function status_processor_handles_when_connection_to_profiler_server_is_successful()
    {
        $this->tapLaravelVersionFrom(5.4, function () {
            Event::fake();

            $response = Mockery::mock(Response::class);
            $response->shouldReceive('getBody')->once()->andReturn('{"sockets": 1234, "clients": 9}');

            $client = Mockery::mock(Client::class);
            $client->shouldReceive('request')->once()->andReturn($response);

            $configService = Mockery::mock(ConfigService::class);
            $configService->shouldReceive('serverHttpConnectionUrl')->once();

            $processor = new StatusCommandProcessor($client, $configService);
            $processor->process($this->app->make(DataTracker::class));

            Event::assertNotDispatched(ProfilerServerConnectionFailed::class);
            Event::assertDispatched(ProfilerServerConnectionSuccessful::class, function ($event) {
                return $event->socketsPort === 1234 && $event->countClients === 9;
            });
        });

        $this->tapLaravelVersionTill(5.3, function () {
            $this->assertTrue(true);
        });
    }

    /** @test */
    function status_processor_handles_when_connection_to_profiler_server_failed()
    {
        $this->tapLaravelVersionFrom(5.4, function () {
            Event::fake();

            $client = Mockery::mock(Client::class);
            $client->shouldReceive('request')->once()->andThrows(new ConnectException('', new Request('method', '')));

            try {
                $processor = new StatusCommandProcessor($client, $this->app->make(ConfigService::class));
                $processor->process($this->app->make(DataTracker::class));
            } catch (ConnectException $e) {
                Event::assertDispatched(ProfilerServerConnectionFailed::class);
                Event::assertNotDispatched(ProfilerServerConnectionSuccessful::class);
                return;
            }

            $this->fail('ConnectException should be thrown');
        });

        $this->tapLaravelVersionTill(5.3, function () {
            $this->assertTrue(true);
        });
    }

    /** @test */
    function tells_if_connection_to_profiler_server_is_successful()
    {
        $this->tapLaravelVersionFrom(7, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });

        $this->tapLaravelVersionBetween(5.7, 6, function () {
            $realConsoleService = new ConsoleService($this->app, $this->app->make(ConfigService::class));

            $consoleService = Mockery::mock(ConsoleService::class)->shouldIgnoreMissing();
            $consoleService->shouldReceive('connectionStatusInfo')
                ->once()
                ->andReturn($realConsoleService->connectionStatusInfo());
            $consoleService->shouldReceive('connectionSuccessfulInfo')
                ->once()
                ->andReturn($realConsoleService->connectionSuccessfulInfo());
            $consoleService->shouldReceive('connectionSuccessfulSocketsInfo')
                ->once()
                ->andReturn($realConsoleService->connectionSuccessfulSocketsInfo(1234));
            $consoleService->shouldReceive('connectionSuccessfulClientsInfo')
                ->once()
                ->andReturn($realConsoleService->connectionSuccessfulClientsInfo(9));
            $consoleService->shouldNotReceive('connectionFailedInfo');
            $consoleService->shouldNotReceive('connectionStatusUnknownInfo');
            $this->app->instance(ConsoleService::class, $consoleService);

            $this->app->terminating(function () {
                event(new ProfilerServerConnectionSuccessful(1234, 9));
            });

            $this->artisan('profiler:status')
                ->expectsOutput('3) Trying to connect to Profiler Server on http://localhost:8099 ...')
                ->expectsOutput('Connected successfully')
                ->expectsOutput('Profiler Server sockets listening on port: 1234')
                ->expectsOutput("You have 9 Profiler Client(s) connected at the moment");

            $this->turnOffProcessors();
            $this->app->terminate();
        });

        $this->tapLaravelVersionTill(5.6, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });
    }

    /** @test */
    function tells_if_connection_to_profiler_server_failed()
    {
        $this->tapLaravelVersionFrom(7, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });

        $this->tapLaravelVersionBetween(5.7, 6, function () {
            $realConsoleService = new ConsoleService($this->app, $this->app->make(ConfigService::class));

            $consoleService = Mockery::mock(ConsoleService::class)->shouldIgnoreMissing();
            $consoleService->shouldReceive('connectionStatusInfo')
                ->once()
                ->andReturn($realConsoleService->connectionStatusInfo());
            $consoleService->shouldNotReceive('connectionSuccessfulInfo');
            $consoleService->shouldReceive('connectionFailedInfo')
                ->once()
                ->andReturn($realConsoleService->connectionFailedInfo());
            $consoleService->shouldNotReceive('connectionStatusUnknownInfo');
            $this->app->instance(ConsoleService::class, $consoleService);

            $this->app->terminating(function () {
                event(new ProfilerServerConnectionFailed());
            });

            $this->artisan('profiler:status')
                ->expectsOutput('3) Trying to connect to Profiler Server on http://localhost:8099 ...')
                ->expectsOutput('Connection failed');

            $this->turnOffProcessors();
            $this->app->terminate();

            $consoleService->shouldNotHaveReceived('connectionUnknownInfo');
        });

        $this->tapLaravelVersionTill(5.6, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });
    }

    /** @test */
    function tells_if_connection_to_profiler_server_has_unknown_status()
    {
        $this->tapLaravelVersionFrom(7, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });

        $this->tapLaravelVersionBetween(5.7, 6, function () {
            $realConsoleService = new ConsoleService($this->app, $this->app->make(ConfigService::class));

            $consoleService = Mockery::mock(ConsoleService::class)->shouldIgnoreMissing();
            $consoleService->shouldReceive('connectionStatusInfo')
                ->once()
                ->andReturn($realConsoleService->connectionStatusInfo());
            $consoleService->shouldNotReceive('connectionSuccessfulInfo');
            $consoleService->shouldNotReceive('connectionFailedInfo');
            $consoleService->shouldReceive('connectionStatusUnknownInfo')
                ->once()
                ->andReturn($realConsoleService->connectionStatusUnknownInfo());
            $this->app->instance(ConsoleService::class, $consoleService);

            $this->artisan('profiler:status')
                ->expectsOutput('3) Trying to connect to Profiler Server on http://localhost:8099 ...')
                ->expectsOutput('BroadcastingProcessor did not report connection status, connection status is unknown');

            $this->turnOffProcessors();
            $this->app->terminate();
        });

        $this->tapLaravelVersionTill(5.6, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });
    }

    /** @test */
    function tells_status_if_profiler_is_disabled()
    {
        $this->app = $this->appWith(function (Application $app) {
            $app->make('config')->set('profiler.enabled', false);
        });

        $configService = Mockery::spy(ConfigService::class)->shouldIgnoreMissing();
        $this->app->instance(ConfigService::class, $configService);

        $this->tapLaravelVersionFrom(5.7, function () {
            $this->artisan('profiler:status')
                ->expectsOutput('1) Your current environment is: ' . $this->app->environment())
                ->expectsOutput('Laravel Profiler is: disabled');
        });

        $this->tapLaravelVersionTill(5.6, function () {
            $this->artisan('profiler:status');
            $this->assertTrue(true);
        });

        $configService->shouldNotHaveReceived('trackers');
    }

    /** @test */
    function can_start_profiler_server()
    {
        $consoleService = Mockery::spy(ConsoleService::class);
        $this->app->instance(ConsoleService::class, $consoleService);

        $this->artisan('profiler:server');

        $consoleService->shouldHaveReceived('profilerServerCmd')->once();
    }

    /** @test */
    function can_start_profiler_server_with_configured_ports()
    {
        $configService = Mockery::mock(ConfigService::class);
        $configService->shouldReceive('serverHttpPort')->once()->andReturn('1234');
        $configService->shouldReceive('serverSocketsPort')->once()->andReturn('9876');
        $this->app->instance(ConfigService::class, $configService);

        $consoleService = $this->app->make(ConsoleService::class);

        $this->assertEquals(
            'node node_modules/laravel-profiler-client/server/server.js http=1234 ws=9876',
            $consoleService->profilerServerCmd()
        );
    }

    /** @test */
    function tells_starting_message_for_profiler_server()
    {
        $this->tapLaravelVersionFrom(5.7, function () {
            $this->artisan('profiler:server')
                ->expectsOutput('Starting Profiler Server ...');
        });

        $this->tapLaravelVersionTill(5.6, function () {
            $this->artisan('profiler:server');
            $this->assertTrue(true);
        });
    }

    /** @test */
    function can_start_profiler_client()
    {
        $realConsoleService = $this->app->make(ConsoleService::class);

        $consoleService = Mockery::mock(ConsoleService::class);
        $consoleService->shouldReceive('profilerClientCmd')->once()->with(false);
        $this->app->instance(ConsoleService::class, $consoleService);

        Artisan::call('profiler:client');

        $this->assertEquals(
            'node_modules/.bin/http-server node_modules/laravel-profiler-client/dist/ -o -s',
            $realConsoleService->profilerClientCmd(false)
        );
    }

    /** @test */
    function can_start_profiler_client_with_manual_option()
    {
        $consoleService = Mockery::mock(ConsoleService::class);
        $consoleService->shouldReceive('profilerClientCmd')->twice()->with(true);
        $this->app->instance(ConsoleService::class, $consoleService);

        Artisan::call('profiler:client', ['--manual' => true]);
        Artisan::call('profiler:client', ['-m' => true]);

        $realConsoleService = new ConsoleService($this->app, $this->app->make(ConfigService::class));

        $this->assertEquals(
            'node_modules/.bin/http-server node_modules/laravel-profiler-client/dist/',
            $realConsoleService->profilerClientCmd(true)
        );
    }

    /** @test */
    function tells_starting_message_for_profiler_client()
    {
        $this->tapLaravelVersionFrom(5.7, function () {
            $this->artisan('profiler:client')
                ->expectsOutput('Starting Profiler Client ...');
        });

        $this->tapLaravelVersionTill(5.6, function () {
            $this->artisan('profiler:client');
            $this->assertTrue(true);
        });
    }

    /**
     * @var array
     */
    protected $beforeApplicationDestroyedCallbacks = [];

    /**
     * @param callable $callback
     */
    protected function beforeApplicationDestroyed(callable $callback)
    {
        $this->beforeApplicationDestroyedCallbacks[] = $callback;
    }
}


================================================
FILE: tests/Feature/LaravelConsoleExecutionTest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Tests\Feature;

use Illuminate\Support\Facades\Artisan;
use Illuminate\Contracts\Console\Kernel;
use JKocik\Laravel\Profiler\Tests\TestCase;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;
use JKocik\Laravel\Profiler\LaravelExecution\NullRoute;
use JKocik\Laravel\Profiler\LaravelExecution\NullServer;
use JKocik\Laravel\Profiler\LaravelExecution\NullContent;
use JKocik\Laravel\Profiler\LaravelExecution\NullSession;
use JKocik\Laravel\Profiler\Tests\Support\Fixtures\DummyCommand;
use JKocik\Laravel\Profiler\LaravelExecution\ConsoleFinishedRequest;
use JKocik\Laravel\Profiler\LaravelExecution\ConsoleStartingRequest;
use JKocik\Laravel\Profiler\LaravelExecution\ConsoleFinishedResponse;
use JKocik\Laravel\Profiler\LaravelExecution\ConsoleStartingResponse;

class LaravelConsoleExecutionTest extends TestCase
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * @var int
     */
    protected $testExitCode = 123;

    /**
     * @return void
     */
    protected function setUp(): void
    {
        parent::setUp();

        $this->turnOffProcessors();

        $this->executionData = $this->app->make(ExecutionData::class);

        $this->app->make(Kernel::class)->registerCommand(new DummyCommand($this->testExitCode));
    }

    /** @test */
    function has_console_request()
    {
        Artisan::call('dummy-command');
        $request = $this->executionData->request();

        $this->tapLaravelVersionTill(5.4, function () use ($request) {
            $this->assertInstanceOf(ConsoleStartingRequest::class, $request);
        });

        $this->tapLaravelVersionFrom(5.5, function () use ($request) {
            $this->assertInstanceOf(ConsoleFinishedRequest::class, $request);
        });
    }

    /** @test */
    function has_request_type()
    {
        Artisan::call('dummy-command');
        $request = $this->executionData->request();

        $this->tapLaravelVersionTill(5.4, function () use ($request) {
            $this->assertEquals('command-starting', $request->meta()->get('type'));
        });

        $this->tapLaravelVersionFrom(5.5, function () use ($request) {
            $this->assertEquals('command-finished', $request->meta()->get('type'));
        });
    }

    /** @test */
    function has_request_method()
    {
        Artisan::call('dummy-command');
        $request = $this->executionData->request();

        $this->tapLaravelVersionTill(5.4, function () use ($request) {
            $this->assertArrayNotHasKey('path', $request->meta());
        });

        $this->tapLaravelVersionFrom(5.5, function () use ($request) {
            $this->assertEquals('dummy-command', $request->meta()->get('path'));
        });
    }

    /** @test */
    function has_request_arguments()
    {
        Artisan::call('dummy-command', ['user' => 'Abc']);
        $request = $this->executionData->request();

        $this->tapLaravelVersionTill(5.4, function () use ($request) {
            $this->assertArrayNotHasKey('arguments', $request->data());
        });

        $this->tapLaravelVersionFrom(5.5, function () use ($request) {
            $this->assertEquals('dummy-command', $request->data()->get('arguments')['command']);
            $this->assertEquals('Abc', $request->data()->get('arguments')['user']);
        });
    }

    /** @test */
    function has_request_options()
    {
        Artisan::call('dummy-command', ['--number' => 5]);
        $request = $this->executionData->request();

        $this->tapLaravelVersionTill(5.4, function () use ($request) {
            $this->assertArrayNotHasKey('options', $request->data());
        });

        $this->tapLaravelVersionFrom(5.5, function () use ($request) {
            $this->assertEquals(5, $request->data()->get('options')['number']);
        });
    }

    /** @test */
    function has_null_route()
    {
        Artisan::call('dummy-command');
        $route = $this->executionData->route();

        $this->assertInstanceOf(NullRoute::class, $route);
    }

    /** @test */
    function has_null_session()
    {
        Artisan::call('dummy-command');
        $session = $this->executionData->session();

        $this->assertInstanceOf(NullSession::class, $session);
    }

    /** @test */
    function has_null_server()
    {
        Artisan::call('dummy-command');
        $server = $this->executionData->server();

        $this->assertInstanceOf(NullServer::class, $server);
    }

    /** @test */
    function has_console_response()
    {
        Artisan::call('dummy-command');
        $response = $this->executionData->response();

        $this->tapLaravelVersionTill(5.4, function () use ($response) {
            $this->assertInstanceOf(ConsoleStartingResponse::class, $response);
        });

        $this->tapLaravelVersionFrom(5.5, function () use ($response) {
            $this->assertInstanceOf(ConsoleFinishedResponse::class, $response);
        });
    }

    /** @test */
    function console_response_has_only_status()
    {
        Artisan::call('dummy-command');
        $response = $this->executionData->response();

        $this->tapLaravelVersionTill(5.4, function () use ($response) {
            $this->assertArrayHasKey('status', $response->meta());
            $this->assertNull($response->meta()->get('status'));
            $this->assertCount(1, $response->meta());
            $this->assertCount(0, $response->data());
        });

        $this->tapLaravelVersionFrom(5.5, function () use ($response) {
            $this->assertEquals($this->testExitCode, $response->meta()->get('status'));
            $this->assertCount(1, $response->meta());
            $this->assertCount(0, $response->data());
        });
    }

    /** @test */
    function has_null_content()
    {
        Artisan::call('dummy-command');
        $content = $this->executionData->content();

        $this->assertInstanceOf(NullContent::class, $content);
    }
}


================================================
FILE: tests/Feature/LaravelExecutionTest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Tests\Feature;

use JKocik\Laravel\Profiler\Tests\TestCase;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;

class LaravelExecutionTest extends TestCase
{
    /**
     * @return void
     */
    protected function setUp(): void
    {
        parent::setUp();

        $this->turnOffProcessors();
    }

    /** @test */
    function laravel_execution_data_is_singleton()
    {
        $executionDataA = $this->app->make(ExecutionData::class);
        $executionDataB = $this->app->make(ExecutionData::class);

        $this->assertSame($executionDataA, $executionDataB);
    }
}


================================================
FILE: tests/Feature/LaravelHttpExecutionTest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Tests\Feature;

use ReflectionMethod;
use ReflectionFunction;
use ReflectionException;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Route;
use JKocik\Laravel\Profiler\Tests\TestCase;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;
use JKocik\Laravel\Profiler\LaravelExecution\HttpRoute;
use JKocik\Laravel\Profiler\LaravelExecution\NullRoute;
use JKocik\Laravel\Profiler\LaravelExecution\HttpRequest;
use JKocik\Laravel\Profiler\LaravelExecution\HttpSession;
use JKocik\Laravel\Profiler\LaravelExecution\HttpResponse;
use JKocik\Laravel\Profiler\Tests\Support\Fixtures\DummyClassA;
use JKocik\Laravel\Profiler\Tests\Support\Fixtures\DummyController;
use JKocik\Laravel\Profiler\Tests\Support\Fixtures\DummyFormRequest;

class LaravelHttpExecutionTest extends TestCase
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * @return void
     */
    protected function setUp(): void
    {
        parent::setUp();

        $this->turnOffProcessors();

        $this->executionData = $this->app->make(ExecutionData::class);
    }

    /** @test */
    function has_http_request()
    {
        $this->get('/');
        $request = $this->executionData->request();

        $this->assertInstanceOf(HttpRequest::class, $request);
    }

    /** @test */
    function has_request_type()
    {
        $this->get('/');
        $request = $this->executionData->request();

        $this->assertEquals('http', $request->meta()->get('type'));
    }

    /** @test */
    function has_request_method()
    {
        $this->post('/', []);
        $request = $this->executionData->request();

        $this->assertEquals('POST', $request->meta()->get('method'));
    }

    /** @test */
    function has_request_path()
    {
        $this->get('/abc/xyz');
        $request = $this->executionData->request();

        $this->assertEquals('abc/xyz', $request->meta()->get('path'));
    }

    /** @test */
    function has_request_is_ajax()
    {
        $this->get('/');
        $this->assertFalse($this->executionData->request()->meta()->get('ajax'));

        $this->get('/', ['X-Requested-With' => 'XMLHttpRequest']);
        $this->assertTrue($this->executionData->request()->meta()->get('ajax'));
    }

    /** @test */
    function has_request_is_json()
    {
        $this->get('/');
        $this->assertFalse($this->executionData->request()->meta()->get('json'));

        $this->get('/', ['Content-Type' => 'application/json']);
        $this->assertTrue($this->executionData->request()->meta()->get('json'));
    }

    /** @test */
    function has_request_is_pjax()
    {
        $this->get('/');
        $this->assertFalse($this->executionData->request()->data()->get('pjax'));

        $this->get('/', ['X-PJAX' => true]);
        $this->assertTrue($this->executionData->request()->data()->get('pjax'));
    }

    /** @test */
    function has_request_url()
    {
        $this->get('/abc?ab=xy');
        $request = $this->executionData->request();

        $this->assertEquals("{$this->app->make('request')->root()}/abc", $request->data()->get('url'));
    }

    /** @test */
    function has_request_query()
    {
        $this->get('/abc?ab=xy');
        $this->assertEquals(['ab' => 'xy'], $this->executionData->request()->data()->get('query'));
    }

    /** @test */
    function can_have_empty_request_query()
    {
        $this->get('/');
        $this->assertEquals([], $this->executionData->request()->data()->get('query'));
    }

    /** @test */
    function has_request_ip()
    {
        $this->get('/');
        $request = $this->executionData->request();

        $this->assertEquals($this->app->make('request')->ip(), $request->data()->get('ip'));
    }

    /** @test */
    function has_request_server()
    {
        $this->get('/');
        $server = $this->executionData->server();

        $this->assertCount(0, $server->meta());
        $this->assertEquals($this->app->make('request')->server(), $server->data()->toArray());
    }

    /** @test */
    function has_request_header()
    {
        $this->get('/');
        $request = $this->executionData->request();

        $this->assertEquals($this->app->make('request')->header(), $request->data()->get('header'));
    }

    /** @test */
    function has_request_input()
    {
        $this->post('/', [
            'key-a' => 'val-a',
            'key-b' => 'val-b',
        ]);
        $request = $this->executionData->request();

        $this->assertEquals('val-a', $request->data()->get('input')['key-a']);
        $this->assertEquals('val-b', $request->data()->get('input')['key-b']);
    }

    /** @test */
    function has_request_all_files()
    {
        $this->tapLaravelVersionTill(5.3, function () {
            $this->assertTrue(true);
        });

        $this->tapLaravelVersionBetween(5.4, 6, function () {
            $fileA = UploadedFile::fake()->image('file-val-a.png');
            $fileB = UploadedFile::fake()->image('file-val-b.png');
            $typeA = get_class($fileA);
            $typeB = get_class($fileB);

            $this->post('/', [
                'file-key-a' => $fileA,
                'file-key-b' => $fileB,
            ]);

            $request = $this->executionData->request();

            $this->assertEquals([
                'client original name' => $fileA->getClientOriginalName(),
                'client original extension' => $fileA->getClientOriginalExtension(),
                'client mime type' => $fileA->getClientMimeType(),
                'client size' => $fileA->getClientSize(),
                'path' => $fileA->path(),
            ], $request->data()->get('files')['file-key-a'][$typeA]);
            $this->assertEquals([
                'client original name' => $fileB->getClientOriginalName(),
                'client original extension' => $fileB->getClientOriginalExtension(),
                'client mime type' => $fileB->getClientMimeType(),
                'client size' => $fileB->getClientSize(),
                'path' => $fileB->path(),
            ], $request->data()->get('files')['file-key-b'][$typeB]);
        });

        $this->tapLaravelVersionFrom(7, function () {
            $fileA = UploadedFile::fake()->image('file-val-a.png');
            $fileB = UploadedFile::fake()->image('file-val-b.png');
            $typeA = get_class($fileA);
            $typeB = get_class($fileB);

            $this->post('/', [
                'file-key-a' => $fileA,
                'file-key-b' => $fileB,
            ]);

            $request = $this->executionData->request();

            $this->assertEquals([
                'client original name' => $fileA->getClientOriginalName(),
                'client original extension' => $fileA->getClientOriginalExtension(),
                'client mime type' => $fileA->getClientMimeType(),
                'client size' => $fileA->getSize(),
                'path' => $fileA->path(),
            ], $request->data()->get('files')['file-key-a'][$typeA]);
            $this->assertEquals([
                'client original name' => $fileB->getClientOriginalName(),
                'client original extension' => $fileB->getClientOriginalExtension(),
                'client mime type' => $fileB->getClientMimeType(),
                'client size' => $fileB->getSize(),
                'path' => $fileB->path(),
            ], $request->data()->get('files')['file-key-b'][$typeB]);
        });
    }

    /** @test */
    function has_request_all_files_if_they_are_in_array()
    {
        $this->tapLaravelVersionTill(5.3, function () {
            $this->assertTrue(true);
        });

        $this->tapLaravelVersionFrom(5.4, function () {
            $fileA = UploadedFile::fake()->image('file-val-a.png');
            $fileB = UploadedFile::fake()->image('file-val-b.png');
            $fileX = UploadedFile::fake()->image('file-val-x.png');
            $fileY = UploadedFile::fake()->image('file-val-y.png');
            $typeA = get_class($fileA);
            $typeB = get_class($fileB);
            $typeX = get_class($fileX);
            $typeY = get_class($fileY);

            $this->post('/', [
                'file-key-1' => [
                    'a' => $fileA,
                    'b' => $fileB,
                ],
                'file-key-2' => [
                    'subkey' => [
                        'x' => $fileX,
                        'y' => $fileY,
                    ],
                ],
            ]);

            $request = $this->executionData->request();

            $this->assertContains($fileA->path(), $request->data()->get('files')['file-key-1']['a'][$typeA]);
            $this->assertContains($fileB->path(), $request->data()->get('files')['file-key-1']['b'][$typeB]);
            $this->assertContains($fileX->path(), $request->data()->get('files')['file-key-2']['subkey']['x'][$typeX]);
            $this->assertContains($fileY->path(), $request->data()->get('files')['file-key-2']['subkey']['y'][$typeY]);
        });
    }

    /** @test */
    function has_request_cookie()
    {
        $this->tapLaravelVersionTill('5.4', function () {
            $this->call('GET', '/', [], ['cookie-key-a' => Crypt::encrypt('cookie-val-a')]);
            $request = $this->executionData->request();

            $this->assertStringContainsString('cookie-val-a', $request->data()->get('cookie')['cookie-key-a']);
        });

        $this->tapLaravelVersionBetween('5.5', '5.5', function () {
            $this->call('GET', '/', [], ['cookie-key-a' => [Crypt::encrypt('cookie-val-a')]]);
            $request = $this->executionData->request();

            $this->assertStringContainsString('cookie-val-a', Crypt::decrypt($request->data()->get('cookie')['cookie-key-a'][0]));
        });

        $this->tapLaravelVersionBetween('5.6', '5.8', function () {
            $this->call('GET', '/', [], ['cookie-key-a' => Crypt::encrypt('cookie-val-a')]);
            $request = $this->executionData->request();

            $this->assertStringContainsString('cookie-val-a', $request->data()->get('cookie')['cookie-key-a']);
        });

        $this->tapLaravelVersionFrom('6', function () {
            $this->call('GET', '/', [], ['cookie-key-a' => [Crypt::encrypt('cookie-val-a')]]);
            $request = $this->executionData->request();

            $this->assertStringContainsString('cookie-val-a', Crypt::decrypt($request->data()->get('cookie')['cookie-key-a'][0]));
        });
    }

    /** @test */
    function has_http_route()
    {
        $this->get('/');
        $route = $this->executionData->route();

        $this->assertInstanceOf(HttpRoute::class, $route);
    }

    /** @test */
    function has_null_route_when_route_is_not_matched()
    {
        $this->get('/not-found');
        $route = $this->executionData->route();

        $this->assertInstanceOf(NullRoute::class, $route);
    }

    /** @test */
    function has_route_methods()
    {
        Route::get('route-a/{id}', function ($id) {
            return $id;
        });

        $this->get('/route-a/123');
        $route = $this->executionData->route();

        $this->assertEquals(['GET', 'HEAD'], $route->data()->get('methods'));
    }

    /** @test */
    function has_route_uri()
    {
        Route::get('route-a/{id}', function ($id) {
            return $id;
        });

        $this->get('/route-a/123');
        $route = $this->executionData->route();

        $this->assertEquals('route-a/{id}', $route->data()->get('uri'));
    }

    /** @test */
    function has_route_name()
    {
        Route::get('route-a/{id}', function ($id) {
            return $id;
        })->name('route.a.with.id');

        $this->get('/route-a/123');
        $route = $this->executionData->route();

        $this->assertEquals('route.a.with.id', $route->data()->get('name'));
    }

    /** @test */
    function has_route_middleware()
    {
        Route::get('route-a/{id}', function ($id) {
            return $id;
        })->middleware('auth');

        $this->get('/route-a/123');
        $route = $this->executionData->route();

        $this->assertEquals(['auth'], $route->data()->get('middleware'));
    }

    /** @test */
    function has_route_parameters()
    {
        Route::get('route-a/{id}', function ($id) {
            return $id;
        });

        $this->get('/route-a/123');
        $route = $this->executionData->route();

        $this->assertEquals(['id' => '123'], $route->data()->get('parameters'));
    }

    /** @test */
    function has_route_prefix()
    {
        Route::group(['prefix' => 'admin'], function () {
            Route::get('route-a/{id}', function ($id) {
                return $id;
            });
        });

        $this->get('/admin/route-a/123');
        $route = $this->executionData->route();

        $this->assertEquals('admin', $route->data()->get('prefix'));
    }

    /** @test */
    function has_route_closure_action()
    {
        $uses = function (DummyClassA $a, DummyFormRequest $request) {
            return $request->get('id');
        };
        $action = new ReflectionFunction($uses);

        Route::get('route-a/{id}', $uses);

        $this->get('/route-a/123');
        $route = $this->executionData->route();

        $this->assertStringContainsString(
            'LaravelHttpExecutionTest.php:' . $action->getStartLine() . '-' . $action->getEndLine(),
            $route->data()->get('uses')['closure']
        );
        $this->assertEquals(
            DummyFormRequest::class,
            $route->data()->get('uses')['form_request']
        );
    }

    /** @test */
    function has_route_controller_action()
    {
        Route::get('route-a/{id}', '\JKocik\Laravel\Profiler\Tests\Support\Fixtures\DummyController@dummyAction');
        $action = new ReflectionMethod(DummyController::class, 'dummyAction');

        $this->get('/route-a/123');
        $route = $this->executionData->route();

        $this->assertStringContainsString(
            'DummyController@dummyAction:' . $action->getStartLine() . '-' . $action->getEndLine(),
            $route->data()->get('uses')['controller']
        );
        $this->assertEquals(
            DummyFormRequest::class,
            $route->data()->get('uses')['form_request']
        );
    }

    /** @test */
    function has_route_without_form_request_if_form_request_is_not_defined()
    {
        $uses = function ($id) {
            return $id;
        };

        Route::get('route-a/{id}', $uses);

        $this->get('/route-a/123');
        $route = $this->executionData->route();

        $this->assertEquals('', $route->data()->get('uses')['form_request']);
    }

    /** @test */
    function has_route_with_not_existing_controller()
    {
        Route::get('route-a/{id}', '\JKocik\Laravel\Profiler\Tests\Support\Fixtures\NotExistingController@dummyAction');

        $this->tapLaravelVersionTill(5.2, function () {
            $this->get('/route-a/123');
            $route = $this->executionData->route();

            $this->assertInstanceOf(NullRoute::class, $route);
        });

        $this->tapLaravelVersionBetween(5.3, 5.3, function () {
            try {
                $this->get('/route-a/123');
            } catch (ReflectionException $e) {
                $this->assertTrue(true);
            }
        });

        $this->tapLaravelVersionFrom(5.4, function () {
            $this->get('/route-a/123');
            $route = $this->executionData->route();

            $this->assertEquals([], $route->data()->get('uses'));
        });
    }

    /** @test */
    function has_http_session()
    {
        $this->get('/');
        $session = $this->executionData->session();

        $this->assertInstanceOf(HttpSession::class, $session);
    }

    /** @test */
    function has_http_session_data()
    {
        $this->withSession([
            'abc' => 123,
            'xyz' => 789,
        ])->get('/');
        $session = $this->executionData->session();

        $this->assertEquals(123, $session->data()->get('abc'));
        $this->assertEquals(789, $session->data()->get('xyz'));
    }

    /** @test */
    function has_http_response()
    {
        $this->get('/');
        $response = $this->executionData->response();

        $this->assertInstanceOf(HttpResponse::class, $response);
    }

    /** @test */
    function has_response_status()
    {
        $this->get('/i-can-not-find-that-page');
        $response = $this->executionData->response();

        $this->assertEquals(404, $response->meta()->get('status'));
        $this->assertEquals('Not Found', $response->meta()->get('status_text'));
    }

    /** @test */
    function can_have_response_unknown_status()
    {
        Route::get('unknown', function () {
            abort(419);
        });

        $this->get('/unknown');
        $response = $this->executionData->response();

        $this->assertEquals(419, $response->meta()->get('status'));
        $this->assertEquals('unknown status', $response->meta()->get('status_text'));
    }

    /** @test */
    function has_response_headers()
    {
        $this->get('/');
        $response = $this->executionData->response();

        $this->assertArrayHasKey('content-type', $response->data()->get('headers'));
    }

    /** @test */
    function has_response_content()
    {
        $this->get('/');
        $content = $this->executionData->content();

        $this->assertCount(0, $content->meta());
        $this->assertStringNotContainsString('HTTP/1.1 200 OK', $content->data()->get('content'));
        $this->assertStringContainsString('</body>', $content->data()->get('content'));
        $this->assertStringContainsString('</html>', $content->data()->get('content'));
    }
}


================================================
FILE: tests/Feature/LaravelNullExecutionTest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Tests\Feature;

use JKocik\Laravel\Profiler\Tests\TestCase;
use JKocik\Laravel\Profiler\Contracts\ExecutionData;
use JKocik\Laravel\Profiler\LaravelExecution\NullRoute;
use JKocik\Laravel\Profiler\LaravelExecution\NullServer;
use JKocik\Laravel\Profiler\LaravelExecution\NullContent;
use JKocik\Laravel\Profiler\LaravelExecution\NullRequest;
use JKocik\Laravel\Profiler\LaravelExecution\NullSession;
use JKocik\Laravel\Profiler\LaravelExecution\NullResponse;

class LaravelNullExecutionTest extends TestCase
{
    /**
     * @var ExecutionData
     */
    protected $executionData;

    /**
     * @return void
     */
    protected function setUp(): void
    {
        parent::setUp();

        $this->turnOffProcessors();

        $this->executionData = $this->app->make(ExecutionData::class);
    }


    /** @test */
    function has_null_request()
    {
        $request = $this->executionData->request();

        $this->assertInstanceOf(NullRequest::class, $request);
    }

    /** @test */
    function null_request_has_only_type()
    {
        $request = $this->executionData->request();

        $this->assertTrue($request->meta()->has('type'));
        $this->assertNull($request->meta()->get('type'));
        $this->assertCount(1, $request->meta());
        $this->assertCount(0, $request->data());
    }

    /** @test */
    function has_null_route()
    {
        $route = $this->executionData->route();

        $this->assertInstanceOf(NullRoute::class, $route);
    }

    /** @test */
    function null_route_is_empty()
    {
        $route = $this->executionData->route();

        $this->assertCount(0, $route->meta());
        $this->assertCount(0, $route->data());
    }

    /** @test */
    function has_null_session()
    {
        $session = $this->executionData->session();

        $this->assertInstanceOf(NullSession::class, $session);
    }

    /** @test */
    function null_session_is_empty()
    {
        $session = $this->executionData->session();

        $this->assertCount(0, $session->meta());
        $this->assertCount(0, $session->data());
    }

    /** @test */
    function has_null_server()
    {
        $server = $this->executionData->server();

        $this->assertInstanceOf(NullServer::class, $server);
    }

    /** @test */
    function null_server_is_empty()
    {
        $server = $this->executionData->server();

        $this->assertCount(0, $server->meta());
        $this->assertCount(0, $server->data());
    }

    /** @test */
    function has_null_response()
    {
        $response = $this->executionData->response();

        $this->assertInstanceOf(NullResponse::class, $response);
    }

    /** @test */
    function null_response_is_empty()
    {
        $response = $this->executionData->response();

        $this->assertCount(0, $response->meta());
        $this->assertCount(0, $response->data());
    }

    /** @test */
    function has_null_content()
    {
        $content = $this->executionData->content();

        $this->assertInstanceOf(NullContent::class, $content);
    }

    /** @test */
    function null_content_is_empty()
    {
        $content = $this->executionData->content();

        $this->assertCount(0, $content->meta());
        $this->assertCount(0, $content->data());
    }
}


================================================
FILE: tests/Feature/PerformanceTest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Tests\Feature;

use JKocik\Laravel\Profiler\Tests\TestCase;
use JKocik\Laravel\Profiler\Contracts\Timer;
use JKocik\Laravel\Profiler\Contracts\Memory;
use JKocik\Laravel\Profiler\Services\Performance\TimerService;
use JKocik\Laravel\Profiler\Services\Performance\NullTimerService;

class PerformanceTest extends TestCase
{
    /** @test */
    function enabled_profiler_has_singleton_timer()
    {
        $timerA = $this->app->make(Timer::class);
        $timerB = $this->app->make(Timer::class);

        $this->assertInstanceOf(TimerService::class, $timerA);
        $this->assertSame($timerA, $timerB);
    }

    /** @test */
    function disabled_profiler_has_singleton_null_timer()
    {
        putenv('PROFILER_ENABLED=false');
        $_ENV['PROFILER_ENABLED'] = false;
        $this->app = $this->app();
        $timerA = $this->app->make(Timer::class);
        $timerB = $this->app->make(Timer::class);

        $this->assertInstanceOf(NullTimerService::class, $timerA);
        $this->assertSame($timerA, $timerB);
    }

    /** @test */
    function memory_is_singleton()
    {
        $memoryA = $this->app->make(Memory::class);
        $memoryB = $this->app->make(Memory::class);

        $this->assertInstanceOf(Memory::class, $memoryA);
        $this->assertSame($memoryA, $memoryB);
    }

    /**
     * @return void
     */
    protected function tearDown(): void
    {
        parent::tearDown();

        putenv('PROFILER_ENABLED');
        unset($_ENV['PROFILER_ENABLED']);
    }
}


================================================
FILE: tests/Feature/PerformanceTrackerTest.php
================================================
<?php

namespace JKocik\Laravel\Profiler\Tests\Feature;

use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Contracts\Console\Kernel;
use JKocik\Laravel\Profiler\Tests\TestCase;
use JKocik\Larave
Download .txt
gitextract_22nd0g50/

├── .docker/
│   ├── etc/
│   │   └── php/
│   │       ├── entrypoint.sh
│   │       ├── php-v1.ini
│   │       └── php-v2.ini
│   └── images/
│       └── php/
│           ├── .bashrc-v1
│           ├── .bashrc-v2
│           ├── Dockerfile-v1
│           └── Dockerfile-v2
├── .gitignore
├── .travis.yml
├── LICENSE.md
├── README.md
├── composer.json
├── config/
│   └── profiler.php
├── docker-compose.yml
├── phpunit-laravel-52.xml
├── phpunit-laravel-53.xml
├── phpunit-laravel-54.xml
├── phpunit-laravel-55.xml
├── phpunit-laravel-56.xml
├── phpunit-laravel-57.xml
├── phpunit-laravel-58.xml
├── phpunit-laravel-6.xml
├── phpunit-laravel-7.xml
├── phpunit-laravel-8.xml
├── src/
│   ├── BaseProfiler.php
│   ├── Console/
│   │   ├── ClientCommand.php
│   │   ├── ServerCommand.php
│   │   └── StatusCommand.php
│   ├── Contracts/
│   │   ├── DataProcessor.php
│   │   ├── DataTracker.php
│   │   ├── ExecutionContent.php
│   │   ├── ExecutionData.php
│   │   ├── ExecutionRequest.php
│   │   ├── ExecutionResponse.php
│   │   ├── ExecutionRoute.php
│   │   ├── ExecutionServer.php
│   │   ├── ExecutionSession.php
│   │   ├── ExecutionWatcher.php
│   │   ├── LaravelListener.php
│   │   ├── Memory.php
│   │   ├── Processor.php
│   │   ├── Profiler.php
│   │   ├── Timer.php
│   │   └── Tracker.php
│   ├── DisabledProfiler.php
│   ├── Events/
│   │   ├── ExceptionHandling.php
│   │   ├── ProfilerBound.php
│   │   ├── ProfilerServerConnectionFailed.php
│   │   ├── ProfilerServerConnectionSuccessful.php
│   │   ├── ResetTrackers.php
│   │   ├── Terminating.php
│   │   └── Tracking.php
│   ├── LaravelDataProcessor.php
│   ├── LaravelDataTracker.php
│   ├── LaravelExecution/
│   │   ├── ConsoleFinishedRequest.php
│   │   ├── ConsoleFinishedResponse.php
│   │   ├── ConsoleStartingRequest.php
│   │   ├── ConsoleStartingResponse.php
│   │   ├── ExceptionHandlerFromVersion7.php
│   │   ├── ExceptionHandlerTillVersion6.php
│   │   ├── HttpContent.php
│   │   ├── HttpRequest.php
│   │   ├── HttpResponse.php
│   │   ├── HttpRoute.php
│   │   ├── HttpServer.php
│   │   ├── HttpSession.php
│   │   ├── LaravelExecutionData.php
│   │   ├── NullContent.php
│   │   ├── NullRequest.php
│   │   ├── NullResponse.php
│   │   ├── NullRoute.php
│   │   ├── NullServer.php
│   │   └── NullSession.php
│   ├── LaravelExecutionWatcher.php
│   ├── LaravelListeners/
│   │   ├── AuthListener.php
│   │   ├── ConsoleCommandFinishedListener.php
│   │   ├── EventsListener.php
│   │   ├── ExceptionListener.php
│   │   ├── HttpRequestHandledListener.php
│   │   ├── PerformanceListener.php
│   │   ├── QueriesListener.php
│   │   ├── RedisListener.php
│   │   └── ViewsListener.php
│   ├── LaravelProfiler.php
│   ├── Processors/
│   │   ├── BroadcastingProcessor.php
│   │   └── StatusCommandProcessor.php
│   ├── ProfilerResolver.php
│   ├── ServiceProvider.php
│   ├── Services/
│   │   ├── ConfigService.php
│   │   ├── ConsoleService.php
│   │   ├── GeneratorService.php
│   │   ├── LogService.php
│   │   ├── ParamsService.php
│   │   ├── Performance/
│   │   │   ├── MemoryService.php
│   │   │   ├── NullTimerService.php
│   │   │   ├── TimerException.php
│   │   │   └── TimerService.php
│   │   └── helpers.php
│   └── Trackers/
│       ├── ApplicationTracker.php
│       ├── AuthTracker.php
│       ├── BaseTracker.php
│       ├── BindingsTracker.php
│       ├── ConfigTracker.php
│       ├── ContentTracker.php
│       ├── EventsTracker.php
│       ├── ExceptionTracker.php
│       ├── PathsTracker.php
│       ├── PerformanceTracker.php
│       ├── QueriesTracker.php
│       ├── RedisTracker.php
│       ├── RequestTracker.php
│       ├── ResponseTracker.php
│       ├── RouteTracker.php
│       ├── ServerTracker.php
│       ├── ServiceProvidersTracker.php
│       ├── SessionTracker.php
│       └── ViewsTracker.php
└── tests/
    ├── Feature/
    │   ├── CommandsTest.php
    │   ├── LaravelConsoleExecutionTest.php
    │   ├── LaravelExecutionTest.php
    │   ├── LaravelHttpExecutionTest.php
    │   ├── LaravelNullExecutionTest.php
    │   ├── PerformanceTest.php
    │   ├── PerformanceTrackerTest.php
    │   ├── RegisterProfilerTest.php
    │   ├── RunningProfilerTest.php
    │   ├── TrackersResetTest.php
    │   └── TrackersTest.php
    ├── Support/
    │   ├── Fixtures/
    │   │   ├── DummyClassA.php
    │   │   ├── DummyClassB.php
    │   │   ├── DummyCommand.php
    │   │   ├── DummyContractA.php
    │   │   ├── DummyContractB.php
    │   │   ├── DummyController.php
    │   │   ├── DummyEventA.php
    │   │   ├── DummyEventB.php
    │   │   ├── DummyException.php
    │   │   ├── DummyFormRequest.php
    │   │   ├── PerformanceProcessor.php
    │   │   ├── ProcessorA.php
    │   │   ├── ProcessorB.php
    │   │   ├── TrackerA.php
    │   │   ├── TrackerB.php
    │   │   ├── dummy-view-a.blade.php
    │   │   └── dummy-view-b.blade.php
    │   ├── Framework.php
    │   ├── PHPMock.php
    │   └── TestListener.php
    ├── TestCase.php
    ├── Unit/
    │   ├── LaravelExecution/
    │   │   ├── ConsoleFinishedRequestTest.php
    │   │   ├── ConsoleStartingRequestTest.php
    │   │   └── ConsoleStartingResponseTest.php
    │   ├── Services/
    │   │   ├── ConfigServiceTest.php
    │   │   ├── HelpersTest.php
    │   │   ├── ParamsServiceTest.php
    │   │   └── Performance/
    │   │       └── TimerServiceTest.php
    │   └── Trackers/
    │       ├── ApplicationTrackerTest.php
    │       ├── AuthTrackerTest.php
    │       ├── BindingsTrackerTest.php
    │       ├── ConfigTrackerTest.php
    │       ├── ContentTrackerTest.php
    │       ├── EventsTrackerTest.php
    │       ├── ExceptionTrackerTest.php
    │       ├── PathsTrackerTest.php
    │       ├── QueriesTrackerTest.php
    │       ├── RedisTrackerTest.php
    │       ├── RequestTrackerTest.php
    │       ├── ResponseTrackerTest.php
    │       ├── RouteTrackerTest.php
    │       ├── ServerTrackerTest.php
    │       ├── ServiceProvidersTrackerTest.php
    │       ├── SessionTrackerTest.php
    │       └── ViewsTrackerTest.php
    └── bootstrap/
        └── phpunit.php
Download .txt
SYMBOL INDEX (752 symbols across 148 files)

FILE: src/BaseProfiler.php
  class BaseProfiler (line 15) | abstract class BaseProfiler implements Profiler
    method __construct (line 26) | public function __construct(Application $app)
    method resetTrackers (line 34) | public function resetTrackers(): void
    method listenForBoot (line 42) | public function listenForBoot(): void
    method boot (line 53) | abstract protected function boot(): void;
    method commands (line 58) | private function commands(): void

FILE: src/Console/ClientCommand.php
  class ClientCommand (line 8) | class ClientCommand extends Command
    method __construct (line 29) | public function __construct(ConsoleService $consoleService)
    method handle (line 39) | public function handle(): void

FILE: src/Console/ServerCommand.php
  class ServerCommand (line 8) | class ServerCommand extends Command
    method __construct (line 29) | public function __construct(ConsoleService $consoleService)
    method handle (line 39) | public function handle(): void

FILE: src/Console/StatusCommand.php
  class StatusCommand (line 13) | class StatusCommand extends Command
    method __construct (line 45) | public function __construct(ConfigService $configService, ConsoleServi...
    method handle (line 56) | public function handle(): void
    method printProfilerStatus (line 76) | protected function printProfilerStatus(): void
    method printTrackersStatus (line 85) | protected function printTrackersStatus(): void
    method printConnectionStatus (line 101) | protected function printConnectionStatus(): void

FILE: src/Contracts/DataProcessor.php
  type DataProcessor (line 5) | interface DataProcessor
    method process (line 11) | public function process(DataTracker $dataTracker): void;

FILE: src/Contracts/DataTracker.php
  type DataTracker (line 7) | interface DataTracker
    method track (line 12) | public function track(): void;
    method terminate (line 17) | public function terminate(): void;
    method meta (line 22) | public function meta(): Collection;
    method data (line 27) | public function data(): Collection;

FILE: src/Contracts/ExecutionContent.php
  type ExecutionContent (line 7) | interface ExecutionContent
    method meta (line 12) | public function meta(): Collection;
    method data (line 17) | public function data(): Collection;

FILE: src/Contracts/ExecutionData.php
  type ExecutionData (line 5) | interface ExecutionData
    method setRequest (line 11) | public function setRequest(ExecutionRequest $request): void;
    method request (line 16) | public function request(): ExecutionRequest;
    method setRoute (line 22) | public function setRoute(ExecutionRoute $route): void;
    method route (line 27) | public function route(): ExecutionRoute;
    method setSession (line 33) | public function setSession(ExecutionSession $session): void;
    method session (line 38) | public function session(): ExecutionSession;
    method setServer (line 44) | public function setServer(ExecutionServer $server): void;
    method server (line 49) | public function server(): ExecutionServer;
    method setResponse (line 55) | public function setResponse(ExecutionResponse $response): void;
    method response (line 60) | public function response(): ExecutionResponse;
    method setContent (line 66) | public function setContent(ExecutionContent $content): void;
    method content (line 71) | public function content(): ExecutionContent;

FILE: src/Contracts/ExecutionRequest.php
  type ExecutionRequest (line 7) | interface ExecutionRequest
    method meta (line 12) | public function meta(): Collection;
    method data (line 17) | public function data(): Collection;

FILE: src/Contracts/ExecutionResponse.php
  type ExecutionResponse (line 7) | interface ExecutionResponse
    method meta (line 12) | public function meta(): Collection;
    method data (line 17) | public function data(): Collection;

FILE: src/Contracts/ExecutionRoute.php
  type ExecutionRoute (line 7) | interface ExecutionRoute
    method meta (line 12) | public function meta(): Collection;
    method data (line 17) | public function data(): Collection;

FILE: src/Contracts/ExecutionServer.php
  type ExecutionServer (line 7) | interface ExecutionServer
    method meta (line 12) | public function meta(): Collection;
    method data (line 17) | public function data(): Collection;

FILE: src/Contracts/ExecutionSession.php
  type ExecutionSession (line 7) | interface ExecutionSession
    method meta (line 12) | public function meta(): Collection;
    method data (line 17) | public function data(): Collection;

FILE: src/Contracts/ExecutionWatcher.php
  type ExecutionWatcher (line 5) | interface ExecutionWatcher
    method watch (line 10) | public function watch(): void;

FILE: src/Contracts/LaravelListener.php
  type LaravelListener (line 5) | interface LaravelListener
    method listen (line 10) | public function listen(): void;

FILE: src/Contracts/Memory.php
  type Memory (line 5) | interface Memory

FILE: src/Contracts/Processor.php
  type Processor (line 5) | interface Processor
    method process (line 11) | public function process(DataTracker $dataTracker): void;

FILE: src/Contracts/Profiler.php
  type Profiler (line 5) | interface Profiler
    method resetTrackers (line 10) | public function resetTrackers(): void;
    method listenForBoot (line 15) | public function listenForBoot(): void;

FILE: src/Contracts/Timer.php
  type Timer (line 5) | interface Timer
    method startCustom (line 11) | public function startCustom(string $name): void;
    method finishCustom (line 17) | public function finishCustom(string $name): void;
    method millisecondsCustom (line 23) | public function millisecondsCustom(string $name): float;

FILE: src/Contracts/Tracker.php
  type Tracker (line 7) | interface Tracker
    method meta (line 12) | public function meta(): Collection;
    method data (line 17) | public function data(): Collection;
    method terminate (line 22) | public function terminate(): void;

FILE: src/DisabledProfiler.php
  class DisabledProfiler (line 9) | class DisabledProfiler extends BaseProfiler
    method boot (line 14) | protected function boot(): void
    method bind (line 22) | protected function bind(): void

FILE: src/Events/ExceptionHandling.php
  class ExceptionHandling (line 7) | class ExceptionHandling
    method __construct (line 18) | public function __construct(Throwable $exception)

FILE: src/Events/ProfilerBound.php
  class ProfilerBound (line 5) | class ProfilerBound

FILE: src/Events/ProfilerServerConnectionFailed.php
  class ProfilerServerConnectionFailed (line 5) | class ProfilerServerConnectionFailed

FILE: src/Events/ProfilerServerConnectionSuccessful.php
  class ProfilerServerConnectionSuccessful (line 5) | class ProfilerServerConnectionSuccessful
    method __construct (line 22) | public function __construct(int $socketsPort, int $countClients)

FILE: src/Events/ResetTrackers.php
  class ResetTrackers (line 5) | class ResetTrackers

FILE: src/Events/Terminating.php
  class Terminating (line 5) | class Terminating

FILE: src/Events/Tracking.php
  class Tracking (line 5) | class Tracking

FILE: src/LaravelDataProcessor.php
  class LaravelDataProcessor (line 13) | class LaravelDataProcessor implements DataProcessor
    method __construct (line 36) | public function __construct(
    method process (line 50) | public function process(DataTracker $dataTracker): void
    method make (line 69) | protected function make(string $processor): Processor
    method shouldNotProcess (line 78) | protected function shouldNotProcess(DataTracker $dataTracker): bool

FILE: src/LaravelDataTracker.php
  class LaravelDataTracker (line 15) | class LaravelDataTracker implements DataTracker
    method __construct (line 47) | public function __construct(Application $app, ConfigService $configSer...
    method track (line 60) | public function track(): void
    method terminate (line 75) | public function terminate(): void
    method meta (line 87) | public function meta(): Collection
    method data (line 95) | public function data(): Collection
    method bootTrackers (line 104) | protected function bootTrackers(Collection $trackers): void

FILE: src/LaravelExecution/ConsoleFinishedRequest.php
  class ConsoleFinishedRequest (line 9) | class ConsoleFinishedRequest implements ExecutionRequest
    method __construct (line 26) | public function __construct(?string $command, InputInterface $input)
    method meta (line 35) | public function meta(): Collection
    method data (line 46) | public function data(): Collection

FILE: src/LaravelExecution/ConsoleFinishedResponse.php
  class ConsoleFinishedResponse (line 8) | class ConsoleFinishedResponse implements ExecutionResponse
    method __construct (line 19) | public function __construct(int $exitCode)
    method meta (line 27) | public function meta(): Collection
    method data (line 37) | public function data(): Collection

FILE: src/LaravelExecution/ConsoleStartingRequest.php
  class ConsoleStartingRequest (line 8) | class ConsoleStartingRequest implements ExecutionRequest
    method meta (line 13) | public function meta(): Collection
    method data (line 23) | public function data(): Collection

FILE: src/LaravelExecution/ConsoleStartingResponse.php
  class ConsoleStartingResponse (line 8) | class ConsoleStartingResponse implements ExecutionResponse
    method meta (line 13) | public function meta(): Collection
    method data (line 23) | public function data(): Collection

FILE: src/LaravelExecution/ExceptionHandlerFromVersion7.php
  class ExceptionHandlerFromVersion7 (line 9) | class ExceptionHandlerFromVersion7 extends Handler
    method report (line 15) | public function report(Throwable $exception)

FILE: src/LaravelExecution/ExceptionHandlerTillVersion6.php
  class ExceptionHandlerTillVersion6 (line 9) | class ExceptionHandlerTillVersion6 extends Handler
    method report (line 15) | public function report(Exception $exception)

FILE: src/LaravelExecution/HttpContent.php
  class HttpContent (line 9) | class HttpContent implements ExecutionContent
    method __construct (line 20) | public function __construct(Response $response)
    method meta (line 28) | public function meta(): Collection
    method data (line 36) | public function data(): Collection

FILE: src/LaravelExecution/HttpRequest.php
  class HttpRequest (line 10) | class HttpRequest implements ExecutionRequest
    method __construct (line 21) | public function __construct(Request $request)
    method meta (line 29) | public function meta(): Collection
    method data (line 43) | public function data(): Collection
    method files (line 60) | protected function files(): Collection
    method filesMap (line 71) | protected function filesMap(Collection $files): Collection
    method file (line 87) | protected function file(UploadedFile $file): array
    method clientSize (line 102) | protected function clientSize(UploadedFile $file): int

FILE: src/LaravelExecution/HttpResponse.php
  class HttpResponse (line 9) | class HttpResponse implements ExecutionResponse
    method __construct (line 20) | public function __construct(Response $response)
    method meta (line 28) | public function meta(): Collection
    method data (line 39) | public function data(): Collection
    method getStatusText (line 49) | protected function getStatusText(): string

FILE: src/LaravelExecution/HttpRoute.php
  class HttpRoute (line 15) | class HttpRoute implements ExecutionRoute
    method __construct (line 26) | public function __construct(Route $route)
    method meta (line 34) | public function meta(): Collection
    method data (line 42) | public function data(): Collection
    method uses (line 58) | protected function uses(): array
    method isClosureIn (line 79) | protected function isClosureIn(array $uses): bool
    method closure (line 88) | protected function closure(array $uses): array
    method isControllerIn (line 102) | protected function isControllerIn(array $uses): bool
    method controller (line 111) | protected function controller(array $uses): array
    method formRequest (line 127) | protected function formRequest(array $parameters): string

FILE: src/LaravelExecution/HttpServer.php
  class HttpServer (line 9) | class HttpServer implements ExecutionServer
    method __construct (line 20) | public function __construct(Request $request)
    method meta (line 28) | public function meta(): Collection
    method data (line 36) | public function data(): Collection

FILE: src/LaravelExecution/HttpSession.php
  class HttpSession (line 9) | class HttpSession implements ExecutionSession
    method __construct (line 20) | public function __construct(SessionManager $session)
    method meta (line 28) | public function meta(): Collection
    method data (line 36) | public function data(): Collection

FILE: src/LaravelExecution/LaravelExecutionData.php
  class LaravelExecutionData (line 13) | class LaravelExecutionData implements ExecutionData
    method __construct (line 48) | public function __construct()
    method setRequest (line 62) | public function setRequest(ExecutionRequest $request): void
    method request (line 70) | public function request(): ExecutionRequest
    method setRoute (line 79) | public function setRoute(ExecutionRoute $route): void
    method route (line 87) | public function route(): ExecutionRoute
    method setSession (line 96) | public function setSession(ExecutionSession $session): void
    method session (line 104) | public function session(): ExecutionSession
    method setServer (line 113) | public function setServer(ExecutionServer $server): void
    method server (line 121) | public function server(): ExecutionServer
    method setResponse (line 130) | public function setResponse(ExecutionResponse $response): void
    method response (line 138) | public function response(): ExecutionResponse
    method setContent (line 147) | public function setContent(ExecutionContent $content): void
    method content (line 155) | public function content(): ExecutionContent

FILE: src/LaravelExecution/NullContent.php
  class NullContent (line 8) | class NullContent implements ExecutionContent
    method meta (line 13) | public function meta(): Collection
    method data (line 21) | public function data(): Collection

FILE: src/LaravelExecution/NullRequest.php
  class NullRequest (line 8) | class NullRequest implements ExecutionRequest
    method meta (line 13) | public function meta(): Collection
    method data (line 23) | public function data(): Collection

FILE: src/LaravelExecution/NullResponse.php
  class NullResponse (line 8) | class NullResponse implements ExecutionResponse
    method meta (line 13) | public function meta(): Collection
    method data (line 21) | public function data(): Collection

FILE: src/LaravelExecution/NullRoute.php
  class NullRoute (line 8) | class NullRoute implements ExecutionRoute
    method meta (line 13) | public function meta(): Collection
    method data (line 21) | public function data(): Collection

FILE: src/LaravelExecution/NullServer.php
  class NullServer (line 8) | class NullServer implements ExecutionServer
    method meta (line 13) | public function meta(): Collection
    method data (line 21) | public function data(): Collection

FILE: src/LaravelExecution/NullSession.php
  class NullSession (line 8) | class NullSession implements ExecutionSession
    method meta (line 13) | public function meta(): Collection
    method data (line 21) | public function data(): Collection

FILE: src/LaravelExecutionWatcher.php
  class LaravelExecutionWatcher (line 9) | class LaravelExecutionWatcher implements ExecutionWatcher
    method __construct (line 26) | public function __construct(
    method watch (line 37) | public function watch(): void

FILE: src/LaravelListeners/AuthListener.php
  class AuthListener (line 11) | class AuthListener implements LaravelListener
    method listen (line 21) | public function listen(): void
    method user (line 31) | public function user(): ?Model

FILE: src/LaravelListeners/ConsoleCommandFinishedListener.php
  class ConsoleCommandFinishedListener (line 13) | class ConsoleCommandFinishedListener implements LaravelListener
    method __construct (line 24) | public function __construct(ExecutionData $executionData)
    method listen (line 32) | public function listen(): void

FILE: src/LaravelListeners/EventsListener.php
  class EventsListener (line 11) | class EventsListener implements LaravelListener
    method __construct (line 43) | public function __construct(Dispatcher $dispatcher, ConfigService $con...
    method listen (line 52) | public function listen(): void
    method events (line 61) | public function events(): Collection
    method count (line 69) | public function count(): int
    method listenEvents (line 77) | protected function listenEvents(): void
    method listenResetTrackers (line 101) | protected function listenResetTrackers(): void
    method resolveEvent (line 116) | protected function resolveEvent(string $name, $event, $payload): array
    method resolveName (line 130) | protected function resolveName($event, $payload): string
    method shouldGroup (line 139) | protected function shouldGroup(string $name): bool
    method groupToPreviousEvent (line 147) | protected function groupToPreviousEvent(): void
    method shouldSkip (line 156) | protected function shouldSkip(string $name): bool

FILE: src/LaravelListeners/ExceptionListener.php
  class ExceptionListener (line 10) | class ExceptionListener implements LaravelListener
    method listen (line 20) | public function listen(): void
    method exception (line 27) | public function exception(): ?Throwable

FILE: src/LaravelListeners/HttpRequestHandledListener.php
  class HttpRequestHandledListener (line 19) | class HttpRequestHandledListener implements LaravelListener
    method __construct (line 30) | public function __construct(ExecutionData $executionData)
    method listen (line 38) | public function listen(): void
    method routeOf (line 65) | protected function routeOf(Request $request): ExecutionRoute

FILE: src/LaravelListeners/PerformanceListener.php
  class PerformanceListener (line 16) | class PerformanceListener implements LaravelListener
    method __construct (line 39) | public function __construct(
    method listen (line 52) | public function listen(): void
    method listenHttp (line 61) | protected function listenHttp(): void
    method listenConsole (line 103) | protected function listenConsole(): void
    method resolveRouteName (line 117) | protected function resolveRouteName(): string

FILE: src/LaravelListeners/QueriesListener.php
  class QueriesListener (line 14) | class QueriesListener implements LaravelListener
    method listen (line 29) | public function listen(): void
    method queries (line 39) | public function queries(): Collection
    method count (line 47) | public function count(): int
    method listenQueries (line 55) | protected function listenQueries(): void
    method listenTransactions (line 77) | protected function listenTransactions(): void
    method listenResetTrackers (line 107) | protected function listenResetTrackers(): void
    method formatBindings (line 119) | protected function formatBindings(QueryExecuted $event): array
    method truncate (line 138) | protected function truncate($binding)
    method quote (line 152) | protected function quote(QueryExecuted $event, $binding)

FILE: src/LaravelListeners/RedisListener.php
  class RedisListener (line 11) | class RedisListener implements LaravelListener
    method listen (line 26) | public function listen(): void
    method commands (line 35) | public function commands(): Collection
    method count (line 43) | public function count(): int
    method listenCommands (line 51) | protected function listenCommands(): void
    method listenResetTrackers (line 68) | protected function listenResetTrackers(): void

FILE: src/LaravelListeners/ViewsListener.php
  class ViewsListener (line 11) | class ViewsListener implements LaravelListener
    method listen (line 21) | public function listen(): void
    method views (line 30) | public function views(): Collection
    method listenViews (line 38) | protected function listenViews(): void
    method listenResetTrackers (line 48) | protected function listenResetTrackers(): void
    method resolveView (line 59) | protected function resolveView(array $view): View

FILE: src/LaravelProfiler.php
  class LaravelProfiler (line 19) | class LaravelProfiler extends BaseProfiler
    method boot (line 29) | protected function boot(): void
    method bind (line 41) | protected function bind(): void
    method track (line 67) | protected function track(): void
    method listenForTerminating (line 80) | protected function listenForTerminating(): void
    method registerTerminating (line 90) | protected function registerTerminating(): void

FILE: src/Processors/BroadcastingProcessor.php
  class BroadcastingProcessor (line 11) | class BroadcastingProcessor implements Processor
    method __construct (line 28) | public function __construct(Client $client, ConfigService $configService)
    method process (line 38) | public function process(DataTracker $dataTracker): void
    method broadcast (line 52) | protected function broadcast(DataTracker $dataTracker, string $url): R...

FILE: src/Processors/StatusCommandProcessor.php
  class StatusCommandProcessor (line 10) | class StatusCommandProcessor extends BroadcastingProcessor
    method process (line 16) | public function process(DataTracker $dataTracker): void

FILE: src/ProfilerResolver.php
  class ProfilerResolver (line 9) | class ProfilerResolver
    method __construct (line 26) | public function __construct(Application $app, ConfigService $configSer...
    method resolve (line 35) | public function resolve(): Profiler

FILE: src/ServiceProvider.php
  class ServiceProvider (line 8) | class ServiceProvider extends BaseServiceProvider
    method register (line 13) | public function register(): void
    method boot (line 27) | public function boot(): void
    method allowConfigFileToBePublished (line 35) | public function allowConfigFileToBePublished(): void
    method profilerConfigPath (line 45) | public static function profilerConfigPath(): string

FILE: src/Services/ConfigService.php
  class ConfigService (line 9) | class ConfigService
    method __construct (line 26) | public function __construct(Application $app, Repository $config)
    method isProfilerEnabled (line 35) | public function isProfilerEnabled(): bool
    method trackers (line 52) | public function trackers(): Collection
    method processors (line 60) | public function processors(): Collection
    method overrideProcessors (line 68) | public function overrideProcessors(array $processors): void
    method pathsToTurnOffProcessors (line 76) | public function pathsToTurnOffProcessors(): Collection
    method serverHttpConnectionUrl (line 84) | public function serverHttpConnectionUrl(): string
    method serverHttpPort (line 95) | public function serverHttpPort(): string
    method serverSocketsPort (line 103) | public function serverSocketsPort(): string
    method isViewsDataEnabled (line 111) | public function isViewsDataEnabled(): bool
    method isEventsDataEnabled (line 119) | public function isEventsDataEnabled(): bool
    method isEventsGroupEnabled (line 127) | public function isEventsGroupEnabled(): bool
    method handleExceptions (line 136) | public function handleExceptions(int $level): bool

FILE: src/Services/ConsoleService.php
  class ConsoleService (line 7) | class ConsoleService
    method __construct (line 24) | public function __construct(Application $app, ConfigService $configSer...
    method envInfo (line 33) | public function envInfo(): string
    method profilerStatusInfo (line 41) | public function profilerStatusInfo(): string
    method trackersStatusInfo (line 51) | public function trackersStatusInfo(): string
    method trackersCommentLine1 (line 59) | public function trackersCommentLine1(): string
    method trackersCommentLine2 (line 67) | public function trackersCommentLine2(): string
    method connectionStatusInfo (line 75) | public function connectionStatusInfo(): string
    method connectionSuccessfulInfo (line 83) | public function connectionSuccessfulInfo(): string
    method connectionSuccessfulSocketsInfo (line 92) | public function connectionSuccessfulSocketsInfo(int $socketsPort): string
    method connectionSuccessfulClientsInfo (line 101) | public function connectionSuccessfulClientsInfo(int $countClients): st...
    method connectionFailedInfo (line 109) | public function connectionFailedInfo(): string
    method connectionStatusUnknownInfo (line 117) | public function connectionStatusUnknownInfo(): string
    method profilerServerCmd (line 125) | public function profilerServerCmd(): string
    method profilerClientCmd (line 137) | public function profilerClientCmd(bool $manual): string

FILE: src/Services/GeneratorService.php
  class GeneratorService (line 5) | class GeneratorService
    method unique32CharsId (line 10) | public function unique32CharsId(): string

FILE: src/Services/LogService.php
  class LogService (line 8) | class LogService
    method __construct (line 22) | public function __construct(ConfigService $configService)
    method error (line 32) | public function error(Exception $e): void

FILE: src/Services/ParamsService.php
  class ParamsService (line 7) | class ParamsService
    method resolve (line 13) | public function resolve($param)
    method resolveFlattenFromArray (line 32) | public function resolveFlattenFromArray(array $params): array
    method resolveFlatten (line 43) | protected function resolveFlatten($param): string
    method resolveObject (line 64) | protected function resolveObject($param)

FILE: src/Services/Performance/MemoryService.php
  class MemoryService (line 9) | class MemoryService implements Memory
    method __construct (line 25) | public function __construct(Application $app)
    method recordPeak (line 34) | public function recordPeak(): void
    method all (line 42) | public function all(): Collection

FILE: src/Services/Performance/NullTimerService.php
  class NullTimerService (line 7) | class NullTimerService implements Timer
    method startCustom (line 13) | public function startCustom(string $name): void
    method finishCustom (line 22) | public function finishCustom(string $name): void
    method millisecondsCustom (line 31) | public function millisecondsCustom(string $name): float

FILE: src/Services/Performance/TimerException.php
  class TimerException (line 7) | class TimerException extends Exception

FILE: src/Services/Performance/TimerService.php
  class TimerService (line 9) | class TimerService implements Timer
    method __construct (line 30) | public function __construct(Application $app)
    method start (line 40) | public function start(string $name): void
    method finish (line 51) | public function finish(string $name): void
    method startCustom (line 63) | public function startCustom(string $name): void
    method finishCustom (line 77) | public function finishCustom(string $name): void
    method startLaravel (line 91) | public function startLaravel(): void
    method finishLaravel (line 101) | public function finishLaravel(): void
    method milliseconds (line 110) | public function milliseconds(string $name): float
    method millisecondsCustom (line 121) | public function millisecondsCustom(string $name): float
    method all (line 129) | public function all(): array
    method now (line 141) | protected function now(): float
    method laravelStartTimeOrNow (line 149) | protected function laravelStartTimeOrNow(): float
    method getByName (line 160) | protected function getByName(string $name): array
    method millisecondsOf (line 171) | protected function millisecondsOf(array $item): float
    method isCompleted (line 184) | protected function isCompleted(array $item): bool
    method guardTimerAlreadyStarted (line 194) | protected function guardTimerAlreadyStarted(string $name): void
    method guardTimerAlreadyFinished (line 206) | protected function guardTimerAlreadyFinished(string $name): void
    method guardTimerNotStartedYet (line 218) | protected function guardTimerNotStartedYet(string $name): void

FILE: src/Services/helpers.php
  function profiler_start (line 9) | function profiler_start(string $name): void
  function profiler_finish (line 20) | function profiler_finish(string $name): void
  function profiler_reset (line 31) | function profiler_reset(): void

FILE: src/Trackers/ApplicationTracker.php
  class ApplicationTracker (line 9) | class ApplicationTracker extends BaseTracker
    method __construct (line 21) | public function __construct(Application $app, GeneratorService $genera...
    method terminate (line 31) | public function terminate(): void

FILE: src/Trackers/AuthTracker.php
  class AuthTracker (line 8) | class AuthTracker extends BaseTracker
    method __construct (line 20) | public function __construct(Application $app, AuthListener $authListener)
    method terminate (line 31) | public function terminate(): void

FILE: src/Trackers/BaseTracker.php
  class BaseTracker (line 9) | abstract class BaseTracker implements Tracker
    method __construct (line 30) | public function __construct(Application $app)
    method meta (line 40) | public function meta(): Collection
    method data (line 48) | public function data(): Collection

FILE: src/Trackers/BindingsTracker.php
  class BindingsTracker (line 8) | class BindingsTracker extends BaseTracker
    method terminate (line 13) | public function terminate(): void
    method abstracts (line 32) | protected function abstracts(): Collection
    method resolved (line 44) | protected function resolved(string $abstract): string

FILE: src/Trackers/ConfigTracker.php
  class ConfigTracker (line 7) | class ConfigTracker extends BaseTracker
    method terminate (line 12) | public function terminate(): void
    method config (line 20) | protected function config(): Collection
    method hideSecretValues (line 33) | protected function hideSecretValues(array $config): array

FILE: src/Trackers/ContentTracker.php
  class ContentTracker (line 8) | class ContentTracker extends BaseTracker
    method __construct (line 20) | public function __construct(Application $app, ExecutionData $execution...
    method terminate (line 30) | public function terminate(): void

FILE: src/Trackers/EventsTracker.php
  class EventsTracker (line 11) | class EventsTracker extends BaseTracker
    method __construct (line 35) | public function __construct(
    method terminate (line 52) | public function terminate(): void
    method shouldTrackData (line 79) | protected function shouldTrackData(int $count): bool
    method resolveData (line 89) | protected function resolveData($event, $payload): Collection
    method propsMapWithKeys (line 111) | protected function propsMapWithKeys(Collection $publicProps, $event): ...
    method propsMap (line 127) | protected function propsMap(Collection $publicProps, $event): Collection

FILE: src/Trackers/ExceptionTracker.php
  class ExceptionTracker (line 12) | class ExceptionTracker extends BaseTracker
    method __construct (line 24) | public function __construct(Application $app, ExceptionListener $excep...
    method bindExceptionHandler (line 38) | protected function bindExceptionHandler(Application $app): void
    method terminate (line 52) | public function terminate(): void
    method exception (line 62) | protected function exception(): Collection

FILE: src/Trackers/PathsTracker.php
  class PathsTracker (line 7) | class PathsTracker extends BaseTracker
    method terminate (line 12) | public function terminate(): void
    method paths (line 27) | protected function paths(): Collection
    method resourcePath (line 52) | protected function resourcePath(): string
    method getCachedPackagesPath (line 62) | protected function getCachedPackagesPath(): string

FILE: src/Trackers/PerformanceTracker.php
  class PerformanceTracker (line 11) | class PerformanceTracker extends BaseTracker
    method __construct (line 30) | public function __construct(
    method terminate (line 46) | public function terminate(): void

FILE: src/Trackers/QueriesTracker.php
  class QueriesTracker (line 8) | class QueriesTracker extends BaseTracker
    method __construct (line 20) | public function __construct(Application $app, QueriesListener $queries...
    method terminate (line 31) | public function terminate(): void
    method terminateTransaction (line 49) | protected function terminateTransaction(array $item): array
    method terminateQuery (line 64) | protected function terminateQuery(array $item): array
    method isTransactionType (line 85) | protected function isTransactionType(string $type): bool
    method formatSql (line 100) | protected function formatSql(string $sql): string
    method queryWithBindings (line 110) | protected function queryWithBindings(array $bindingsQuoted, string $fo...
    method bindingRegex (line 123) | protected function bindingRegex($key): string

FILE: src/Trackers/RedisTracker.php
  class RedisTracker (line 8) | class RedisTracker extends BaseTracker
    method __construct (line 25) | public function __construct(Application $app, RedisListener $redisList...
    method terminate (line 38) | public function terminate(): void
    method terminateCommands (line 53) | protected function terminateCommands(array $item): array
    method enableRedisEvents (line 68) | protected function enableRedisEvents(): void

FILE: src/Trackers/RequestTracker.php
  class RequestTracker (line 8) | class RequestTracker extends BaseTracker
    method __construct (line 20) | public function __construct(Application $app, ExecutionData $execution...
    method terminate (line 30) | public function terminate(): void

FILE: src/Trackers/ResponseTracker.php
  class ResponseTracker (line 8) | class ResponseTracker extends BaseTracker
    method __construct (line 20) | public function __construct(Application $app, ExecutionData $execution...
    method terminate (line 30) | public function terminate(): void

FILE: src/Trackers/RouteTracker.php
  class RouteTracker (line 8) | class RouteTracker extends BaseTracker
    method __construct (line 20) | public function __construct(Application $app, ExecutionData $execution...
    method terminate (line 30) | public function terminate(): void

FILE: src/Trackers/ServerTracker.php
  class ServerTracker (line 8) | class ServerTracker extends BaseTracker
    method __construct (line 20) | public function __construct(Application $app, ExecutionData $execution...
    method terminate (line 30) | public function terminate(): void

FILE: src/Trackers/ServiceProvidersTracker.php
  class ServiceProvidersTracker (line 7) | class ServiceProvidersTracker extends BaseTracker
    method terminate (line 12) | public function terminate(): void
    method loadedProviders (line 20) | protected function loadedProviders(): Collection

FILE: src/Trackers/SessionTracker.php
  class SessionTracker (line 8) | class SessionTracker extends BaseTracker
    method __construct (line 20) | public function __construct(Application $app, ExecutionData $execution...
    method terminate (line 30) | public function terminate(): void

FILE: src/Trackers/ViewsTracker.php
  class ViewsTracker (line 11) | class ViewsTracker extends BaseTracker
    method __construct (line 35) | public function __construct(
    method terminate (line 52) | public function terminate(): void

FILE: tests/Feature/CommandsTest.php
  class CommandsTest (line 26) | class CommandsTest extends TestCase
    method countAllConfigurableTrackers (line 33) | protected function countAllConfigurableTrackers(): int
    method tells_status_if_profiler_is_enabled (line 44) | function tells_status_if_profiler_is_enabled()
    method lists_trackers_if_profiler_is_enabled (line 59) | function lists_trackers_if_profiler_is_enabled()
    method switches_processor_to_status_processor (line 84) | function switches_processor_to_status_processor()
    method status_processor_handles_when_connection_to_profiler_server_is_successful (line 95) | function status_processor_handles_when_connection_to_profiler_server_i...
    method status_processor_handles_when_connection_to_profiler_server_failed (line 124) | function status_processor_handles_when_connection_to_profiler_server_f...
    method tells_if_connection_to_profiler_server_is_successful (line 150) | function tells_if_connection_to_profiler_server_is_successful()
    method tells_if_connection_to_profiler_server_failed (line 198) | function tells_if_connection_to_profiler_server_failed()
    method tells_if_connection_to_profiler_server_has_unknown_status (line 240) | function tells_if_connection_to_profiler_server_has_unknown_status()
    method tells_status_if_profiler_is_disabled (line 276) | function tells_status_if_profiler_is_disabled()
    method can_start_profiler_server (line 300) | function can_start_profiler_server()
    method can_start_profiler_server_with_configured_ports (line 311) | function can_start_profiler_server_with_configured_ports()
    method tells_starting_message_for_profiler_server (line 327) | function tells_starting_message_for_profiler_server()
    method can_start_profiler_client (line 341) | function can_start_profiler_client()
    method can_start_profiler_client_with_manual_option (line 358) | function can_start_profiler_client_with_manual_option()
    method tells_starting_message_for_profiler_client (line 376) | function tells_starting_message_for_profiler_client()
    method beforeApplicationDestroyed (line 397) | protected function beforeApplicationDestroyed(callable $callback)

FILE: tests/Feature/LaravelConsoleExecutionTest.php
  class LaravelConsoleExecutionTest (line 19) | class LaravelConsoleExecutionTest extends TestCase
    method setUp (line 34) | protected function setUp(): void
    method has_console_request (line 46) | function has_console_request()
    method has_request_type (line 61) | function has_request_type()
    method has_request_method (line 76) | function has_request_method()
    method has_request_arguments (line 91) | function has_request_arguments()
    method has_request_options (line 107) | function has_request_options()
    method has_null_route (line 122) | function has_null_route()
    method has_null_session (line 131) | function has_null_session()
    method has_null_server (line 140) | function has_null_server()
    method has_console_response (line 149) | function has_console_response()
    method console_response_has_only_status (line 164) | function console_response_has_only_status()
    method has_null_content (line 184) | function has_null_content()

FILE: tests/Feature/LaravelExecutionTest.php
  class LaravelExecutionTest (line 8) | class LaravelExecutionTest extends TestCase
    method setUp (line 13) | protected function setUp(): void
    method laravel_execution_data_is_singleton (line 21) | function laravel_execution_data_is_singleton()

FILE: tests/Feature/LaravelHttpExecutionTest.php
  class LaravelHttpExecutionTest (line 22) | class LaravelHttpExecutionTest extends TestCase
    method setUp (line 32) | protected function setUp(): void
    method has_http_request (line 42) | function has_http_request()
    method has_request_type (line 51) | function has_request_type()
    method has_request_method (line 60) | function has_request_method()
    method has_request_path (line 69) | function has_request_path()
    method has_request_is_ajax (line 78) | function has_request_is_ajax()
    method has_request_is_json (line 88) | function has_request_is_json()
    method has_request_is_pjax (line 98) | function has_request_is_pjax()
    method has_request_url (line 108) | function has_request_url()
    method has_request_query (line 117) | function has_request_query()
    method can_have_empty_request_query (line 124) | function can_have_empty_request_query()
    method has_request_ip (line 131) | function has_request_ip()
    method has_request_server (line 140) | function has_request_server()
    method has_request_header (line 150) | function has_request_header()
    method has_request_input (line 159) | function has_request_input()
    method has_request_all_files (line 172) | function has_request_all_files()
    method has_request_all_files_if_they_are_in_array (line 238) | function has_request_all_files_if_they_are_in_array()
    method has_request_cookie (line 277) | function has_request_cookie()
    method has_http_route (line 309) | function has_http_route()
    method has_null_route_when_route_is_not_matched (line 318) | function has_null_route_when_route_is_not_matched()
    method has_route_methods (line 327) | function has_route_methods()
    method has_route_uri (line 340) | function has_route_uri()
    method has_route_name (line 353) | function has_route_name()
    method has_route_middleware (line 366) | function has_route_middleware()
    method has_route_parameters (line 379) | function has_route_parameters()
    method has_route_prefix (line 392) | function has_route_prefix()
    method has_route_closure_action (line 407) | function has_route_closure_action()
    method has_route_controller_action (line 430) | function has_route_controller_action()
    method has_route_without_form_request_if_form_request_is_not_defined (line 449) | function has_route_without_form_request_if_form_request_is_not_defined()
    method has_route_with_not_existing_controller (line 464) | function has_route_with_not_existing_controller()
    method has_http_session (line 492) | function has_http_session()
    method has_http_session_data (line 501) | function has_http_session_data()
    method has_http_response (line 514) | function has_http_response()
    method has_response_status (line 523) | function has_response_status()
    method can_have_response_unknown_status (line 533) | function can_have_response_unknown_status()
    method has_response_headers (line 547) | function has_response_headers()
    method has_response_content (line 556) | function has_response_content()

FILE: tests/Feature/LaravelNullExecutionTest.php
  class LaravelNullExecutionTest (line 14) | class LaravelNullExecutionTest extends TestCase
    method setUp (line 24) | protected function setUp(): void
    method has_null_request (line 35) | function has_null_request()
    method null_request_has_only_type (line 43) | function null_request_has_only_type()
    method has_null_route (line 54) | function has_null_route()
    method null_route_is_empty (line 62) | function null_route_is_empty()
    method has_null_session (line 71) | function has_null_session()
    method null_session_is_empty (line 79) | function null_session_is_empty()
    method has_null_server (line 88) | function has_null_server()
    method null_server_is_empty (line 96) | function null_server_is_empty()
    method has_null_response (line 105) | function has_null_response()
    method null_response_is_empty (line 113) | function null_response_is_empty()
    method has_null_content (line 122) | function has_null_content()
    method null_content_is_empty (line 130) | function null_content_is_empty()

FILE: tests/Feature/PerformanceTest.php
  class PerformanceTest (line 11) | class PerformanceTest extends TestCase
    method enabled_profiler_has_singleton_timer (line 14) | function enabled_profiler_has_singleton_timer()
    method disabled_profiler_has_singleton_null_timer (line 24) | function disabled_profiler_has_singleton_null_timer()
    method memory_is_singleton (line 37) | function memory_is_singleton()
    method tearDown (line 49) | protected function tearDown(): void

FILE: tests/Feature/PerformanceTrackerTest.php
  class PerformanceTrackerTest (line 14) | class PerformanceTrackerTest extends TestCase
    method setUp (line 19) | protected function setUp(): void
    method addFixturePerformanceProcessor (line 29) | protected function addFixturePerformanceProcessor(): void
    method has_laravel_total_execution_time (line 42) | function has_laravel_total_execution_time()
    method has_booting_time (line 54) | function has_booting_time()
    method has_route_time (line 65) | function has_route_time()
    method has_setup_time_instead_of_route_when_testing (line 76) | function has_setup_time_instead_of_route_when_testing()
    method has_handle_request_time (line 98) | function has_handle_request_time()
    method has_send_response_and_terminate_time (line 109) | function has_send_response_and_terminate_time()
    method has_console_time (line 120) | function has_console_time()
    method has_memory_peak (line 133) | function has_memory_peak()
    method tearDown (line 144) | protected function tearDown(): void

FILE: tests/Feature/RegisterProfilerTest.php
  class RegisterProfilerTest (line 25) | class RegisterProfilerTest extends TestCase
    method registerServiceProviderWith (line 34) | protected function registerServiceProviderWith(
    method loads_profiler_config_file (line 76) | function loads_profiler_config_file()
    method allows_config_file_to_be_published (line 84) | function allows_config_file_to_be_published()
    method profiler_is_enabled_by_default (line 93) | function profiler_is_enabled_by_default()
    method profiler_can_be_disabled_in_env_file (line 106) | function profiler_can_be_disabled_in_env_file()
    method profiler_can_be_disabled_in_config_file_for_specific_environment (line 121) | function profiler_can_be_disabled_in_config_file_for_specific_environm...
    method enabled_profiler_tracks_laravel (line 135) | function enabled_profiler_tracks_laravel()
    method disabled_profiler_does_not_track_laravel (line 162) | function disabled_profiler_does_not_track_laravel()
    method enabled_profiler_is_booted_before_all_service_providers_are_booted (line 191) | function enabled_profiler_is_booted_before_all_service_providers_are_b...
    method disabled_profiler_is_booted_before_all_service_providers_are_booted (line 213) | function disabled_profiler_is_booted_before_all_service_providers_are_...
    method enabled_profiler_registers_terminating_callback_after_all_service_providers_are_booted (line 237) | function enabled_profiler_registers_terminating_callback_after_all_ser...
    method tearDown (line 271) | protected function tearDown(): void

FILE: tests/Feature/RunningProfilerTest.php
  class RunningProfilerTest (line 19) | class RunningProfilerTest extends TestCase
    method collected_data_are_processed_when_laravel_is_terminated (line 22) | function collected_data_are_processed_when_laravel_is_terminated()
    method collected_data_are_broadcast_by_default (line 58) | function collected_data_are_broadcast_by_default()
    method collected_data_are_not_processed_for_debugbar (line 77) | function collected_data_are_not_processed_for_debugbar()
    method collected_data_are_not_processed_for_telescope (line 88) | function collected_data_are_not_processed_for_telescope()
    method processors_exceptions_are_caught_and_logged_if_configured (line 99) | function processors_exceptions_are_caught_and_logged_if_configured()
    method processors_exceptions_are_thrown_if_configured (line 124) | function processors_exceptions_are_thrown_if_configured()
    method processors_exceptions_are_caught_and_not_logged_if_configured (line 150) | function processors_exceptions_are_caught_and_not_logged_if_configured()
    method processors_exceptions_are_caught_and_not_logged_if_configured_incorrectly (line 174) | function processors_exceptions_are_caught_and_not_logged_if_configured...

FILE: tests/Feature/TrackersResetTest.php
  class TrackersResetTest (line 10) | class TrackersResetTest extends TestCase
    method trackers_can_be_reset (line 13) | function trackers_can_be_reset()
    method profiler_reset_function_can_be_executed_even_profiler_is_disabled (line 29) | function profiler_reset_function_can_be_executed_even_profiler_is_disa...

FILE: tests/Feature/TrackersTest.php
  class TrackersTest (line 27) | class TrackersTest extends TestCase
    method application_tracker_is_required (line 30) | function application_tracker_is_required()
    method request_tracker_is_required (line 54) | function request_tracker_is_required()
    method response_tracker_is_required (line 78) | function response_tracker_is_required()
    method performance_tracker_is_required (line 102) | function performance_tracker_is_required()
    method paths_tracker_is_enabled_by_default (line 126) | function paths_tracker_is_enabled_by_default()
    method service_providers_tracker_is_enabled_by_default (line 134) | function service_providers_tracker_is_enabled_by_default()
    method bindings_tracker_is_enabled_by_default (line 142) | function bindings_tracker_is_enabled_by_default()
    method config_tracker_is_enabled_by_default (line 150) | function config_tracker_is_enabled_by_default()
    method session_tracker_is_enabled_by_default (line 158) | function session_tracker_is_enabled_by_default()
    method route_tracker_is_enabled_by_default (line 166) | function route_tracker_is_enabled_by_default()
    method views_tracker_is_enabled_by_default (line 174) | function views_tracker_is_enabled_by_default()
    method events_tracker_is_enabled_by_default (line 182) | function events_tracker_is_enabled_by_default()
    method queries_tracker_is_enabled_by_default (line 190) | function queries_tracker_is_enabled_by_default()
    method server_tracker_is_enabled_by_default (line 198) | function server_tracker_is_enabled_by_default()
    method content_tracker_is_enabled_by_default (line 206) | function content_tracker_is_enabled_by_default()
    method auth_tracker_is_enabled_by_default (line 214) | function auth_tracker_is_enabled_by_default()
    method exception_tracker_is_enabled_by_default (line 222) | function exception_tracker_is_enabled_by_default()
    method redis_tracker_is_disabled_by_default (line 230) | function redis_tracker_is_disabled_by_default()

FILE: tests/Support/Fixtures/DummyClassA.php
  class DummyClassA (line 5) | class DummyClassA implements DummyContractA

FILE: tests/Support/Fixtures/DummyClassB.php
  class DummyClassB (line 5) | class DummyClassB implements DummyContractB

FILE: tests/Support/Fixtures/DummyCommand.php
  class DummyCommand (line 7) | class DummyCommand extends Command
    method __construct (line 18) | public function __construct(int $testExitCode)
    method handle (line 38) | public function handle()

FILE: tests/Support/Fixtures/DummyContractA.php
  type DummyContractA (line 5) | interface DummyContractA

FILE: tests/Support/Fixtures/DummyContractB.php
  type DummyContractB (line 5) | interface DummyContractB

FILE: tests/Support/Fixtures/DummyController.php
  class DummyController (line 7) | class DummyController extends Controller
    method dummyAction (line 13) | public function dummyAction(DummyFormRequest $request)

FILE: tests/Support/Fixtures/DummyEventA.php
  class DummyEventA (line 7) | class DummyEventA

FILE: tests/Support/Fixtures/DummyEventB.php
  class DummyEventB (line 9) | class DummyEventB
    method __construct (line 52) | public function __construct(

FILE: tests/Support/Fixtures/DummyException.php
  class DummyException (line 7) | class DummyException extends Exception
    method report (line 12) | public function report()

FILE: tests/Support/Fixtures/DummyFormRequest.php
  class DummyFormRequest (line 7) | class DummyFormRequest extends FormRequest
    method authorize (line 12) | public function authorize(): bool
    method rules (line 20) | public function rules(): array

FILE: tests/Support/Fixtures/PerformanceProcessor.php
  class PerformanceProcessor (line 9) | class PerformanceProcessor implements Processor
    method process (line 20) | public function process(DataTracker $dataTracker): void

FILE: tests/Support/Fixtures/ProcessorA.php
  class ProcessorA (line 9) | class ProcessorA implements Processor
    method __construct (line 24) | public function __construct()
    method process (line 34) | public function process(DataTracker $dataTracker): void

FILE: tests/Support/Fixtures/ProcessorB.php
  class ProcessorB (line 5) | class ProcessorB extends ProcessorA

FILE: tests/Support/Fixtures/TrackerA.php
  class TrackerA (line 8) | class TrackerA extends BaseTracker
    method __construct (line 14) | public function __construct(Application $app)
    method terminate (line 24) | public function terminate(): void

FILE: tests/Support/Fixtures/TrackerB.php
  class TrackerB (line 7) | class TrackerB extends BaseTracker
    method terminate (line 12) | public function terminate(): void

FILE: tests/Support/Framework.php
  class Framework (line 5) | class Framework
    method version (line 12) | public function version(): string
    method versionWithoutDot (line 20) | public function versionWithoutDot(): string
    method dir (line 28) | public function dir(): string
    method composerPackage (line 36) | public function composerPackage(): string

FILE: tests/Support/PHPMock.php
  class PHPMock (line 9) | class PHPMock
    method phpMock (line 18) | public static function phpMock(): MockEnvironment
    method timeMock (line 32) | protected static function timeMock(): MockBuilder
    method passthruMock (line 43) | protected static function passthruMock(): MockBuilder
    method phpVersionMock (line 54) | protected static function phpVersionMock(): MockBuilder
    method memoryUsageMock (line 65) | protected static function memoryUsageMock(): MockBuilder

FILE: tests/Support/TestListener.php
  class TestListener (line 9) | class TestListener implements BaseTestListener
    method startTest (line 22) | public function startTest(Test $test): void
    method printVersion (line 32) | protected function printVersion(Test $test): void

FILE: tests/TestCase.php
  class TestCase (line 19) | class TestCase extends BaseTestCase
    method setUpBeforeClass (line 48) | public static function setUpBeforeClass(): void
    method appBeforeBootstrap (line 56) | public function appBeforeBootstrap(): Application
    method setUp (line 64) | protected function setUp(): void
    method tearDown (line 74) | protected function tearDown(): void
    method app (line 82) | protected function app(): Application
    method appWith (line 99) | protected function appWith(Closure $beforeServiceProvider): Application
    method userClass (line 116) | protected function userClass(): string
    method factoryUser (line 124) | protected function factoryUser(): object
    method user (line 137) | protected function user(array $attributes = []): Model
    method turnOffProcessors (line 147) | protected function turnOffProcessors(): void
    method enablePhpMock (line 155) | protected function enablePhpMock(): void
    method disablePhpMock (line 164) | protected function disablePhpMock(): void
    method tapLaravelVersionTill (line 174) | protected function tapLaravelVersionTill(float $version, Closure $call...
    method tapLaravelVersionFrom (line 186) | protected function tapLaravelVersionFrom(float $version, Closure $call...
    method tapLaravelVersionBetween (line 199) | protected function tapLaravelVersionBetween(float $versionFrom, float ...

FILE: tests/Unit/LaravelExecution/ConsoleFinishedRequestTest.php
  class ConsoleFinishedRequestTest (line 10) | class ConsoleFinishedRequestTest extends TestCase
    method allows_command_to_be_null (line 13) | function allows_command_to_be_null()

FILE: tests/Unit/LaravelExecution/ConsoleStartingRequestTest.php
  class ConsoleStartingRequestTest (line 8) | class ConsoleStartingRequestTest extends TestCase
    method returns_meta_and_data (line 11) | function returns_meta_and_data()

FILE: tests/Unit/LaravelExecution/ConsoleStartingResponseTest.php
  class ConsoleStartingResponseTest (line 8) | class ConsoleStartingResponseTest extends TestCase
    method returns_meta_and_data (line 11) | function returns_meta_and_data()

FILE: tests/Unit/Services/ConfigServiceTest.php
  class ConfigServiceTest (line 14) | class ConfigServiceTest extends TestCase
    method returns_trackers (line 17) | function returns_trackers()
    method returns_processors (line 33) | function returns_processors()
    method returns_server_http_connection_url (line 49) | function returns_server_http_connection_url()
    method returns_server_http_port (line 57) | function returns_server_http_port()
    method returns_server_sockets_port (line 65) | function returns_server_sockets_port()
    method returns_handle_exceptions (line 73) | function returns_handle_exceptions()

FILE: tests/Unit/Services/HelpersTest.php
  class HelpersTest (line 7) | class HelpersTest extends TestCase
    method helpers_functions_can_not_brake_application_by_second_definition_in_global_namespace (line 10) | function helpers_functions_can_not_brake_application_by_second_definit...

FILE: tests/Unit/Services/ParamsServiceTest.php
  class ParamsServiceTest (line 10) | class ParamsServiceTest extends TestCase
    method returns_value_of_primitive_param_type (line 13) | function returns_value_of_primitive_param_type()
    method returns_array_of_object_param_if_is_available (line 25) | function returns_array_of_object_param_if_is_available()
    method returns_class_name_of_object_param_if_array_is_not_available (line 34) | function returns_class_name_of_object_param_if_array_is_not_available()
    method can_resolve_array_of_objects (line 43) | function can_resolve_array_of_objects()

FILE: tests/Unit/Services/Performance/TimerServiceTest.php
  class TimerServiceTest (line 14) | class TimerServiceTest extends TestCase
    method counts_execution_time_in_milliseconds (line 17) | function counts_execution_time_in_milliseconds()
    method counts_laravel_execution_time (line 38) | function counts_laravel_execution_time()
    method returns_all_finished_times (line 70) | function returns_all_finished_times()
    method returns_negative_value_when_timer_for_specific_label_is_not_completed (line 90) | function returns_negative_value_when_timer_for_specific_label_is_not_c...
    method allows_custom_timer_for_application_developers_but_keep_it_in_different_namespace (line 100) | function allows_custom_timer_for_application_developers_but_keep_it_in...
    method returns_empty_values_for_null_timer (line 112) | function returns_empty_values_for_null_timer()
    method the_same_custom_timer_can_not_be_started_more_than_once (line 123) | function the_same_custom_timer_can_not_be_started_more_than_once()
    method the_same_custom_timer_can_not_be_finished_more_than_once (line 139) | function the_same_custom_timer_can_not_be_finished_more_than_once()
    method custom_timer_can_not_be_finished_if_is_not_started_before (line 156) | function custom_timer_can_not_be_finished_if_is_not_started_before()
    method custom_timer_is_used_by_helper_functions (line 171) | function custom_timer_is_used_by_helper_functions()
    method custom_timer_functions_exceptions_are_caught_and_logged_if_configured (line 182) | function custom_timer_functions_exceptions_are_caught_and_logged_if_co...
    method custom_timer_functions_exceptions_are_thrown_if_configured (line 198) | function custom_timer_functions_exceptions_are_thrown_if_configured()
    method custom_timer_functions_exceptions_are_caught_and_not_logged_if_configured (line 220) | function custom_timer_functions_exceptions_are_caught_and_not_logged_i...
    method custom_timer_functions_exceptions_are_caught_and_not_logged_if_configured_incorrectly (line 235) | function custom_timer_functions_exceptions_are_caught_and_not_logged_i...

FILE: tests/Unit/Trackers/ApplicationTrackerTest.php
  class ApplicationTrackerTest (line 11) | class ApplicationTrackerTest extends TestCase
    method has_execution_at (line 14) | function has_execution_at()
    method has_profiler_single_execution_id (line 25) | function has_profiler_single_execution_id()
    method profiler_single_execution_id_is_unique (line 36) | function profiler_single_execution_id_is_unique()
    method has_laravel_version (line 50) | function has_laravel_version()
    method has_php_version (line 61) | function has_php_version()
    method has_env (line 72) | function has_env()
    method has_is_running_in_console (line 83) | function has_is_running_in_console()
    method has_locale (line 98) | function has_locale()
    method has_configuration_is_cached (line 110) | function has_configuration_is_cached()
    method has_routes_are_cached (line 126) | function has_routes_are_cached()
    method has_is_down_for_maintenance (line 142) | function has_is_down_for_maintenance()
    method has_should_skip_middleware (line 158) | function has_should_skip_middleware()

FILE: tests/Unit/Trackers/AuthTrackerTest.php
  class AuthTrackerTest (line 10) | class AuthTrackerTest extends TestCase
    method setUp (line 15) | protected function setUp(): void
    method tearDown (line 25) | protected function tearDown(): void
    method has_auth_user (line 33) | function has_auth_user()
    method has_auth_user_even_user_is_logging_out (line 47) | function has_auth_user_even_user_is_logging_out()
    method has_null_auth_user_if_user_is_not_logged_in (line 64) | function has_null_auth_user_if_user_is_not_logged_in()

FILE: tests/Unit/Trackers/BindingsTrackerTest.php
  class BindingsTrackerTest (line 12) | class BindingsTrackerTest extends TestCase
    method has_container_bindings_abstracts (line 15) | function has_container_bindings_abstracts()
    method tracks_how_container_resolves_bindings (line 29) | function tracks_how_container_resolves_bindings()

FILE: tests/Unit/Trackers/ConfigTrackerTest.php
  class ConfigTrackerTest (line 8) | class ConfigTrackerTest extends TestCase
    method has_config_data (line 11) | function has_config_data()
    method has_hidden_secret_config_data (line 23) | function has_hidden_secret_config_data()

FILE: tests/Unit/Trackers/ContentTrackerTest.php
  class ContentTrackerTest (line 11) | class ContentTrackerTest extends TestCase
    method has_content_meta (line 14) | function has_content_meta()
    method has_content_data (line 34) | function has_content_data()

FILE: tests/Unit/Trackers/EventsTrackerTest.php
  class EventsTrackerTest (line 20) | class EventsTrackerTest extends TestCase
    method has_fired_events (line 23) | function has_fired_events()
    method has_data_of_fired_events (line 46) | function has_data_of_fired_events()
    method has_not_data_of_fired_events_if_data_tracking_is_disabled_in_config (line 81) | function has_not_data_of_fired_events_if_data_tracking_is_disabled_in_...
    method can_group_events_with_the_same_name (line 104) | function can_group_events_with_the_same_name()
    method does_not_group_events_if_events_group_is_disabled_in_config (line 157) | function does_not_group_events_if_events_group_is_disabled_in_config()
    method does_not_track_laravel_profiler_internal_events (line 198) | function does_not_track_laravel_profiler_internal_events()
    method does_not_track_laravel_framework_events (line 214) | function does_not_track_laravel_framework_events()
    method can_reset_events (line 226) | function can_reset_events()

FILE: tests/Unit/Trackers/ExceptionTrackerTest.php
  class ExceptionTrackerTest (line 15) | class ExceptionTrackerTest extends TestCase
    method setUp (line 25) | protected function setUp(): void
    method has_exception (line 33) | function has_exception()
    method has_not_exception_on_correct_framework_execution (line 56) | function has_not_exception_on_correct_framework_execution()
    method calls_regular_laravel_exception_handler (line 69) | function calls_regular_laravel_exception_handler()

FILE: tests/Unit/Trackers/PathsTrackerTest.php
  class PathsTrackerTest (line 8) | class PathsTrackerTest extends TestCase
    method has_app_path (line 11) | function has_app_path()
    method has_base_path (line 23) | function has_base_path()
    method has_lang_path (line 34) | function has_lang_path()
    method has_config_path (line 45) | function has_config_path()
    method has_public_path (line 56) | function has_public_path()
    method has_storage_path (line 67) | function has_storage_path()
    method has_database_path (line 78) | function has_database_path()
    method has_resource_path (line 89) | function has_resource_path()
    method has_bootstrap_path (line 106) | function has_bootstrap_path()
    method has_cached_config_path (line 117) | function has_cached_config_path()
    method has_cached_routes_path (line 128) | function has_cached_routes_path()
    method has_cached_services_path (line 139) | function has_cached_services_path()
    method has_cached_packages_path (line 150) | function has_cached_packages_path()
    method has_environment_file_path (line 167) | function has_environment_file_path()

FILE: tests/Unit/Trackers/QueriesTrackerTest.php
  class QueriesTrackerTest (line 12) | class QueriesTrackerTest extends TestCase
    method setUp (line 17) | protected function setUp(): void
    method tearDown (line 27) | protected function tearDown(): void
    method has_executed_queries (line 35) | function has_executed_queries()
    method has_committed_transactions (line 58) | function has_committed_transactions()
    method has_rolled_back_transactions (line 78) | function has_rolled_back_transactions()
    method can_count_queries (line 96) | function can_count_queries()
    method can_count_queries_without_transactions (line 108) | function can_count_queries_without_transactions()
    method has_bindings_keys_names_if_specified (line 122) | function has_bindings_keys_names_if_specified()
    method has_query_bindings_for_int_and_float_values (line 135) | function has_query_bindings_for_int_and_float_values()
    method has_query_bindings_for_null_values (line 153) | function has_query_bindings_for_null_values()
    method has_query_bindings_for_bool_values (line 167) | function has_query_bindings_for_bool_values()
    method has_query_bindings_names_as_string (line 189) | function has_query_bindings_names_as_string()
    method has_query_bindings_objects (line 201) | function has_query_bindings_objects()
    method has_query_bindings_truncated_if_binding_string_is_long (line 215) | function has_query_bindings_truncated_if_binding_string_is_long()
    method can_reset_queries (line 231) | function can_reset_queries()

FILE: tests/Unit/Trackers/RedisTrackerTest.php
  class RedisTrackerTest (line 8) | class RedisTrackerTest extends TestCase
    method setUp (line 10) | protected function setUp(): void
    method has_executed_commands (line 16) | function has_executed_commands()
    method can_count_commands (line 38) | function can_count_commands()
    method knows_if_laravel_is_able_to_track_redis (line 55) | function knows_if_laravel_is_able_to_track_redis()
    method can_reset_commands (line 70) | function can_reset_commands()

FILE: tests/Unit/Trackers/RequestTrackerTest.php
  class RequestTrackerTest (line 11) | class RequestTrackerTest extends TestCase
    method has_request_meta (line 14) | function has_request_meta()
    method has_request_data (line 33) | function has_request_data()

FILE: tests/Unit/Trackers/ResponseTrackerTest.php
  class ResponseTrackerTest (line 11) | class ResponseTrackerTest extends TestCase
    method has_response_meta (line 14) | function has_response_meta()
    method has_response_data (line 33) | function has_response_data()

FILE: tests/Unit/Trackers/RouteTrackerTest.php
  class RouteTrackerTest (line 11) | class RouteTrackerTest extends TestCase
    method has_route_meta (line 14) | function has_route_meta()
    method has_route_data (line 33) | function has_route_data()

FILE: tests/Unit/Trackers/ServerTrackerTest.php
  class ServerTrackerTest (line 11) | class ServerTrackerTest extends TestCase
    method has_server_meta (line 14) | function has_server_meta()
    method has_server_data (line 33) | function has_server_data()

FILE: tests/Unit/Trackers/ServiceProvidersTrackerTest.php
  class ServiceProvidersTrackerTest (line 9) | class ServiceProvidersTrackerTest extends TestCase
    method has_loaded_service_providers (line 12) | function has_loaded_service_providers()

FILE: tests/Unit/Trackers/SessionTrackerTest.php
  class SessionTrackerTest (line 11) | class SessionTrackerTest extends TestCase
    method has_session_meta (line 14) | function has_session_meta()
    method has_session_data (line 33) | function has_session_data()

FILE: tests/Unit/Trackers/ViewsTrackerTest.php
  class ViewsTrackerTest (line 8) | class ViewsTrackerTest extends TestCase
    method setUp (line 13) | protected function setUp(): void
    method has_views (line 21) | function has_views()
    method has_view_name (line 36) | function has_view_name()
    method has_view_path (line 49) | function has_view_path()
    method has_view_data (line 62) | function has_view_data()
    method has_not_data_of_views_if_data_tracking_is_disabled_in_config (line 79) | function has_not_data_of_views_if_data_tracking_is_disabled_in_config()
    method has_view_params_if_data_tracking_is_disabled_in_config (line 93) | function has_view_params_if_data_tracking_is_disabled_in_config()
    method can_reset_views (line 136) | function can_reset_views()

FILE: tests/bootstrap/phpunit.php
  function bootstrapFramework (line 15) | function bootstrapFramework(\JKocik\Laravel\Profiler\Tests\Support\Frame...
  function bootstrapFrameworkEnv (line 30) | function bootstrapFrameworkEnv(\JKocik\Laravel\Profiler\Tests\Support\Fr...
Condensed preview — 174 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (324K chars).
[
  {
    "path": ".docker/etc/php/entrypoint.sh",
    "chars": 154,
    "preview": "#!/bin/sh\n\nredis-server --daemonize yes\n\nsetfacl -dR -m u:www-data:rwX /var/www/html\nsetfacl -R -m u:www-data:rwX /var/w"
  },
  {
    "path": ".docker/etc/php/php-v1.ini",
    "chars": 45,
    "preview": "memory_limit = 256M\nmax_execution_time = 600\n"
  },
  {
    "path": ".docker/etc/php/php-v2.ini",
    "chars": 66,
    "preview": "memory_limit = 256M\nmax_execution_time = 600\nxdebug.mode=coverage\n"
  },
  {
    "path": ".docker/images/php/.bashrc-v1",
    "chars": 815,
    "preview": "alias la52='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-52.xml'\nalias la53='vendor/bin/phpunit --stop-on-fai"
  },
  {
    "path": ".docker/images/php/.bashrc-v2",
    "chars": 298,
    "preview": "alias la6='vendor/bin/phpunit --stop-on-failure -c phpunit-laravel-6.xml'\nalias la7='vendor/bin/phpunit --stop-on-failur"
  },
  {
    "path": ".docker/images/php/Dockerfile-v1",
    "chars": 532,
    "preview": "FROM php:7.3.10-fpm\n\nCOPY ./.bashrc-v1 /root/.bashrc\n\nRUN apt-get update > /dev/null && apt-get install -y \\\n    acl \\\n "
  },
  {
    "path": ".docker/images/php/Dockerfile-v2",
    "chars": 531,
    "preview": "FROM php:8.0.6-fpm\n\nCOPY ./.bashrc-v2 /root/.bashrc\n\nRUN apt-get update > /dev/null && apt-get install -y \\\n    acl \\\n  "
  },
  {
    "path": ".gitignore",
    "chars": 74,
    "preview": "/client\n/coverage\n/frameworks\n/vendor\n.phpunit.result.cache\ncomposer.lock\n"
  },
  {
    "path": ".travis.yml",
    "chars": 408,
    "preview": "language: php\n\nphp:\n    - 7.3.24\n    - 7.4.0\n    - 8.0\n\nservices:\n    - redis-server\n\nbefore_script:\n    - composer inst"
  },
  {
    "path": "LICENSE.md",
    "chars": 1074,
    "preview": "The MIT License (MIT)\n\nCopyright (c) Janusz Kocik\n\nPermission is hereby granted, free of charge, to any person obtaining"
  },
  {
    "path": "README.md",
    "chars": 7185,
    "preview": "## Laravel Profiler\n\n[![Build Status](https://travis-ci.org/jkocik/laravel-profiler.svg?branch=master)](https://travis-c"
  },
  {
    "path": "composer.json",
    "chars": 1151,
    "preview": "{\n    \"name\": \"jkocik/laravel-profiler\",\n    \"description\": \"Profiler for Laravel Framework\",\n    \"keywords\": [\"laravel\""
  },
  {
    "path": "config/profiler.php",
    "chars": 5349,
    "preview": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | General La"
  },
  {
    "path": "docker-compose.yml",
    "chars": 853,
    "preview": "version: '3.5'\n\nservices:\n    profiler_v1:\n        build:\n            dockerfile: Dockerfile-v1\n            context: ./."
  },
  {
    "path": "phpunit-laravel-52.xml",
    "chars": 1051,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-53.xml",
    "chars": 1051,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-54.xml",
    "chars": 1051,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-55.xml",
    "chars": 1051,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-56.xml",
    "chars": 1051,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-57.xml",
    "chars": 1051,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-58.xml",
    "chars": 1051,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-6.xml",
    "chars": 1187,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-7.xml",
    "chars": 1099,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "phpunit-laravel-8.xml",
    "chars": 1099,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"./tests/bootstrap/phpunit.php\"\n          colors=\"true\"\n      "
  },
  {
    "path": "src/BaseProfiler.php",
    "chars": 1557,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler;\n\nuse Illuminate\\Support\\Facades\\Event;\nuse Illuminate\\Foundation\\Application;\n"
  },
  {
    "path": "src/Console/ClientCommand.php",
    "chars": 912,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Console;\n\nuse Illuminate\\Console\\Command;\nuse JKocik\\Laravel\\Profiler\\Services\\"
  },
  {
    "path": "src/Console/ServerCommand.php",
    "chars": 876,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Console;\n\nuse Illuminate\\Console\\Command;\nuse JKocik\\Laravel\\Profiler\\Services\\"
  },
  {
    "path": "src/Console/StatusCommand.php",
    "chars": 3470,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Console;\n\nuse Illuminate\\Console\\Command;\nuse Illuminate\\Support\\Facades\\Event;"
  },
  {
    "path": "src/Contracts/DataProcessor.php",
    "chars": 217,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\ninterface DataProcessor\n{\n    /**\n     * @param DataTracker $dataTr"
  },
  {
    "path": "src/Contracts/DataTracker.php",
    "chars": 428,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\nuse Illuminate\\Support\\Collection;\n\ninterface DataTracker\n{\n    /**"
  },
  {
    "path": "src/Contracts/ExecutionContent.php",
    "chars": 285,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\nuse Illuminate\\Support\\Collection;\n\ninterface ExecutionContent\n{\n  "
  },
  {
    "path": "src/Contracts/ExecutionData.php",
    "chars": 1504,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\ninterface ExecutionData\n{\n    /**\n     * @param ExecutionRequest $r"
  },
  {
    "path": "src/Contracts/ExecutionRequest.php",
    "chars": 285,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\nuse Illuminate\\Support\\Collection;\n\ninterface ExecutionRequest\n{\n  "
  },
  {
    "path": "src/Contracts/ExecutionResponse.php",
    "chars": 286,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\nuse Illuminate\\Support\\Collection;\n\ninterface ExecutionResponse\n{\n "
  },
  {
    "path": "src/Contracts/ExecutionRoute.php",
    "chars": 283,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\nuse Illuminate\\Support\\Collection;\n\ninterface ExecutionRoute\n{\n    "
  },
  {
    "path": "src/Contracts/ExecutionServer.php",
    "chars": 284,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\nuse Illuminate\\Support\\Collection;\n\ninterface ExecutionServer\n{\n   "
  },
  {
    "path": "src/Contracts/ExecutionSession.php",
    "chars": 285,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\nuse Illuminate\\Support\\Collection;\n\ninterface ExecutionSession\n{\n  "
  },
  {
    "path": "src/Contracts/ExecutionWatcher.php",
    "chars": 155,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\ninterface ExecutionWatcher\n{\n    /**\n     * @return void\n     */\n  "
  },
  {
    "path": "src/Contracts/LaravelListener.php",
    "chars": 155,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\ninterface LaravelListener\n{\n    /**\n     * @return void\n     */\n   "
  },
  {
    "path": "src/Contracts/Memory.php",
    "chars": 75,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\ninterface Memory\n{\n\n}\n"
  },
  {
    "path": "src/Contracts/Processor.php",
    "chars": 213,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\ninterface Processor\n{\n    /**\n     * @param DataTracker $dataTracke"
  },
  {
    "path": "src/Contracts/Profiler.php",
    "chars": 235,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\ninterface Profiler\n{\n    /**\n     * @return void\n     */\n    public"
  },
  {
    "path": "src/Contracts/Timer.php",
    "chars": 433,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\ninterface Timer\n{\n    /**\n     * @param string $name\n     * @return"
  },
  {
    "path": "src/Contracts/Tracker.php",
    "chars": 352,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Contracts;\n\nuse Illuminate\\Support\\Collection;\n\ninterface Tracker\n{\n    /**\n   "
  },
  {
    "path": "src/DisabledProfiler.php",
    "chars": 614,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler;\n\nuse JKocik\\Laravel\\Profiler\\Contracts\\Timer;\nuse JKocik\\Laravel\\Profiler\\Even"
  },
  {
    "path": "src/Events/ExceptionHandling.php",
    "chars": 350,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Events;\n\nuse Throwable;\n\nclass ExceptionHandling\n{\n    /**\n     * @var Throwabl"
  },
  {
    "path": "src/Events/ProfilerBound.php",
    "chars": 75,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Events;\n\nclass ProfilerBound\n{\n\n}\n"
  },
  {
    "path": "src/Events/ProfilerServerConnectionFailed.php",
    "chars": 92,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Events;\n\nclass ProfilerServerConnectionFailed\n{\n\n}\n"
  },
  {
    "path": "src/Events/ProfilerServerConnectionSuccessful.php",
    "chars": 515,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Events;\n\nclass ProfilerServerConnectionSuccessful\n{\n    /**\n     * @var int\n   "
  },
  {
    "path": "src/Events/ResetTrackers.php",
    "chars": 75,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Events;\n\nclass ResetTrackers\n{\n\n}\n"
  },
  {
    "path": "src/Events/Terminating.php",
    "chars": 73,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Events;\n\nclass Terminating\n{\n\n}\n"
  },
  {
    "path": "src/Events/Tracking.php",
    "chars": 70,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Events;\n\nclass Tracking\n{\n\n}\n"
  },
  {
    "path": "src/LaravelDataProcessor.php",
    "chars": 2208,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler;\n\nuse Exception;\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Prof"
  },
  {
    "path": "src/LaravelDataTracker.php",
    "chars": 2480,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Foundation\\Application;\nuse"
  },
  {
    "path": "src/LaravelExecution/ConsoleFinishedRequest.php",
    "chars": 1147,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse Symfony\\Component\\Con"
  },
  {
    "path": "src/LaravelExecution/ConsoleFinishedResponse.php",
    "chars": 768,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecution/ConsoleStartingRequest.php",
    "chars": 523,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecution/ConsoleStartingResponse.php",
    "chars": 514,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecution/ExceptionHandlerFromVersion7.php",
    "chars": 432,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Throwable;\nuse App\\Exceptions\\Handler;\nuse JKocik\\Larave"
  },
  {
    "path": "src/LaravelExecution/ExceptionHandlerTillVersion6.php",
    "chars": 432,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Exception;\nuse App\\Exceptions\\Handler;\nuse JKocik\\Larave"
  },
  {
    "path": "src/LaravelExecution/HttpContent.php",
    "chars": 819,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse Symfony\\Component\\Htt"
  },
  {
    "path": "src/LaravelExecution/HttpRequest.php",
    "chars": 2720,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Http\\UploadedFil"
  },
  {
    "path": "src/LaravelExecution/HttpResponse.php",
    "chars": 1145,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse Symfony\\Component\\Htt"
  },
  {
    "path": "src/LaravelExecution/HttpRoute.php",
    "chars": 3372,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Closure;\nuse ReflectionMethod;\nuse ReflectionFunction;\nu"
  },
  {
    "path": "src/LaravelExecution/HttpServer.php",
    "chars": 768,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collecti"
  },
  {
    "path": "src/LaravelExecution/HttpSession.php",
    "chars": 778,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Session\\Se"
  },
  {
    "path": "src/LaravelExecution/LaravelExecutionData.php",
    "chars": 3241,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse JKocik\\Laravel\\Profiler\\Contracts\\ExecutionData;\nuse JKo"
  },
  {
    "path": "src/LaravelExecution/NullContent.php",
    "chars": 459,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecution/NullRequest.php",
    "chars": 498,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecution/NullResponse.php",
    "chars": 462,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecution/NullRoute.php",
    "chars": 453,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecution/NullServer.php",
    "chars": 456,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecution/NullSession.php",
    "chars": 459,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelExecution;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\Profil"
  },
  {
    "path": "src/LaravelExecutionWatcher.php",
    "chars": 1253,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler;\n\nuse JKocik\\Laravel\\Profiler\\Contracts\\ExecutionWatcher;\nuse JKocik\\Laravel\\Pr"
  },
  {
    "path": "src/LaravelListeners/AuthListener.php",
    "chars": 705,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Illuminate\\Auth\\Events\\Logout;\nuse Illuminate\\Support\\Fa"
  },
  {
    "path": "src/LaravelListeners/ConsoleCommandFinishedListener.php",
    "chars": 1506,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Illuminate\\Support\\Facades\\Event;\nuse JKocik\\Laravel\\Pro"
  },
  {
    "path": "src/LaravelListeners/EventsListener.php",
    "chars": 3895,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Col"
  },
  {
    "path": "src/LaravelListeners/ExceptionListener.php",
    "chars": 688,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Throwable;\nuse Illuminate\\Support\\Facades\\Event;\nuse JKo"
  },
  {
    "path": "src/LaravelListeners/HttpRequestHandledListener.php",
    "chars": 2633,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\"
  },
  {
    "path": "src/LaravelListeners/PerformanceListener.php",
    "chars": 3008,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Illuminate\\Support\\Facades\\Event;\nuse Illuminate\\Foundat"
  },
  {
    "path": "src/LaravelListeners/QueriesListener.php",
    "chars": 4027,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Fa"
  },
  {
    "path": "src/LaravelListeners/RedisListener.php",
    "chars": 1520,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Fa"
  },
  {
    "path": "src/LaravelListeners/ViewsListener.php",
    "chars": 1269,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\LaravelListeners;\n\nuse Illuminate\\View\\View;\nuse Illuminate\\Support\\Collection;"
  },
  {
    "path": "src/LaravelProfiler.php",
    "chars": 2616,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler;\n\nuse JKocik\\Laravel\\Profiler\\Events\\Tracking;\nuse JKocik\\Laravel\\Profiler\\Cont"
  },
  {
    "path": "src/Processors/BroadcastingProcessor.php",
    "chars": 1492,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Processors;\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Psr7\\Response;\nuse JKocik\\La"
  },
  {
    "path": "src/Processors/StatusCommandProcessor.php",
    "chars": 951,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Processors;\n\nuse GuzzleHttp\\Exception\\ConnectException;\nuse JKocik\\Laravel\\Prof"
  },
  {
    "path": "src/ProfilerResolver.php",
    "chars": 919,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\Contracts\\"
  },
  {
    "path": "src/ServiceProvider.php",
    "chars": 1080,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler;\n\nuse JKocik\\Laravel\\Profiler\\Contracts\\Profiler;\nuse Illuminate\\Support\\Servic"
  },
  {
    "path": "src/Services/ConfigService.php",
    "chars": 3073,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services;\n\nuse Illuminate\\Config\\Repository;\nuse Illuminate\\Support\\Collection;"
  },
  {
    "path": "src/Services/ConsoleService.php",
    "chars": 3268,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services;\n\nuse Illuminate\\Foundation\\Application;\n\nclass ConsoleService\n{\n    /"
  },
  {
    "path": "src/Services/GeneratorService.php",
    "chars": 213,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services;\n\nclass GeneratorService\n{\n    /**\n     * @return string\n     */\n    p"
  },
  {
    "path": "src/Services/LogService.php",
    "chars": 874,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services;\n\nuse Exception;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass LogService"
  },
  {
    "path": "src/Services/ParamsService.php",
    "chars": 1498,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services;\n\nuse Illuminate\\Support\\Collection;\n\nclass ParamsService\n{\n    /**\n  "
  },
  {
    "path": "src/Services/Performance/MemoryService.php",
    "chars": 837,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services\\Performance;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Founda"
  },
  {
    "path": "src/Services/Performance/NullTimerService.php",
    "chars": 568,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services\\Performance;\n\nuse JKocik\\Laravel\\Profiler\\Contracts\\Timer;\n\nclass Null"
  },
  {
    "path": "src/Services/Performance/TimerException.php",
    "chars": 124,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services\\Performance;\n\nuse Exception;\n\nclass TimerException extends Exception\n{"
  },
  {
    "path": "src/Services/Performance/TimerService.php",
    "chars": 4939,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Services\\Performance;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Founda"
  },
  {
    "path": "src/Services/helpers.php",
    "chars": 930,
    "preview": "<?php\n\nuse JKocik\\Laravel\\Profiler\\Contracts\\Timer;\nuse JKocik\\Laravel\\Profiler\\Contracts\\Profiler;\nuse JKocik\\Laravel\\P"
  },
  {
    "path": "src/Trackers/ApplicationTracker.php",
    "chars": 1530,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Foundation\\Applica"
  },
  {
    "path": "src/Trackers/AuthTracker.php",
    "chars": 744,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\L"
  },
  {
    "path": "src/Trackers/BaseTracker.php",
    "chars": 899,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Foundation\\Applica"
  },
  {
    "path": "src/Trackers/BindingsTracker.php",
    "chars": 1331,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Contracts\\Containe"
  },
  {
    "path": "src/Trackers/ConfigTracker.php",
    "chars": 1106,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Collection;\n\nclass ConfigTracker extends Base"
  },
  {
    "path": "src/Trackers/ContentTracker.php",
    "chars": 814,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\C"
  },
  {
    "path": "src/Trackers/EventsTracker.php",
    "chars": 3537,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Foundation\\Applica"
  },
  {
    "path": "src/Trackers/ExceptionTracker.php",
    "chars": 2120,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Arr;\nuse Illuminate\\Support\\Collection;\nuse I"
  },
  {
    "path": "src/Trackers/PathsTracker.php",
    "chars": 1962,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Collection;\n\nclass PathsTracker extends BaseT"
  },
  {
    "path": "src/Trackers/PerformanceTracker.php",
    "chars": 1203,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Foundation\\Applica"
  },
  {
    "path": "src/Trackers/QueriesTracker.php",
    "chars": 3089,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\L"
  },
  {
    "path": "src/Trackers/RedisTracker.php",
    "chars": 1832,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\L"
  },
  {
    "path": "src/Trackers/RequestTracker.php",
    "chars": 798,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\C"
  },
  {
    "path": "src/Trackers/ResponseTracker.php",
    "chars": 804,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\C"
  },
  {
    "path": "src/Trackers/RouteTracker.php",
    "chars": 786,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\C"
  },
  {
    "path": "src/Trackers/ServerTracker.php",
    "chars": 791,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\C"
  },
  {
    "path": "src/Trackers/ServiceProvidersTracker.php",
    "chars": 510,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Support\\Collection;\n\nclass ServiceProvidersTracker ex"
  },
  {
    "path": "src/Trackers/SessionTracker.php",
    "chars": 798,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel\\Profiler\\C"
  },
  {
    "path": "src/Trackers/ViewsTracker.php",
    "chars": 1861,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Trackers;\n\nuse Illuminate\\View\\View;\nuse Illuminate\\Foundation\\Application;\nuse"
  },
  {
    "path": "tests/Feature/CommandsTest.php",
    "chars": 15226,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse Mockery;\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Psr7\\Request"
  },
  {
    "path": "tests/Feature/LaravelConsoleExecutionTest.php",
    "chars": 5982,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse Illuminate\\Support\\Facades\\Artisan;\nuse Illuminate\\Contract"
  },
  {
    "path": "tests/Feature/LaravelExecutionTest.php",
    "chars": 625,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\Laravel\\"
  },
  {
    "path": "tests/Feature/LaravelHttpExecutionTest.php",
    "chars": 17871,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse ReflectionMethod;\nuse ReflectionFunction;\nuse ReflectionExc"
  },
  {
    "path": "tests/Feature/LaravelNullExecutionTest.php",
    "chars": 3323,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\Laravel\\"
  },
  {
    "path": "tests/Feature/PerformanceTest.php",
    "chars": 1548,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\Laravel\\"
  },
  {
    "path": "tests/Feature/PerformanceTrackerTest.php",
    "chars": 4897,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse Illuminate\\Foundation\\Application;\nuse Illuminate\\Support\\F"
  },
  {
    "path": "tests/Feature/RegisterProfilerTest.php",
    "chars": 10555,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse Mockery;\nuse Illuminate\\Support\\Facades\\Event;\nuse Illumina"
  },
  {
    "path": "tests/Feature/RunningProfilerTest.php",
    "chars": 6776,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse Mockery;\nuse Exception;\nuse GuzzleHttp\\Client;\nuse GuzzleHt"
  },
  {
    "path": "tests/Feature/TrackersResetTest.php",
    "chars": 1068,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse Illuminate\\Support\\Facades\\Event;\nuse Illuminate\\Foundation"
  },
  {
    "path": "tests/Feature/TrackersTest.php",
    "chars": 8610,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Feature;\n\nuse Mockery;\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\"
  },
  {
    "path": "tests/Support/Fixtures/DummyClassA.php",
    "chars": 115,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nclass DummyClassA implements DummyContractA\n{\n\n}\n"
  },
  {
    "path": "tests/Support/Fixtures/DummyClassB.php",
    "chars": 115,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nclass DummyClassB implements DummyContractB\n{\n\n}\n"
  },
  {
    "path": "tests/Support/Fixtures/DummyCommand.php",
    "chars": 775,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse Illuminate\\Console\\Command;\n\nclass DummyCommand ex"
  },
  {
    "path": "tests/Support/Fixtures/DummyContractA.php",
    "chars": 96,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\ninterface DummyContractA\n{\n\n}\n"
  },
  {
    "path": "tests/Support/Fixtures/DummyContractB.php",
    "chars": 96,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\ninterface DummyContractB\n{\n\n}\n"
  },
  {
    "path": "tests/Support/Fixtures/DummyController.php",
    "chars": 333,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse App\\Http\\Controllers\\Controller;\n\nclass DummyContr"
  },
  {
    "path": "tests/Support/Fixtures/DummyEventA.php",
    "chars": 154,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse Illuminate\\Queue\\SerializesModels;\n\nclass DummyEve"
  },
  {
    "path": "tests/Support/Fixtures/DummyEventB.php",
    "chars": 1186,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Queu"
  },
  {
    "path": "tests/Support/Fixtures/DummyException.php",
    "chars": 203,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse Exception;\n\nclass DummyException extends Exception"
  },
  {
    "path": "tests/Support/Fixtures/DummyFormRequest.php",
    "chars": 410,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse Illuminate\\Foundation\\Http\\FormRequest;\n\nclass Dum"
  },
  {
    "path": "tests/Support/Fixtures/PerformanceProcessor.php",
    "chars": 537,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\"
  },
  {
    "path": "tests/Support/Fixtures/ProcessorA.php",
    "chars": 769,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse Illuminate\\Support\\Collection;\nuse JKocik\\Laravel\\"
  },
  {
    "path": "tests/Support/Fixtures/ProcessorB.php",
    "chars": 107,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nclass ProcessorB extends ProcessorA\n{\n\n}\n"
  },
  {
    "path": "tests/Support/Fixtures/TrackerA.php",
    "chars": 509,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Lara"
  },
  {
    "path": "tests/Support/Fixtures/TrackerB.php",
    "chars": 294,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support\\Fixtures;\n\nuse JKocik\\Laravel\\Profiler\\Trackers\\BaseTracker;\n\ncla"
  },
  {
    "path": "tests/Support/Fixtures/dummy-view-a.blade.php",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "tests/Support/Fixtures/dummy-view-b.blade.php",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "tests/Support/Framework.php",
    "chars": 703,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support;\n\nclass Framework\n{\n    protected const VERSION = TESTS_FRAMEWORK"
  },
  {
    "path": "tests/Support/PHPMock.php",
    "chars": 2011,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support;\n\nuse phpmock\\MockBuilder;\nuse phpmock\\environment\\MockEnvironmen"
  },
  {
    "path": "tests/Support/TestListener.php",
    "chars": 794,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Support;\n\nuse PHPUnit\\Framework\\Test;\nuse PHPUnit\\Framework\\TestListener "
  },
  {
    "path": "tests/TestCase.php",
    "chars": 4719,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests;\n\nuse Closure;\nuse Illuminate\\Foundation\\Application;\nuse Illuminate\\Data"
  },
  {
    "path": "tests/Unit/LaravelExecution/ConsoleFinishedRequestTest.php",
    "chars": 580,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\LaravelExecution;\n\nuse Mockery;\nuse JKocik\\Laravel\\Profiler\\Tests\\Te"
  },
  {
    "path": "tests/Unit/LaravelExecution/ConsoleStartingRequestTest.php",
    "chars": 529,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\LaravelExecution;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse J"
  },
  {
    "path": "tests/Unit/LaravelExecution/ConsoleStartingResponseTest.php",
    "chars": 513,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\LaravelExecution;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse J"
  },
  {
    "path": "tests/Unit/Services/ConfigServiceTest.php",
    "chars": 2396,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Services;\n\nuse Illuminate\\Foundation\\Application;\nuse JKocik\\Laravel"
  },
  {
    "path": "tests/Unit/Services/HelpersTest.php",
    "chars": 374,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Services;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\n\nclass Helper"
  },
  {
    "path": "tests/Unit/Services/ParamsServiceTest.php",
    "chars": 1815,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Services;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\La"
  },
  {
    "path": "tests/Unit/Services/Performance/TimerServiceTest.php",
    "chars": 7574,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Services\\Performance;\n\nuse Mockery;\nuse Illuminate\\Support\\Facades\\L"
  },
  {
    "path": "tests/Unit/Trackers/ApplicationTrackerTest.php",
    "chars": 5401,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Mockery;\nuse Illuminate\\Foundation\\Application;\nuse J"
  },
  {
    "path": "tests/Unit/Trackers/AuthTrackerTest.php",
    "chars": 1642,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Illuminate\\Support\\Facades\\Auth;\nuse Illuminate\\Suppo"
  },
  {
    "path": "tests/Unit/Trackers/BindingsTrackerTest.php",
    "chars": 1609,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\La"
  },
  {
    "path": "tests/Unit/Trackers/ConfigTrackerTest.php",
    "chars": 2046,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\La"
  },
  {
    "path": "tests/Unit/Trackers/ContentTrackerTest.php",
    "chars": 1623,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Mockery;\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\n"
  },
  {
    "path": "tests/Unit/Trackers/EventsTrackerTest.php",
    "chars": 9436,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Exception;\nuse Illuminate\\Events\\Dispatcher;\nuse JKoc"
  },
  {
    "path": "tests/Unit/Trackers/ExceptionTrackerTest.php",
    "chars": 2583,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Mockery;\nuse Illuminate\\Support\\Arr;\nuse Illuminate\\S"
  },
  {
    "path": "tests/Unit/Trackers/PathsTrackerTest.php",
    "chars": 5229,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\La"
  },
  {
    "path": "tests/Unit/Trackers/QueriesTrackerTest.php",
    "chars": 8928,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Exception;\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\"
  },
  {
    "path": "tests/Unit/Trackers/RedisTrackerTest.php",
    "chars": 2980,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\La"
  },
  {
    "path": "tests/Unit/Trackers/RequestTrackerTest.php",
    "chars": 1913,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Mockery;\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\n"
  },
  {
    "path": "tests/Unit/Trackers/ResponseTrackerTest.php",
    "chars": 1933,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Mockery;\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\n"
  },
  {
    "path": "tests/Unit/Trackers/RouteTrackerTest.php",
    "chars": 1873,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Mockery;\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\n"
  },
  {
    "path": "tests/Unit/Trackers/ServerTrackerTest.php",
    "chars": 1893,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Mockery;\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\n"
  },
  {
    "path": "tests/Unit/Trackers/ServiceProvidersTrackerTest.php",
    "chars": 949,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Illuminate\\Support\\ServiceProvider;\nuse JKocik\\Larave"
  },
  {
    "path": "tests/Unit/Trackers/SessionTrackerTest.php",
    "chars": 1913,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse Mockery;\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\n"
  },
  {
    "path": "tests/Unit/Trackers/ViewsTrackerTest.php",
    "chars": 4088,
    "preview": "<?php\n\nnamespace JKocik\\Laravel\\Profiler\\Tests\\Unit\\Trackers;\n\nuse JKocik\\Laravel\\Profiler\\Tests\\TestCase;\nuse JKocik\\La"
  },
  {
    "path": "tests/bootstrap/phpunit.php",
    "chars": 1138,
    "preview": "<?php\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\n\n$framework = new \\JKocik\\Laravel\\Profiler\\Tests\\Support\\Fra"
  }
]

About this extraction

This page contains the full source code of the jkocik/laravel-profiler GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 174 files (292.3 KB), approximately 75.3k tokens, and a symbol index with 752 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!