mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
chore: add Symfony Profiler integration for PHPFlasher
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
--ignore-dir=node_modules
|
||||
--ignore-dir=demo/laravel/vendor
|
||||
--ignore-dir=demo/symfony/vendor
|
||||
--ignore-dir=demo/symfony/var
|
||||
--ignore-dir=.cache
|
||||
--ignore-dir=docs/.jekyll-cache
|
||||
--ignore-dir=docs/_site
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
## [Unreleased](https://github.com/php-flasher/php-flasher/compare/v2.0.4...2.x)
|
||||
|
||||
* feature [Symfony] Add Symfony Profiler integration for PHPFlasher. See [PR #198](https://github.com/php-flasher/php-flasher/pull/198) by [yoeunes](https://github.com/yoeunes)
|
||||
|
||||
## [v2.0.4](https://github.com/php-flasher/php-flasher/compare/v2.0.3...v2.0.4) - 2024-09-22
|
||||
|
||||
* bug [laravel] Changed HttpKernel import from `Illuminate\Foundation\Http\Kernel` to `Illuminate\Contracts\Http\Kernel` to use the contract interface instead of the concrete implementation. See [PR #197](https://github.com/php-flasher/php-flasher/pull/197) by [yoeunes](https://github.com/yoeunes)
|
||||
|
||||
+19
-19
@@ -21,29 +21,14 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"ext-intl": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-intl": "*",
|
||||
"illuminate/contracts": "^11.0",
|
||||
"illuminate/routing": "^11.0",
|
||||
"illuminate/support": "^11.0",
|
||||
"larastan/larastan": "^2.9",
|
||||
"laravel/octane": "^2.3",
|
||||
"livewire/livewire": "^3.5",
|
||||
"mockery/mockery": "^1.6",
|
||||
"orchestra/testbench": "^9.4",
|
||||
"overtrue/phplint": "^9.4",
|
||||
"livewire/livewire": "^3.0",
|
||||
"paragonie/random_compat": "^2.0",
|
||||
"php-cs-fixer/shim": "^3.64",
|
||||
"phpstan/phpstan": "^1.12",
|
||||
"phpstan/phpstan-mockery": "^1.1",
|
||||
"phpstan/phpstan-phpunit": "^1.4",
|
||||
"phpstan/phpstan-symfony": "^1.4",
|
||||
"phpunit/phpunit": "^10.5",
|
||||
"psr/container": "^1.1|^2.0",
|
||||
"rector/rector": "^1.2",
|
||||
"rector/swiss-knife": "^0.2",
|
||||
"spatie/ray": "^1.41",
|
||||
"symfony/config": "^7.0",
|
||||
"symfony/console": "^7.0",
|
||||
"symfony/dependency-injection": "^7.0",
|
||||
@@ -51,8 +36,23 @@
|
||||
"symfony/http-kernel": "^7.0",
|
||||
"symfony/translation": "^7.0",
|
||||
"symfony/twig-bundle": "^7.0",
|
||||
"symfony/ux-twig-component": "^2.19",
|
||||
"symplify/monorepo-builder": "^11.2"
|
||||
"symfony/ux-twig-component": "^2.19"
|
||||
},
|
||||
"require-dev": {
|
||||
"larastan/larastan": "^2.9.8",
|
||||
"mockery/mockery": "^1.6.12",
|
||||
"orchestra/testbench": "^9.5.0",
|
||||
"overtrue/phplint": "^9.4.1",
|
||||
"php-cs-fixer/shim": "^3.64",
|
||||
"phpstan/phpstan": "^1.12.5",
|
||||
"phpstan/phpstan-mockery": "^1.1.3",
|
||||
"phpstan/phpstan-phpunit": "^1.4",
|
||||
"phpstan/phpstan-symfony": "^1.4.9",
|
||||
"phpunit/phpunit": "^10.5.1",
|
||||
"rector/rector": "^1.2.5",
|
||||
"rector/swiss-knife": "^0.2.35",
|
||||
"spatie/ray": "^1.41.2",
|
||||
"symplify/monorepo-builder": "^11.2.22"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
Generated
+3839
-3828
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,7 @@
|
||||
"spatie/laravel-ray": "^1.36"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.14",
|
||||
"fakerphp/faker": "^1.23",
|
||||
"larastan/larastan": "^2.9",
|
||||
"laravel/pint": "^1.13",
|
||||
|
||||
Generated
+2168
-448
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,4 @@
|
||||
--ignore-dir=vendor
|
||||
--ignore-dir=yoeunes
|
||||
--ignore-dir=node_modules
|
||||
--ignore-dir=var
|
||||
@@ -23,6 +23,8 @@
|
||||
"symfony/dotenv": "7.0.*",
|
||||
"symfony/flex": "^2",
|
||||
"symfony/framework-bundle": "7.0.*",
|
||||
"symfony/monolog-bundle": "^3.10",
|
||||
"symfony/notifier": "7.0.*",
|
||||
"symfony/runtime": "7.0.*",
|
||||
"symfony/translation": "7.0.*",
|
||||
"symfony/twig-bundle": "7.0.*",
|
||||
@@ -82,6 +84,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"spatie/ray": "^1.41",
|
||||
"symfony/maker-bundle": "^1.58"
|
||||
"symfony/maker-bundle": "^1.58",
|
||||
"symfony/stopwatch": "7.0.*",
|
||||
"symfony/web-profiler-bundle": "7.0.*"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+422
-2
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "41085080102fac8108116dd57eb6f4b8",
|
||||
"content-hash": "c6f94aab62289321374da1ca7db14650",
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/ca-bundle",
|
||||
@@ -82,6 +82,107 @@
|
||||
],
|
||||
"time": "2024-03-15T14:00:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "3.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f4393b648b78a5408747de94fca38beb5f7e9ef8",
|
||||
"reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"psr/log": "^2.0 || ^3.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "3.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "^3.0",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"elasticsearch/elasticsearch": "^7 || ^8",
|
||||
"ext-json": "*",
|
||||
"graylog2/gelf-php": "^1.4.2 || ^2.0",
|
||||
"guzzlehttp/guzzle": "^7.4.5",
|
||||
"guzzlehttp/psr7": "^2.2",
|
||||
"mongodb/mongodb": "^1.8",
|
||||
"php-amqplib/php-amqplib": "~2.4 || ^3",
|
||||
"phpstan/phpstan": "^1.9",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.4",
|
||||
"phpunit/phpunit": "^10.5.17",
|
||||
"predis/predis": "^1.1 || ^2",
|
||||
"ruflin/elastica": "^7",
|
||||
"symfony/mailer": "^5.4 || ^6",
|
||||
"symfony/mime": "^5.4 || ^6"
|
||||
},
|
||||
"suggest": {
|
||||
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
|
||||
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
|
||||
"elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client",
|
||||
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
|
||||
"ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler",
|
||||
"ext-mbstring": "Allow to work properly with unicode symbols",
|
||||
"ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)",
|
||||
"ext-openssl": "Required to send log messages using SSL",
|
||||
"ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)",
|
||||
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
|
||||
"mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)",
|
||||
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
|
||||
"rollbar/rollbar": "Allow sending log messages to Rollbar",
|
||||
"ruflin/elastica": "Allow sending log messages to an Elastic Search server"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Monolog\\": "src/Monolog"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jordi Boggiano",
|
||||
"email": "j.boggiano@seld.be",
|
||||
"homepage": "https://seld.be"
|
||||
}
|
||||
],
|
||||
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
||||
"homepage": "https://github.com/Seldaek/monolog",
|
||||
"keywords": [
|
||||
"log",
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/Seldaek/monolog/issues",
|
||||
"source": "https://github.com/Seldaek/monolog/tree/3.7.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/Seldaek",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-06-28T09:40:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nelmio/security-bundle",
|
||||
"version": "v3.3.0",
|
||||
@@ -161,13 +262,14 @@
|
||||
"dist": {
|
||||
"type": "path",
|
||||
"url": "../..",
|
||||
"reference": "8d0dff222474071fa534271bddd9e6f40a58ac93"
|
||||
"reference": "b6afde2990c365f848a38478e32d22e75d038716"
|
||||
},
|
||||
"require": {
|
||||
"ext-intl": "*",
|
||||
"php": ">=8.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"illuminate/contracts": "^11.0",
|
||||
"illuminate/routing": "^11.0",
|
||||
"illuminate/support": "^11.0",
|
||||
"larastan/larastan": "^2.9",
|
||||
@@ -1929,6 +2031,243 @@
|
||||
],
|
||||
"time": "2024-04-29T12:20:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/monolog-bridge",
|
||||
"version": "v7.0.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/monolog-bridge.git",
|
||||
"reference": "d80b7aeabc539538c6ae8962259ac422632d7796"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/d80b7aeabc539538c6ae8962259ac422632d7796",
|
||||
"reference": "d80b7aeabc539538c6ae8962259ac422632d7796",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"monolog/monolog": "^3",
|
||||
"php": ">=8.2",
|
||||
"symfony/http-kernel": "^6.4|^7.0",
|
||||
"symfony/service-contracts": "^2.5|^3"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/console": "<6.4",
|
||||
"symfony/http-foundation": "<6.4",
|
||||
"symfony/security-core": "<6.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/console": "^6.4|^7.0",
|
||||
"symfony/http-client": "^6.4|^7.0",
|
||||
"symfony/mailer": "^6.4|^7.0",
|
||||
"symfony/messenger": "^6.4|^7.0",
|
||||
"symfony/mime": "^6.4|^7.0",
|
||||
"symfony/security-core": "^6.4|^7.0",
|
||||
"symfony/var-dumper": "^6.4|^7.0"
|
||||
},
|
||||
"type": "symfony-bridge",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Bridge\\Monolog\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Provides integration for Monolog with various Symfony components",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/monolog-bridge/tree/v7.0.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-05-31T14:55:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/monolog-bundle",
|
||||
"version": "v3.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/monolog-bundle.git",
|
||||
"reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181",
|
||||
"reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"monolog/monolog": "^1.25.1 || ^2.0 || ^3.0",
|
||||
"php": ">=7.2.5",
|
||||
"symfony/config": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/console": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/phpunit-bridge": "^6.3 || ^7.0",
|
||||
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
|
||||
},
|
||||
"type": "symfony-bundle",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Bundle\\MonologBundle\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony MonologBundle",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"log",
|
||||
"logging"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/symfony/monolog-bundle/issues",
|
||||
"source": "https://github.com/symfony/monolog-bundle/tree/v3.10.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-11-06T17:08:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/notifier",
|
||||
"version": "v7.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/notifier.git",
|
||||
"reference": "1fcd4abbb5a9af4c0cd6ad02f716a708d30864c5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/notifier/zipball/1fcd4abbb5a9af4c0cd6ad02f716a708d30864c5",
|
||||
"reference": "1fcd4abbb5a9af4c0cd6ad02f716a708d30864c5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"psr/log": "^1|^2|^3"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/event-dispatcher": "<6.4",
|
||||
"symfony/event-dispatcher-contracts": "<2.5",
|
||||
"symfony/http-client-contracts": "<2.5",
|
||||
"symfony/http-kernel": "<6.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/event-dispatcher-contracts": "^2.5|^3",
|
||||
"symfony/http-client-contracts": "^2.5|^3",
|
||||
"symfony/http-foundation": "^6.4|^7.0",
|
||||
"symfony/messenger": "^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Notifier\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Sends notifications via one or more channels (email, SMS, ...)",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"notification",
|
||||
"notifier"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/notifier/tree/v7.0.9"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-06-28T07:59:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/password-hasher",
|
||||
"version": "v7.0.7",
|
||||
@@ -4658,6 +4997,87 @@
|
||||
}
|
||||
],
|
||||
"time": "2024-05-31T14:55:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/web-profiler-bundle",
|
||||
"version": "v7.0.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/web-profiler-bundle.git",
|
||||
"reference": "884ed0470bd703ec40a78dfec94fe971ca55cad6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/884ed0470bd703ec40a78dfec94fe971ca55cad6",
|
||||
"reference": "884ed0470bd703ec40a78dfec94fe971ca55cad6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"symfony/config": "^6.4|^7.0",
|
||||
"symfony/framework-bundle": "^6.4|^7.0",
|
||||
"symfony/http-kernel": "^6.4|^7.0",
|
||||
"symfony/routing": "^6.4|^7.0",
|
||||
"symfony/twig-bundle": "^6.4|^7.0",
|
||||
"twig/twig": "^3.0.4"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/form": "<6.4",
|
||||
"symfony/mailer": "<6.4",
|
||||
"symfony/messenger": "<6.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/browser-kit": "^6.4|^7.0",
|
||||
"symfony/console": "^6.4|^7.0",
|
||||
"symfony/css-selector": "^6.4|^7.0",
|
||||
"symfony/stopwatch": "^6.4|^7.0"
|
||||
},
|
||||
"type": "symfony-bundle",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Bundle\\WebProfilerBundle\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Provides a development tool that gives detailed information about the execution of any request",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"dev"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/web-profiler-bundle/tree/v7.0.10"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-26T12:31:22+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
||||
@@ -11,4 +11,6 @@ return [
|
||||
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Nelmio\SecurityBundle\NelmioSecurityBundle::class => ['all' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
];
|
||||
|
||||
@@ -32,4 +32,4 @@ flasher:
|
||||
# Criteria to filter displayed notifications (limit, types)
|
||||
filter:
|
||||
# Limit number of displayed notifications
|
||||
limit: 5
|
||||
# limit: 5
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
monolog:
|
||||
channels:
|
||||
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists
|
||||
|
||||
when@dev:
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: debug
|
||||
channels: ["!event"]
|
||||
# uncomment to get logging in your browser
|
||||
# you may have to allow bigger header sizes in your Web server configuration
|
||||
#firephp:
|
||||
# type: firephp
|
||||
# level: info
|
||||
#chromephp:
|
||||
# type: chromephp
|
||||
# level: info
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
||||
channels: ["!event", "!doctrine", "!console"]
|
||||
|
||||
when@test:
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: fingers_crossed
|
||||
action_level: error
|
||||
handler: nested
|
||||
excluded_http_codes: [404, 405]
|
||||
channels: ["!event"]
|
||||
nested:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: debug
|
||||
|
||||
when@prod:
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: fingers_crossed
|
||||
action_level: error
|
||||
handler: nested
|
||||
excluded_http_codes: [404, 405]
|
||||
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
|
||||
nested:
|
||||
type: stream
|
||||
path: php://stderr
|
||||
level: debug
|
||||
formatter: monolog.formatter.json
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
||||
channels: ["!event", "!doctrine"]
|
||||
deprecation:
|
||||
type: stream
|
||||
channels: [deprecation]
|
||||
path: php://stderr
|
||||
formatter: monolog.formatter.json
|
||||
@@ -0,0 +1,12 @@
|
||||
framework:
|
||||
notifier:
|
||||
chatter_transports:
|
||||
texter_transports:
|
||||
channel_policy:
|
||||
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
|
||||
urgent: ['email']
|
||||
high: ['email']
|
||||
medium: ['email']
|
||||
low: ['email']
|
||||
admin_recipients:
|
||||
- { email: admin@example.com }
|
||||
@@ -0,0 +1,17 @@
|
||||
when@dev:
|
||||
web_profiler:
|
||||
toolbar: true
|
||||
intercept_redirects: false
|
||||
|
||||
framework:
|
||||
profiler:
|
||||
only_exceptions: false
|
||||
collect_serializer_data: true
|
||||
|
||||
when@test:
|
||||
web_profiler:
|
||||
toolbar: false
|
||||
intercept_redirects: false
|
||||
|
||||
framework:
|
||||
profiler: { collect: false }
|
||||
@@ -0,0 +1,8 @@
|
||||
when@dev:
|
||||
web_profiler_wdt:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
|
||||
prefix: /_wdt
|
||||
|
||||
web_profiler_profiler:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
|
||||
prefix: /_profiler
|
||||
@@ -21,11 +21,9 @@ class HomeController extends AbstractController
|
||||
flash()->created(new Book('lord of the rings'));
|
||||
flash()->saved(new Book('harry potter'));
|
||||
|
||||
// flash()->updated();
|
||||
// flash()->deleted();
|
||||
flash()->updated();
|
||||
flash()->deleted();
|
||||
|
||||
return $this->render('home/index.html.twig', [
|
||||
'controller_name' => 'HomeController',
|
||||
]);
|
||||
return $this->render('home/index.html.twig');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,30 @@
|
||||
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
|
||||
}
|
||||
},
|
||||
"symfony/monolog-bundle": {
|
||||
"version": "3.10",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "3.7",
|
||||
"ref": "aff23899c4440dd995907613c1dd709b6f59503f"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/monolog.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/notifier": {
|
||||
"version": "7.0",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "5.0",
|
||||
"ref": "178877daf79d2dbd62129dd03612cb1a2cb407cc"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/notifier.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/routing": {
|
||||
"version": "7.0",
|
||||
"recipe": {
|
||||
@@ -114,6 +138,19 @@
|
||||
"templates/base.html.twig"
|
||||
]
|
||||
},
|
||||
"symfony/web-profiler-bundle": {
|
||||
"version": "7.0",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "6.1",
|
||||
"ref": "e42b3f0177df239add25373083a564e5ead4e13a"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/web_profiler.yaml",
|
||||
"config/routes/web_profiler.yaml"
|
||||
]
|
||||
},
|
||||
"twig/extra-bundle": {
|
||||
"version": "v3.8.0"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"dist/main.css": "/dist/main.816d3c07.css",
|
||||
"dist/main.js": "/dist/main.a8422ec5.js",
|
||||
"dist/main.css": "/dist/main.c51cfb93.css",
|
||||
"dist/main.js": "/dist/main.911a168a.js",
|
||||
"dist/455.3a7b4474.css": "/dist/455.3a7b4474.css",
|
||||
"dist/455.095e6545.js": "/dist/455.095e6545.js",
|
||||
"dist/411.29cd993e.css": "/dist/411.29cd993e.css",
|
||||
|
||||
Vendored
+2
-2
@@ -2,10 +2,10 @@
|
||||
"entrypoints": {
|
||||
"main": {
|
||||
"css": [
|
||||
"/dist/main.816d3c07.css"
|
||||
"/dist/main.c51cfb93.css"
|
||||
],
|
||||
"js": [
|
||||
"/dist/main.a8422ec5.js"
|
||||
"/dist/main.911a168a.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Generated
+406
-2346
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@flasher/docs",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "cross-env NODE_ENV=production encore production --progress",
|
||||
@@ -17,7 +17,7 @@
|
||||
"@flasher/flasher-toastr": "file:../src/Toastr/Prime/Resources",
|
||||
"@hotwired/stimulus": "^3.2.2",
|
||||
"@symfony/stimulus-bridge": "^3.2.2",
|
||||
"@symfony/webpack-encore": "^4.7.0",
|
||||
"@symfony/webpack-encore": "^5.0.1",
|
||||
"noty": "^3.2.0-beta-deprecated",
|
||||
"notyf": "^3.10.0",
|
||||
"prismjs": "^1.29.0",
|
||||
@@ -30,7 +30,7 @@
|
||||
"node-ray": "^2.1.2",
|
||||
"postcss-import": "^16.1.0",
|
||||
"postcss-loader": "^7.3.4",
|
||||
"tailwindcss": "^3.4.12",
|
||||
"tailwindcss": "^3.4.13",
|
||||
"webpack-notifier": "^1.15.0"
|
||||
},
|
||||
"browserslist": [
|
||||
|
||||
@@ -8,4 +8,6 @@ return static function (MBConfig $config) {
|
||||
$config->packageDirectories([
|
||||
__DIR__.'/src',
|
||||
]);
|
||||
|
||||
$config->packageAliasFormat('2.x-dev');
|
||||
};
|
||||
|
||||
Generated
+3225
-3110
File diff suppressed because it is too large
Load Diff
+15
-15
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@flasher/php-flasher",
|
||||
"type": "module",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
"src/Prime/Resources",
|
||||
@@ -18,40 +18,40 @@
|
||||
"ncu": "ncu -u && npm run ncu --workspaces"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "2.12.2",
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/preset-env": "^7.25.4",
|
||||
"@antfu/eslint-config": "^2.27.3",
|
||||
"@babel/core": "^7.25.7",
|
||||
"@babel/preset-env": "^7.25.7",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-commonjs": "^25.0.8",
|
||||
"@rollup/plugin-eslint": "^9.0.5",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@rollup/plugin-node-resolve": "^15.3.0",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"@rollup/plugin-typescript": "^11.1.6",
|
||||
"@types/node": "^20.16.5",
|
||||
"@typescript-eslint/eslint-plugin": "7.5.0",
|
||||
"@types/node": "^20.16.10",
|
||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
"all-contributors-cli": "^6.26.1",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"browserslist": "^4.23.3",
|
||||
"cross-env": "7.0.3",
|
||||
"browserslist": "^4.24.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"cssnano": "^6.1.2",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-airbnb-typescript": "^18.0.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.3",
|
||||
"eslint-plugin-babel": "5.3.1",
|
||||
"eslint-plugin-import": "^2.30.0",
|
||||
"eslint-plugin-babel": "^5.3.1",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"postcss-discard-comments": "^6.0.2",
|
||||
"punycode": "2.3.1",
|
||||
"rollup": "^4.22.4",
|
||||
"punycode": "^2.3.1",
|
||||
"rollup": "^4.24.0",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-clear": "^2.0.7",
|
||||
"rollup-plugin-copy": "3.5.0",
|
||||
"rollup-plugin-copy": "^3.5.0",
|
||||
"rollup-plugin-filesize": "^10.0.0",
|
||||
"rollup-plugin-postcss": "^4.0.2",
|
||||
"rollup-plugin-progress": "^1.1.2",
|
||||
"sass": "^1.79.3",
|
||||
"sass": "^1.79.4",
|
||||
"ts-node": "^10.9.2",
|
||||
"tslib": "^2.7.0",
|
||||
"typescript": "^5.6.2"
|
||||
|
||||
@@ -14,6 +14,11 @@ final readonly class Request implements RequestInterface
|
||||
{
|
||||
}
|
||||
|
||||
public function getUri(): string
|
||||
{
|
||||
return $this->request->getUri();
|
||||
}
|
||||
|
||||
public function isXmlHttpRequest(): bool
|
||||
{
|
||||
return $this->request->ajax();
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"illuminate/support": "^11.0",
|
||||
"php-flasher/flasher": "^2.0.1"
|
||||
"php-flasher/flasher": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher-laravel": "^2.0.1",
|
||||
"php-flasher/flasher-noty": "^2.0.1"
|
||||
"php-flasher/flasher-laravel": "^2.1.0",
|
||||
"php-flasher/flasher-noty": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@flasher/flasher-noty",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"main": "dist/flasher-noty.cjs.js",
|
||||
@@ -11,7 +11,7 @@
|
||||
"ncu": "ncu -u"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@flasher/flasher": "^2.0.0",
|
||||
"@flasher/flasher": "^2.1.0",
|
||||
"noty": "^3.2.0-beta-deprecated"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher": "^2.0.1"
|
||||
"php-flasher/flasher": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher-noty": "^2.0.1",
|
||||
"php-flasher/flasher-symfony": "^2.0.1"
|
||||
"php-flasher/flasher-noty": "^2.1.0",
|
||||
"php-flasher/flasher-symfony": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher-laravel": "^2.0.1",
|
||||
"php-flasher/flasher-notyf": "^2.0.1"
|
||||
"php-flasher/flasher-laravel": "^2.1.0",
|
||||
"php-flasher/flasher-notyf": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@flasher/flasher-notyf",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"main": "dist/flasher-notyf.cjs.js",
|
||||
@@ -11,7 +11,7 @@
|
||||
"ncu": "ncu -u"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@flasher/flasher": "^2.0.0",
|
||||
"@flasher/flasher": "^2.1.0",
|
||||
"notyf": "^3.10.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher": "^2.0.1"
|
||||
"php-flasher/flasher": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher-notyf": "^2.0.1",
|
||||
"php-flasher/flasher-symfony": "^2.0.1"
|
||||
"php-flasher/flasher-notyf": "^2.1.0",
|
||||
"php-flasher/flasher-symfony": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -4,30 +4,33 @@ declare(strict_types=1);
|
||||
|
||||
namespace Flasher\Prime\EventDispatcher\Event;
|
||||
|
||||
use Flasher\Prime\Notification\NotificationInterface;
|
||||
use Flasher\Prime\Notification\Envelope;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class NotificationEvents
|
||||
{
|
||||
/** @var NotificationInterface[] */
|
||||
private array $notifications = [];
|
||||
/** @var Envelope[] */
|
||||
private array $envelopes = [];
|
||||
|
||||
public function add(NotificationInterface ...$notifications): void
|
||||
public function add(Envelope ...$notifications): void
|
||||
{
|
||||
foreach ($notifications as $notification) {
|
||||
$this->addNotification($notification);
|
||||
$this->addEnvelope($notification);
|
||||
}
|
||||
}
|
||||
|
||||
public function addNotification(NotificationInterface $notification): void
|
||||
public function addEnvelope(Envelope $notification): void
|
||||
{
|
||||
$this->notifications[] = $notification;
|
||||
$this->envelopes[] = $notification;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NotificationInterface[]
|
||||
* @return Envelope[]
|
||||
*/
|
||||
public function getNotifications(): array
|
||||
public function getEnvelopes(): array
|
||||
{
|
||||
return $this->notifications;
|
||||
return $this->envelopes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,34 +5,69 @@ declare(strict_types=1);
|
||||
namespace Flasher\Prime\EventDispatcher\EventListener;
|
||||
|
||||
use Flasher\Prime\EventDispatcher\Event\NotificationEvents;
|
||||
use Flasher\Prime\EventDispatcher\Event\PersistEvent;
|
||||
use Flasher\Prime\EventDispatcher\Event\PresentationEvent;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class NotificationLoggerListener implements EventListenerInterface
|
||||
{
|
||||
private NotificationEvents $events;
|
||||
private NotificationEvents $dispatchedEnvelopes;
|
||||
|
||||
private NotificationEvents $displayedEnvelopes;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->events = new NotificationEvents();
|
||||
$this->dispatchedEnvelopes = new NotificationEvents();
|
||||
$this->displayedEnvelopes = new NotificationEvents();
|
||||
}
|
||||
|
||||
public function reset(): void
|
||||
{
|
||||
$this->events = new NotificationEvents();
|
||||
$this->dispatchedEnvelopes = new NotificationEvents();
|
||||
$this->displayedEnvelopes = new NotificationEvents();
|
||||
}
|
||||
|
||||
public function __invoke(PresentationEvent $event): void
|
||||
public function __invoke(object $event): void
|
||||
{
|
||||
$this->events->add(...$event->getEnvelopes());
|
||||
if ($event instanceof PersistEvent) {
|
||||
$this->onPersist($event);
|
||||
}
|
||||
|
||||
public function getEvents(): NotificationEvents
|
||||
{
|
||||
return $this->events;
|
||||
if ($event instanceof PresentationEvent) {
|
||||
$this->onPresentation($event);
|
||||
}
|
||||
}
|
||||
|
||||
public function getSubscribedEvents(): string
|
||||
public function onPersist(PersistEvent $event): void
|
||||
{
|
||||
return PresentationEvent::class;
|
||||
$this->dispatchedEnvelopes->add(...$event->getEnvelopes());
|
||||
}
|
||||
|
||||
public function onPresentation(PresentationEvent $event): void
|
||||
{
|
||||
$this->displayedEnvelopes->add(...$event->getEnvelopes());
|
||||
}
|
||||
|
||||
public function getDispatchedEnvelopes(): NotificationEvents
|
||||
{
|
||||
return $this->dispatchedEnvelopes;
|
||||
}
|
||||
|
||||
public function getDisplayedEnvelopes(): NotificationEvents
|
||||
{
|
||||
return $this->displayedEnvelopes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
PersistEvent::class,
|
||||
PresentationEvent::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ final readonly class Flasher implements FlasherInterface
|
||||
{
|
||||
use ForwardsCalls;
|
||||
|
||||
public const VERSION = '2.0.0';
|
||||
public const VERSION = '2.1.0';
|
||||
|
||||
public function __construct(
|
||||
private string $default,
|
||||
|
||||
@@ -4,8 +4,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace Flasher\Prime\Http;
|
||||
|
||||
/**
|
||||
* @method string getUri()
|
||||
*/
|
||||
interface RequestInterface
|
||||
{
|
||||
// public function getUri(): string;
|
||||
|
||||
public function isXmlHttpRequest(): bool;
|
||||
|
||||
public function isHtmlRequestFormat(): bool;
|
||||
|
||||
@@ -10,8 +10,14 @@ use Flasher\Prime\Response\Presenter\HtmlPresenter;
|
||||
|
||||
final readonly class ResponseExtension implements ResponseExtensionInterface
|
||||
{
|
||||
public function __construct(private FlasherInterface $flasher, private ContentSecurityPolicyHandlerInterface $cspHandler)
|
||||
{
|
||||
/**
|
||||
* @param list<non-empty-string> $excludedPaths
|
||||
*/
|
||||
public function __construct(
|
||||
private FlasherInterface $flasher,
|
||||
private ContentSecurityPolicyHandlerInterface $cspHandler,
|
||||
private array $excludedPaths = [],
|
||||
) {
|
||||
}
|
||||
|
||||
public function render(RequestInterface $request, ResponseInterface $response): ResponseInterface
|
||||
@@ -69,7 +75,8 @@ final readonly class ResponseExtension implements ResponseExtensionInterface
|
||||
|
||||
private function isRenderable(RequestInterface $request, ResponseInterface $response): bool
|
||||
{
|
||||
return !$request->isXmlHttpRequest()
|
||||
return !$this->isPathExcluded($request)
|
||||
&& !$request->isXmlHttpRequest()
|
||||
&& $request->isHtmlRequestFormat()
|
||||
&& $response->isHtml()
|
||||
&& $response->isSuccessful()
|
||||
@@ -77,4 +84,21 @@ final readonly class ResponseExtension implements ResponseExtensionInterface
|
||||
&& !$response->isAttachment()
|
||||
&& !$response->isJson();
|
||||
}
|
||||
|
||||
private function isPathExcluded(RequestInterface $request): bool
|
||||
{
|
||||
if (!method_exists($request, 'getUri')) { // @phpstan-ignore-line
|
||||
return false;
|
||||
}
|
||||
|
||||
$url = $request->getUri();
|
||||
|
||||
foreach ($this->excludedPaths as $regexPattern) {
|
||||
if (preg_match($regexPattern, $url)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ use Flasher\Prime\Notification\Type;
|
||||
* main_script: string,
|
||||
* translate: bool,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths: list<non-empty-string>,
|
||||
* scripts: string[],
|
||||
* styles: string[],
|
||||
* options: array<string, mixed>,
|
||||
@@ -188,6 +189,7 @@ final class FlasherPlugin extends Plugin
|
||||
* main_script?: string|null,
|
||||
* translate?: bool,
|
||||
* inject_assets?: bool,
|
||||
* excluded_paths?: list<non-empty-string>,
|
||||
* filter?: array<string, mixed>,
|
||||
* scripts: string[],
|
||||
* styles: string[],
|
||||
@@ -201,6 +203,7 @@ final class FlasherPlugin extends Plugin
|
||||
* main_script: string|null,
|
||||
* translate: bool,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths?: list<non-empty-string>,
|
||||
* filter: array<string, mixed>,
|
||||
* scripts: string[],
|
||||
* styles: string[],
|
||||
@@ -234,6 +237,7 @@ final class FlasherPlugin extends Plugin
|
||||
* main_script: string|null,
|
||||
* translate: bool,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths?: list<non-empty-string>,
|
||||
* filter: array<string, mixed>,
|
||||
* scripts: string[],
|
||||
* styles: string[],
|
||||
@@ -248,6 +252,7 @@ final class FlasherPlugin extends Plugin
|
||||
* main_script: string|null,
|
||||
* translate: bool,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths?: list<non-empty-string>,
|
||||
* filter: array<string, mixed>,
|
||||
* scripts: string[],
|
||||
* styles: string[],
|
||||
@@ -285,6 +290,7 @@ final class FlasherPlugin extends Plugin
|
||||
* main_script: string|null,
|
||||
* translate: bool,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths?: list<non-empty-string>,
|
||||
* filter: array<string, mixed>,
|
||||
* scripts: string[],
|
||||
* styles: string[],
|
||||
@@ -299,6 +305,7 @@ final class FlasherPlugin extends Plugin
|
||||
* main_script: string|null,
|
||||
* translate: bool,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths?: list<non-empty-string>,
|
||||
* filter: array<string, mixed>,
|
||||
* scripts: string[],
|
||||
* styles: string[],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@flasher/flasher",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"main": "dist/flasher.cjs.js",
|
||||
|
||||
@@ -59,7 +59,7 @@ final class Notification extends Constraint
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($other->getNotifications() as $notification) {
|
||||
foreach ($other->getEnvelopes() as $notification) {
|
||||
if ($this->isNotificationMatching($notification)) {
|
||||
return true;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ final class Notification extends Constraint
|
||||
$notification->getMessage(),
|
||||
json_encode($notification->getOptions()),
|
||||
);
|
||||
}, $other->getNotifications());
|
||||
}, $other->getEnvelopes());
|
||||
|
||||
if (empty($foundNotifications)) {
|
||||
$foundNotifications[] = 'No notifications found';
|
||||
|
||||
@@ -57,6 +57,6 @@ final class NotificationCount extends Constraint
|
||||
*/
|
||||
private function countNotifications(NotificationEvents $events): int
|
||||
{
|
||||
return \count($events->getNotifications());
|
||||
return \count($events->getEnvelopes());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ final class NotificationMessage extends Constraint
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($other->getNotifications() as $notification) {
|
||||
foreach ($other->getEnvelopes() as $notification) {
|
||||
if (str_contains($notification->getMessage(), $this->expectedMessage)) {
|
||||
return true;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ final class NotificationMessage extends Constraint
|
||||
|
||||
$foundMessages = array_map(function (NotificationInterface $notification) {
|
||||
return \sprintf('"%s"', $notification->getMessage());
|
||||
}, $other->getNotifications());
|
||||
}, $other->getEnvelopes());
|
||||
|
||||
if (empty($foundMessages)) {
|
||||
return \sprintf(
|
||||
|
||||
@@ -38,7 +38,7 @@ final class NotificationOption extends Constraint
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($other->getNotifications() as $notification) {
|
||||
foreach ($other->getEnvelopes() as $notification) {
|
||||
if ($this->isOptionMatching($notification)) {
|
||||
return true;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ final class NotificationOption extends Constraint
|
||||
{
|
||||
$actualOptions = [];
|
||||
if ($other instanceof NotificationEvents) {
|
||||
foreach ($other->getNotifications() as $notification) {
|
||||
foreach ($other->getEnvelopes() as $notification) {
|
||||
$actualOptions[] = json_encode($notification->getOptions());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ final class NotificationOptions extends Constraint
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($other->getNotifications() as $notification) {
|
||||
foreach ($other->getEnvelopes() as $notification) {
|
||||
if (!array_diff_assoc($this->expectedOptions, $notification->getOptions())) {
|
||||
return true;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ final class NotificationOptions extends Constraint
|
||||
{
|
||||
$actualOptions = [];
|
||||
if ($other instanceof NotificationEvents) {
|
||||
foreach ($other->getNotifications() as $notification) {
|
||||
foreach ($other->getEnvelopes() as $notification) {
|
||||
$actualOptions[] = json_encode($notification->getOptions());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ final class NotificationTitle extends Constraint
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($other->getNotifications() as $notification) {
|
||||
foreach ($other->getEnvelopes() as $notification) {
|
||||
if (str_contains($notification->getTitle(), $this->expectedTitle)) {
|
||||
return true;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ final class NotificationTitle extends Constraint
|
||||
|
||||
$foundTitles = array_map(function (NotificationInterface $notification) {
|
||||
return \sprintf('"%s"', $notification->getTitle());
|
||||
}, $other->getNotifications());
|
||||
}, $other->getEnvelopes());
|
||||
|
||||
if (empty($foundTitles)) {
|
||||
return \sprintf(
|
||||
|
||||
@@ -40,7 +40,7 @@ final class NotificationType extends Constraint
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($other->getNotifications() as $notification) {
|
||||
foreach ($other->getEnvelopes() as $notification) {
|
||||
if ($notification->getType() === $this->expectedType) {
|
||||
return true;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ final class NotificationType extends Constraint
|
||||
{
|
||||
$actualTypes = array_map(function (NotificationInterface $notification) {
|
||||
return $notification->getType();
|
||||
}, $other->getNotifications());
|
||||
}, $other->getEnvelopes());
|
||||
|
||||
$uniqueTypes = array_unique($actualTypes);
|
||||
$typesList = implode(', ', $uniqueTypes);
|
||||
|
||||
@@ -53,7 +53,7 @@ final class FlasherAssert
|
||||
*/
|
||||
public static function hasNotifications(string $message = 'Expected at least one notification to exist.'): self
|
||||
{
|
||||
return self::fluent(static fn () => Assert::assertNotEmpty(self::getNotificationEvents()->getNotifications(), $message));
|
||||
return self::fluent(static fn () => Assert::assertNotEmpty(self::getNotificationEvents()->getEnvelopes(), $message));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ final class FlasherAssert
|
||||
*/
|
||||
public static function noNotifications(string $message = 'Expected no notifications to exist.'): self
|
||||
{
|
||||
return self::fluent(static fn () => Assert::assertEmpty(self::getNotificationEvents()->getNotifications(), $message));
|
||||
return self::fluent(static fn () => Assert::assertEmpty(self::getNotificationEvents()->getEnvelopes(), $message));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -411,6 +411,6 @@ final class FlasherAssert
|
||||
/** @var NotificationLoggerListener $listener */
|
||||
$listener = $container->get('flasher.notification_logger_listener');
|
||||
|
||||
return $listener->getEvents();
|
||||
return $listener->getDisplayedEnvelopes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher-laravel": "^2.0.1",
|
||||
"php-flasher/flasher-sweetalert": "^2.0.1"
|
||||
"php-flasher/flasher-laravel": "^2.1.0",
|
||||
"php-flasher/flasher-sweetalert": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@flasher/flasher-sweetalert",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"main": "dist/flasher-sweetalert.cjs.js",
|
||||
@@ -11,7 +11,7 @@
|
||||
"ncu": "ncu -u"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@flasher/flasher": "^2.0.0",
|
||||
"@flasher/flasher": "^2.1.0",
|
||||
"sweetalert2": "^11.6.13"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -33,7 +33,7 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher": "^2.0.1"
|
||||
"php-flasher/flasher": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher-sweetalert": "^2.0.1",
|
||||
"php-flasher/flasher-symfony": "^2.0.1"
|
||||
"php-flasher/flasher-sweetalert": "^2.1.0",
|
||||
"php-flasher/flasher-symfony": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -56,6 +56,13 @@ final readonly class Configuration implements ConfigurationInterface
|
||||
->booleanNode('inject_assets')
|
||||
->defaultTrue()
|
||||
->end()
|
||||
->arrayNode('excluded_paths')
|
||||
->defaultValue([
|
||||
'/^\/_profiler/',
|
||||
'/^\/_fragment/',
|
||||
])
|
||||
->scalarPrototype()->end()
|
||||
->end()
|
||||
->arrayNode('filter')
|
||||
->variablePrototype()->end()
|
||||
->end()
|
||||
|
||||
@@ -40,6 +40,7 @@ final class FlasherExtension extends AbstractExtension implements CompilerPassIn
|
||||
* default: string,
|
||||
* main_script: string,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths: list<non-empty-string>,
|
||||
* presets: array<string, mixed>,
|
||||
* flash_bag: array<string, mixed>,
|
||||
* filter: array<string, mixed>,
|
||||
@@ -66,6 +67,7 @@ final class FlasherExtension extends AbstractExtension implements CompilerPassIn
|
||||
* default: string,
|
||||
* main_script: string,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths: list<non-empty-string>,
|
||||
* presets: array<string, mixed>,
|
||||
* flash_bag: array<string, mixed>,
|
||||
* filter: array<string, mixed>,
|
||||
@@ -88,6 +90,7 @@ final class FlasherExtension extends AbstractExtension implements CompilerPassIn
|
||||
->set('flasher.default', $config['default'])
|
||||
->set('flasher.main_script', $config['main_script'])
|
||||
->set('flasher.inject_assets', $config['inject_assets'])
|
||||
->set('flasher.excluded_paths', $config['excluded_paths'])
|
||||
->set('flasher.flash_bag', $config['flash_bag'])
|
||||
->set('flasher.filter', $config['filter'])
|
||||
->set('flasher.presets', $config['presets'])
|
||||
|
||||
@@ -27,7 +27,7 @@ final readonly class FlasherListener implements EventSubscriberInterface
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
ResponseEvent::class => ['onKernelResponse', -256],
|
||||
ResponseEvent::class => ['onKernelResponse', -20],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,11 @@ final readonly class Request implements RequestInterface
|
||||
{
|
||||
}
|
||||
|
||||
public function getUri(): string
|
||||
{
|
||||
return $this->request->getRequestUri();
|
||||
}
|
||||
|
||||
public function isXmlHttpRequest(): bool
|
||||
{
|
||||
return $this->request->isXmlHttpRequest();
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Flasher\Symfony\Profiler;
|
||||
|
||||
use Flasher\Prime\EventDispatcher\EventListener\NotificationLoggerListener;
|
||||
use Flasher\Prime\Flasher;
|
||||
use Flasher\Prime\Notification\Envelope;
|
||||
use Symfony\Bundle\FrameworkBundle\DataCollector\AbstractDataCollector;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
|
||||
/**
|
||||
* @phpstan-type NotificationShape array{
|
||||
* title: string,
|
||||
* message: string,
|
||||
* type: string,
|
||||
* options: array<string, mixed>,
|
||||
* metadata: array<string, mixed>,
|
||||
* }
|
||||
* @phpstan-type ConfigShare array{
|
||||
* default: string,
|
||||
* main_script: string,
|
||||
* inject_assets: bool,
|
||||
* excluded_paths: list<non-empty-string>,
|
||||
* presets: array<string, mixed>,
|
||||
* flash_bag: array<string, mixed>,
|
||||
* filter: array{limit?: int|null},
|
||||
* plugins: array<array<string, mixed>>,
|
||||
* }
|
||||
* @phpstan-type DataShape array{
|
||||
* displayed_envelopes: NotificationShape[],
|
||||
* dispatched_envelopes: NotificationShape[],
|
||||
* config: array<string, mixed>,
|
||||
* versions: array{
|
||||
* php_flasher: string,
|
||||
* php: string,
|
||||
* symfony: string
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @property DataShape|Data<DataShape> $data
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
#[\AllowDynamicProperties]
|
||||
final class FlasherDataCollector extends AbstractDataCollector implements LateDataCollectorInterface
|
||||
{
|
||||
/**
|
||||
* @phpstan-param ConfigShare $config
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly NotificationLoggerListener $logger,
|
||||
private readonly array $config,
|
||||
) {
|
||||
}
|
||||
|
||||
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
|
||||
{
|
||||
// No action needed here since we're collecting data in lateCollect
|
||||
}
|
||||
|
||||
public function lateCollect(): void
|
||||
{
|
||||
$this->data = [
|
||||
'displayed_envelopes' => array_map(fn (Envelope $envelope) => $envelope->toArray(), $this->logger->getDisplayedEnvelopes()->getEnvelopes()),
|
||||
'dispatched_envelopes' => array_map(fn (Envelope $envelope) => $envelope->toArray(), $this->logger->getDispatchedEnvelopes()->getEnvelopes()),
|
||||
'config' => $this->config,
|
||||
'versions' => [
|
||||
'php_flasher' => Flasher::VERSION,
|
||||
'php' => \PHP_VERSION,
|
||||
'symfony' => Kernel::VERSION,
|
||||
],
|
||||
];
|
||||
|
||||
$this->data = $this->cloneVar($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DataShape|Data<DataShape>
|
||||
*/
|
||||
public function getData(): array|Data
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return 'flasher';
|
||||
}
|
||||
|
||||
public function reset(): void
|
||||
{
|
||||
$this->logger->reset();
|
||||
parent::reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NotificationShape[]|Data<NotificationShape>
|
||||
*/
|
||||
public function getDisplayedEnvelopes(): array|Data
|
||||
{
|
||||
return $this->data['displayed_envelopes'] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NotificationShape[]|Data<NotificationShape>
|
||||
*/
|
||||
public function getDispatchedEnvelopes(): array|Data
|
||||
{
|
||||
return $this->data['dispatched_envelopes'] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-return ConfigShare|Data
|
||||
*/
|
||||
public function getConfig(): array|Data
|
||||
{
|
||||
return $this->data['config'] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{php_flasher: string, php: string, symfony: string}|Data
|
||||
*/
|
||||
public function getVersions(): array|Data
|
||||
{
|
||||
return $this->data['versions'] ?? [];
|
||||
}
|
||||
|
||||
public static function getTemplate(): string
|
||||
{
|
||||
return '@FlasherSymfony/profiler/flasher.html.twig';
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ use Flasher\Symfony\Component\FlasherComponent;
|
||||
use Flasher\Symfony\EventListener\FlasherListener;
|
||||
use Flasher\Symfony\EventListener\SessionListener;
|
||||
use Flasher\Symfony\Factory\NotificationFactoryLocator;
|
||||
use Flasher\Symfony\Profiler\FlasherDataCollector;
|
||||
use Flasher\Symfony\Storage\SessionBag;
|
||||
use Flasher\Symfony\Template\TwigTemplateEngine;
|
||||
use Flasher\Symfony\Translation\Translator;
|
||||
@@ -54,6 +55,7 @@ return static function (ContainerConfigurator $container): void {
|
||||
->args([
|
||||
service('flasher'),
|
||||
service('flasher.csp_handler'),
|
||||
param('flasher.excluded_paths'),
|
||||
]),
|
||||
])
|
||||
->tag('kernel.event_subscriber')
|
||||
@@ -73,7 +75,7 @@ return static function (ContainerConfigurator $container): void {
|
||||
->tag('kernel.event_subscriber')
|
||||
|
||||
->set('flasher.notification_logger_listener', NotificationLoggerListener::class)
|
||||
->tag('flasher.event_dispatcher')
|
||||
->tag('flasher.event_listener')
|
||||
->tag('kernel.reset', ['method' => 'reset'])
|
||||
|
||||
->set('flasher.translation_listener', TranslationListener::class)
|
||||
@@ -91,7 +93,7 @@ return static function (ContainerConfigurator $container): void {
|
||||
->set('flasher.flasher_component', FlasherComponent::class)
|
||||
->tag('twig.component', [
|
||||
'key' => 'flasher',
|
||||
'template' => '@Flasher/components/flasher.html.twig',
|
||||
'template' => '@FlasherSymfony/components/flasher.html.twig',
|
||||
'attributesVar' => 'attributes',
|
||||
])
|
||||
|
||||
@@ -146,5 +148,12 @@ return static function (ContainerConfigurator $container): void {
|
||||
param('flasher.public_dir'),
|
||||
param('flasher.json_manifest_path'),
|
||||
])
|
||||
|
||||
->set('flasher.data_collector', FlasherDataCollector::class)
|
||||
->args([
|
||||
service('flasher.notification_logger_listener'),
|
||||
param('flasher'),
|
||||
])
|
||||
->tag('data_collector', ['id' => 'flasher', 'template' => '@FlasherSymfony/profiler/flasher.html.twig', 'priority' => 0])
|
||||
;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<table class="notifications-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Plugin</th>
|
||||
<th>Type</th>
|
||||
<th>Title</th>
|
||||
<th>Message</th>
|
||||
<th>Options</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for envelope in envelopes %}
|
||||
<tr>
|
||||
<td>{{ loop.index }}</td>
|
||||
<td>{{ envelope.metadata.plugin }}</td>
|
||||
<td class="notification-type-{{ envelope.type|lower }}">{{ envelope.type }}</td>
|
||||
<td>{{ envelope.title }}</td>
|
||||
<td>{{ envelope.message }}</td>
|
||||
<td>
|
||||
{% if envelope.options is not empty %}
|
||||
{{ profiler_dump(envelope.options) }}
|
||||
{% else %}
|
||||
<em>No Options</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,184 @@
|
||||
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
|
||||
|
||||
{% macro logo() %}
|
||||
<strong style="line-height: 1; display: inline-block; font-size: 0;">
|
||||
<span style="
|
||||
color: #FFFFFF;
|
||||
background-color: #312E81;
|
||||
padding: 2px 0 2px 4px;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
">PHP</span><span style="
|
||||
color: #FFFFFF;
|
||||
background-color: #6366F1;
|
||||
padding: 2px 4px 2px 0;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
">Flasher</span>
|
||||
</strong>
|
||||
{% endmacro %}
|
||||
|
||||
{% block toolbar %}
|
||||
{% import _self as macros %}
|
||||
|
||||
{% set displayedEnvelopes = collector.displayedEnvelopes %}
|
||||
{% set dispatchedEnvelopes = collector.dispatchedEnvelopes %}
|
||||
|
||||
{% set totalDispatched = dispatchedEnvelopes|length %}
|
||||
{% set totalDisplayed = displayedEnvelopes|length %}
|
||||
|
||||
{% if totalDisplayed > 0 %}
|
||||
{# Initialize type counts #}
|
||||
{% set typeCounts = {} %}
|
||||
{% for envelope in displayedEnvelopes %}
|
||||
{% set type = envelope.type|default('info')|lower %}
|
||||
{% set typeCounts = typeCounts | merge({ (type): (typeCounts[type]|default(0) + 1) }) %}
|
||||
{% endfor %}
|
||||
|
||||
{% set icon %}
|
||||
{{ macros.logo() }}
|
||||
|
||||
{{ source('@FlasherSymfony/profiler/flasher.svg') }}
|
||||
<span class="sf-toolbar-value">
|
||||
{% if totalDisplayed == totalDispatched %}
|
||||
{{ totalDisplayed }}
|
||||
{% else %}
|
||||
{{ totalDisplayed }}/{{ totalDispatched }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endset %}
|
||||
|
||||
{% set text %}
|
||||
<div class="sf-toolbar-info-piece">
|
||||
<b>Notifications Displayed</b>
|
||||
<span class="sf-toolbar-status">{{ totalDisplayed }}</span>
|
||||
</div>
|
||||
|
||||
{% if totalDispatched != totalDisplayed %}
|
||||
<div class="sf-toolbar-info-piece">
|
||||
<b>Notifications Dispatched:</b>
|
||||
<span class="sf-toolbar-status">{{ totalDispatched }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if totalDisplayed > totalDispatched %}
|
||||
<div class="sf-toolbar-info-piece">
|
||||
<span>Note: Some notifications are from previous requests.</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for type, count in typeCounts %}
|
||||
<div class="sf-toolbar-info-piece">
|
||||
<b>{{ type|capitalize }}</b>
|
||||
<span class="sf-toolbar-status">{{ count }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endset %}
|
||||
|
||||
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block menu %}
|
||||
{% import _self as macros %}
|
||||
|
||||
{% set totalDisplayed = collector.displayedEnvelopes|length %}
|
||||
{% set totalDispatched = collector.dispatchedEnvelopes|length %}
|
||||
|
||||
<span class="label{% if totalDisplayed == 0 %} disabled{% endif %}">
|
||||
<span class="icon">{{ source('@FlasherSymfony/profiler/flasher.svg') }}</span>
|
||||
{{ macros.logo() }}
|
||||
{% if totalDisplayed > 0 %}
|
||||
<span class="count">
|
||||
{% if totalDisplayed == totalDispatched %}
|
||||
<span>{{ totalDisplayed }}</span>
|
||||
{% else %}
|
||||
<span>{{ totalDisplayed }}/{{ totalDispatched }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
{% set displayedEnvelopes = collector.displayedEnvelopes %}
|
||||
{% set dispatchedEnvelopes = collector.dispatchedEnvelopes %}
|
||||
{% set totalNotifications = dispatchedEnvelopes|length %}
|
||||
{% set displayedNotifications = displayedEnvelopes|length %}
|
||||
{% set config = collector.config %}
|
||||
{% set versions = collector.versions %}
|
||||
|
||||
<h2>PHPFlasher Notifications</h2>
|
||||
|
||||
{% if totalNotifications == 0 %}
|
||||
<div class="empty">
|
||||
<p>No notifications have been dispatched.</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="sf-tabs">
|
||||
<div class="tab">
|
||||
<h3 class="tab-title">Notifications <span class="badge">{{ displayedNotifications }}/{{ totalNotifications }}</span></h3>
|
||||
<div class="tab-content">
|
||||
{% if displayedNotifications > totalNotifications %}
|
||||
<div class="sf-callout">
|
||||
<p>The number of displayed notifications is greater than the number of dispatched notifications. This may happen if notifications are stored in the session from previous requests.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h4>Displayed Notifications</h4>
|
||||
{{ include('@FlasherSymfony/profiler/_notifications_table.html.twig', { 'envelopes': displayedEnvelopes }) }}
|
||||
|
||||
{% if totalNotifications > displayedNotifications %}
|
||||
<h4>Remaining Notifications</h4>
|
||||
{% set remainingNotifications = dispatchedEnvelopes|slice(displayedNotifications) %}
|
||||
{{ include('@FlasherSymfony/profiler/_notifications_table.html.twig', { 'envelopes': remainingNotifications }) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab">
|
||||
<h3 class="tab-title">Debug</h3>
|
||||
<div class="tab-content">
|
||||
<h4>Version Information</h4>
|
||||
<ul>
|
||||
<li><strong>PHPFlasher Version:</strong> {{ versions.php_flasher }}</li>
|
||||
<li><strong>PHP Version:</strong> {{ versions.php }}</li>
|
||||
<li><strong>Symfony Version:</strong> {{ versions.symfony }}</li>
|
||||
</ul>
|
||||
|
||||
<h4>Configuration</h4>
|
||||
{{ profiler_dump(config, maxDepth=10) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
{{ parent() }}
|
||||
<style>
|
||||
.sf-tabs .tab-content {
|
||||
background-color: transparent;
|
||||
}
|
||||
.sf-tabs .tab-title {
|
||||
cursor: pointer;
|
||||
}
|
||||
.notification-type-success { color: #10b981; }
|
||||
.notification-type-error { color: #ef4444; }
|
||||
.notification-type-info { color: #3b82f6; }
|
||||
.notification-type-warning { color: #f59e0b; }
|
||||
table.notifications-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
table.notifications-table th, table.notifications-table td {
|
||||
padding: 8px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.metadata {
|
||||
font-size: 0.9em;
|
||||
color: #555;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-bell-ringing-2">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path
|
||||
d="M19.364 4.636a2 2 0 0 1 0 2.828a7 7 0 0 1 -1.414 7.072l-2.122 2.12a4 4 0 0 0 -.707 3.536l-11.313 -11.312a4 4 0 0 0 3.535 -.707l2.121 -2.123a7 7 0 0 1 7.072 -1.414a2 2 0 0 1 2.828 0z"/>
|
||||
<path d="M7.343 12.414l-.707 .707a3 3 0 0 0 4.243 4.243l.707 -.707"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 608 B |
@@ -28,7 +28,7 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher": "^2.0.1",
|
||||
"php-flasher/flasher": "^2.1.0",
|
||||
"symfony/config": "^7.0",
|
||||
"symfony/console": "^7.0",
|
||||
"symfony/dependency-injection": "^7.0",
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher-laravel": "^2.0.1",
|
||||
"php-flasher/flasher-toastr": "^2.0.1"
|
||||
"php-flasher/flasher-laravel": "^2.1.0",
|
||||
"php-flasher/flasher-toastr": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@flasher/flasher-toastr",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"main": "dist/flasher-toastr.cjs.js",
|
||||
@@ -11,8 +11,8 @@
|
||||
"ncu": "ncu -u"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"toastr": "^2.1.4",
|
||||
"@flasher/flasher": "^2.0.0"
|
||||
"@flasher/flasher": "^2.1.0",
|
||||
"toastr": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/toastr": "^2.1.43"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher": "^2.0.1"
|
||||
"php-flasher/flasher": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php-flasher/flasher-symfony": "^2.0.1",
|
||||
"php-flasher/flasher-toastr": "^2.0.1"
|
||||
"php-flasher/flasher-symfony": "^2.1.0",
|
||||
"php-flasher/flasher-toastr": "^2.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
+6
-3
@@ -8,8 +8,8 @@ tasks:
|
||||
- npm run ncu
|
||||
- npm install --force
|
||||
- npm run build
|
||||
- task: lint
|
||||
- task: docs:build
|
||||
# - task: lint
|
||||
# - task: docs:build
|
||||
aliases:
|
||||
- u
|
||||
- up
|
||||
@@ -36,10 +36,13 @@ tasks:
|
||||
- npm install --force
|
||||
- npm run build
|
||||
|
||||
security:
|
||||
audit:
|
||||
desc: "🔐 Check for security vulnerabilities in dependencies."
|
||||
cmds:
|
||||
- symfony security:check
|
||||
- composer audit
|
||||
aliases:
|
||||
- security
|
||||
|
||||
release:
|
||||
desc: "🏷️ Prepare and tag a new release."
|
||||
|
||||
@@ -83,6 +83,10 @@ final class ConfigurationTest extends TestCase
|
||||
],
|
||||
'translate' => true,
|
||||
'inject_assets' => true,
|
||||
'excluded_paths' => [
|
||||
'/^\/_profiler/',
|
||||
'/^\/_fragment/',
|
||||
],
|
||||
'filter' => [],
|
||||
'presets' => [
|
||||
'created' => [
|
||||
|
||||
@@ -47,7 +47,7 @@ final class FlasherListenerTest extends TestCase
|
||||
|
||||
public function testGetSubscribedEvents(): void
|
||||
{
|
||||
$expectedEvents = [ResponseEvent::class => ['onKernelResponse', -256]];
|
||||
$expectedEvents = [ResponseEvent::class => ['onKernelResponse', -20]];
|
||||
$subscribedEvents = FlasherListener::getSubscribedEvents();
|
||||
|
||||
// Verify that the FlasherListener is subscribed to the correct event and priority.
|
||||
|
||||
Reference in New Issue
Block a user