You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d7d950f6f | |||
| ce0a6e70fc | |||
| 60a76cf1c3 | |||
| 3f0087d7c3 | |||
| 5492d30374 | |||
| 7ff1ec4fc1 | |||
| e6237cbe42 | |||
| 09fc4d6ec5 | |||
| 1dac7bfdbb | |||
| b6ff681393 | |||
| 3e0b49d9db | |||
| ff48db2429 | |||
| 669e389677 | |||
| a19f4c4da1 | |||
| 7e5116eaed | |||
| fd6f43026b | |||
| 8e852700c4 | |||
| ed1d4154e9 | |||
| 13012ce31e | |||
| 3bd0365245 | |||
| 68fee8dcf0 | |||
| 018e83b8da | |||
| aeaf31b5bb | |||
| be50c09c04 | |||
| 6e4620ef77 | |||
| c675167ec5 | |||
| d7783cae2a | |||
| 412e386eb6 | |||
| 3588ac8d16 | |||
| cdf0f7949a | |||
| c5029a5d44 | |||
| e845b33608 | |||
| 30fb4672f1 |
@@ -1 +0,0 @@
|
||||
undefined
|
||||
@@ -1,15 +0,0 @@
|
||||
; This file is for unifying the coding style for different editors and IDEs.
|
||||
; More information at http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
github: yoeunes
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: https://www.paypal.com/paypalme/yoeunes
|
||||
custom: ['https://www.paypal.com/paypalme/yoeunes']
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
+79
-123
@@ -1,147 +1,103 @@
|
||||
name: tests
|
||||
name: Running tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 * * * *'
|
||||
|
||||
jobs:
|
||||
symfony-test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
symfony: [ 7.1.*, 7.0.*, 6.4.*, 6.3.*, 6.2.*, 6.1.*, 6.0.*, 5.4.*, 5.3.*, 5.2.*, 5.1.*, 5.0.*, 4.4.*, 4.3.*, 4.2.*, 4.1.*, 4.0.*, 3.4.*, 3.3.*, 3.2.*, 3.1.*, 3.0.*, 2.8.*, 2.7.*, 2.6.*, 2.5.*, 2.4.*, 2.3.*, 2.2.*, 2.1.*, 2.0.* ]
|
||||
symfony: [5.2.*, 5.1.*, 5.0.*, 4.4.*, 4.3.*, 4.2.*, 4.1.*, 4.0.*, 3.4.*, 3.3.*, 3.2.*, 3.1.*, 3.0.*, 2.8.*, 2.7.*]
|
||||
include:
|
||||
- { symfony: 7.1.*, php: 8.3, phpunit: 10.5.* }
|
||||
- { symfony: 7.0.*, php: 8.2, phpunit: 10.5.* }
|
||||
- { symfony: 6.4.*, php: 8.2, phpunit: 9.5.* }
|
||||
- { symfony: 6.3.*, php: 8.2, phpunit: 9.5.* }
|
||||
- { symfony: 6.2.*, php: 8.1, phpunit: 9.5.* }
|
||||
- { symfony: 6.1.*, php: 8.1, phpunit: 9.5.* }
|
||||
- { symfony: 6.0.*, php: 8.0, phpunit: 9.5.* }
|
||||
- { symfony: 5.4.*, php: 7.2, phpunit: 8.3.* }
|
||||
- { symfony: 5.3.*, php: 7.2, phpunit: 8.3.* }
|
||||
- { symfony: 5.2.*, php: 7.2, phpunit: 8.3.* }
|
||||
- { symfony: 5.1.*, php: 7.2, phpunit: 8.3.* }
|
||||
- { symfony: 5.0.*, php: 7.2, phpunit: 8.3.* }
|
||||
- { symfony: 4.4.*, php: 7.1, phpunit: 7.0.* }
|
||||
- { symfony: 4.3.*, php: 7.1, phpunit: 7.0.* }
|
||||
- { symfony: 4.2.*, php: 7.1, phpunit: 7.0.* }
|
||||
- { symfony: 4.1.*, php: 7.1, phpunit: 7.0.* }
|
||||
- { symfony: 4.0.*, php: 7.1, phpunit: 7.0.* }
|
||||
- { symfony: 3.4.*, php: 5.5, phpunit: 4.8.36 }
|
||||
- { symfony: 3.3.*, php: 5.5, phpunit: 4.8.36 }
|
||||
- { symfony: 3.2.*, php: 5.5, phpunit: 4.8.36 }
|
||||
- { symfony: 3.1.*, php: 5.5, phpunit: 4.8.36 }
|
||||
- { symfony: 3.0.*, php: 5.5, phpunit: 4.8.36 }
|
||||
- { symfony: 2.8.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- { symfony: 2.7.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- { symfony: 2.6.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- { symfony: 2.5.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- { symfony: 2.4.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- { symfony: 2.3.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- { symfony: 2.2.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- { symfony: 2.1.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- { symfony: 2.0.*, php: 5.3, phpunit: 4.8.36 }
|
||||
- symfony: 5.2.*
|
||||
php: 7.2
|
||||
phpunit: 8.3.*
|
||||
|
||||
name: symfony[${{ matrix.symfony }}] php[${{ matrix.php }}] - ${{ matrix.os }}
|
||||
- symfony: 5.1.*
|
||||
php: 7.2
|
||||
phpunit: 8.3.*
|
||||
|
||||
- symfony: 5.0.*
|
||||
php: 7.2
|
||||
phpunit: 8.3.*
|
||||
|
||||
- symfony: 4.4.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 4.3.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 4.2.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 4.1.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 4.0.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 3.4.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 3.3.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 3.2.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 3.1.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 3.0.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 2.8.*
|
||||
php: 5.3
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 2.7.*
|
||||
php: 5.3
|
||||
phpunit: 4.8.36
|
||||
|
||||
name: S${{ matrix.symfony }} - P${{ matrix.php }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.composer/cache/files
|
||||
key: dependencies-symfony-${{ matrix.symfony }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
|
||||
coverage: none
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.composer/cache
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
|
||||
restore-keys: ${{ runner.os }}-composer
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sed -i '/\"require\": {/,/},/d; /\"require-dev\": {/,/},/d' composer.json
|
||||
composer config --global allow-plugins true
|
||||
composer require "symfony/symfony:${{ matrix.symfony }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
|
||||
composer config extra.symfony.require "${{ matrix.symfony }}"
|
||||
|
||||
if [[ "${{ matrix.symfony }}" == "7.0.*" || "${{ matrix.symfony }}" == "7.1.*" ]]; then
|
||||
composer require "symfony/config:${{ matrix.symfony }}" \
|
||||
"symfony/console:${{ matrix.symfony }}" \
|
||||
"symfony/dependency-injection:${{ matrix.symfony }}" \
|
||||
"symfony/http-kernel:${{ matrix.symfony }}" \
|
||||
"symfony/translation:${{ matrix.symfony }}" \
|
||||
"symfony/framework-bundle:${{ matrix.symfony }}" \
|
||||
"symfony/twig-bundle:${{ matrix.symfony }}" \
|
||||
"phpunit/phpunit:${{ matrix.phpunit }}" \
|
||||
"monolog/monolog" --no-interaction --no-update
|
||||
else
|
||||
composer require "symfony/symfony:${{ matrix.symfony }}" "phpunit/phpunit:${{ matrix.phpunit }}" "monolog/monolog" --no-interaction --no-update
|
||||
fi
|
||||
|
||||
composer update --prefer-stable --prefer-dist
|
||||
composer update --prefer-dist --no-interaction --no-suggest
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/phpunit --configuration=phpunit-symfony.xml
|
||||
|
||||
laravel-test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
laravel: [ 11.*, 10.*, 9.*, 8.*, 7.*, 6.*, 5.8.*, 5.7.*, 5.6.*, 5.5.*, 5.4.*, 5.3.*, 5.2.*, 5.1.*, 5.0.*, 4.2.*, 4.1.*, 4.0.* ]
|
||||
include:
|
||||
- { laravel: 11.*, testbench: 9.*, php: 8.3, phpunit: 10.5.* }
|
||||
- { laravel: 11.*, testbench: 9.*, php: 8.2, phpunit: 10.5.* }
|
||||
- { laravel: 10.*, testbench: 8.*, php: 8.2, phpunit: 10.2.* }
|
||||
- { laravel: 9.*, testbench: 7.*, php: 8.1, phpunit: 9.5.* }
|
||||
- { laravel: 8.*, testbench: 6.*, php: 7.3, phpunit: 9.3.* }
|
||||
- { laravel: 7.*, testbench: 5.*, php: 7.3, phpunit: 8.4.* }
|
||||
- { laravel: 6.*, testbench: 4.*, php: 7.2, phpunit: 8.3.* }
|
||||
- { laravel: 5.8.*, testbench: 3.8.*, php: 7.1, phpunit: 7.5.* }
|
||||
- { laravel: 5.7.*, testbench: 3.7.*, php: 7.1, phpunit: 7.0.* }
|
||||
- { laravel: 5.6.*, testbench: 3.6.*, php: 7.1, phpunit: 7.0.* }
|
||||
- { laravel: 5.5.*, testbench: 3.5.*, php: 7.0, phpunit: 6.0.* }
|
||||
- { laravel: 5.4.*, testbench: 3.4.*, php: 5.6, phpunit: 5.7.* }
|
||||
- { laravel: 5.3.*, testbench: 3.3.*, php: 5.6, phpunit: 4.8.* }
|
||||
- { laravel: 5.2.*, testbench: 3.2.*, php: 5.5, phpunit: 4.8.* }
|
||||
- { laravel: 5.1.*, testbench: 3.1.*, php: 5.5, phpunit: 4.8.* }
|
||||
- { laravel: 5.0.*, testbench: 3.0.*, php: 5.4, phpunit: 4.8.* }
|
||||
- { laravel: 4.2.*, testbench: 2.2.*, php: 5.4, phpunit: 4.8.* }
|
||||
- { laravel: 4.1.*, testbench: 2.1.*, php: 5.4, phpunit: 4.8.* }
|
||||
- { laravel: 4.0.*, testbench: 2.0.*, php: 5.4, phpunit: 4.8.* }
|
||||
|
||||
name: laravel[${{ matrix.laravel }}] php[${{ matrix.php }}] - ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: fileinfo
|
||||
coverage: none
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.composer/cache
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
|
||||
restore-keys: ${{ runner.os }}-composer
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sed -i '/\"require\": {/,/},/d; /\"require-dev\": {/,/},/d' composer.json
|
||||
composer config --global allow-plugins true
|
||||
composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
|
||||
composer update --prefer-stable --prefer-dist
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/phpunit --configuration=phpunit-laravel.xml
|
||||
run: vendor/bin/phpunit
|
||||
|
||||
@@ -3,12 +3,3 @@ vendor
|
||||
composer.lock
|
||||
.phpunit.result.cache
|
||||
.phpcs-cache
|
||||
.php-cs-fixer.cache
|
||||
|
||||
packs/**/composer.lock
|
||||
packs/**/vendor/
|
||||
|
||||
node_modules/
|
||||
coverage/
|
||||
.phpunit.cache/
|
||||
.run/
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
$header = <<<'EOF'
|
||||
This file is part of the PHPFlasher package.
|
||||
(c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
EOF;
|
||||
|
||||
$rules = array(
|
||||
'@Symfony' => true,
|
||||
'header_comment' => array('header' => $header),
|
||||
'array_syntax' => array('syntax' => 'long'),
|
||||
'visibility_required' => array('elements' => array('property', 'method')),
|
||||
'ordered_class_elements' => true,
|
||||
);
|
||||
|
||||
$finder = new PhpCsFixer\Finder();
|
||||
$finder->in(__DIR__)->exclude(__DIR__.'/vendor');
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
|
||||
return $config->setFinder($finder)
|
||||
->setUsingCache(false)
|
||||
->setRiskyAllowed(true)
|
||||
->setRules($rules);
|
||||
+625
@@ -0,0 +1,625 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"
|
||||
>
|
||||
<arg name="basepath" value="."/>
|
||||
<arg name="extensions" value="php"/>
|
||||
<arg name="parallel" value="80"/>
|
||||
<arg name="cache" value=".phpcs-cache"/>
|
||||
<arg name="colors"/>
|
||||
|
||||
<!-- Ignore warnings, show progress of the run and show sniff names -->
|
||||
<arg value="nps"/>
|
||||
|
||||
<!-- Directories to be checked -->
|
||||
<file>src</file>
|
||||
<file>tests</file>
|
||||
|
||||
<!-- Import PSR-12 coding standard (base) -->
|
||||
<rule ref="PSR12"/>
|
||||
|
||||
<!-- Force array element indentation with 4 spaces -->
|
||||
<rule ref="Generic.Arrays.ArrayIndent"/>
|
||||
|
||||
<!-- Forbid `[...]` -->
|
||||
<rule ref="Generic.Arrays.DisallowShortArraySyntax"/>
|
||||
|
||||
<!-- Forbid duplicate classes -->
|
||||
<rule ref="Generic.Classes.DuplicateClassName"/>
|
||||
|
||||
<!-- Forbid empty statements -->
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement">
|
||||
<!-- But allow empty catch -->
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid final methods in final classes -->
|
||||
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
|
||||
|
||||
<!-- Forbid useless empty method overrides -->
|
||||
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
|
||||
|
||||
<!-- Align corresponding assignment statement tokens -->
|
||||
<rule ref="Generic.Formatting.MultipleStatementAlignment">
|
||||
<properties>
|
||||
<property name="error" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Force whitespace after a type cast -->
|
||||
<rule ref="Generic.Formatting.SpaceAfterCast">
|
||||
<properties>
|
||||
<property name="spacing" value="0"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Force whitespace after `!` -->
|
||||
<!-- <rule ref="Generic.Formatting.SpaceAfterNot"/> -->
|
||||
|
||||
<!-- Forbid PHP 4 constructors -->
|
||||
<rule ref="Generic.NamingConventions.ConstructorName"/>
|
||||
|
||||
<!-- Forbid any content before opening tag -->
|
||||
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
|
||||
|
||||
<!-- Forbid deprecated functions -->
|
||||
<rule ref="Generic.PHP.DeprecatedFunctions"/>
|
||||
|
||||
<!-- Forbid alias functions, i.e. `sizeof()`, `delete()` -->
|
||||
<rule ref="Generic.PHP.ForbiddenFunctions">
|
||||
<properties>
|
||||
<property name="forbiddenFunctions" type="array">
|
||||
<element key="chop" value="rtrim"/>
|
||||
<element key="close" value="closedir"/>
|
||||
<element key="compact" value="null"/>
|
||||
<element key="delete" value="unset"/>
|
||||
<element key="doubleval" value="floatval"/>
|
||||
<element key="extract" value="null"/>
|
||||
<element key="fputs" value="fwrite"/>
|
||||
<element key="ini_alter" value="ini_set"/>
|
||||
<element key="is_double" value="is_float"/>
|
||||
<element key="is_integer" value="is_int"/>
|
||||
<element key="is_long" value="is_int"/>
|
||||
<element key="is_null" value="null"/>
|
||||
<element key="is_real" value="is_float"/>
|
||||
<element key="is_writeable" value="is_writable"/>
|
||||
<element key="join" value="implode"/>
|
||||
<element key="key_exists" value="array_key_exists"/>
|
||||
<element key="pos" value="current"/>
|
||||
<element key="settype" value="null"/>
|
||||
<element key="show_source" value="highlight_file"/>
|
||||
<element key="sizeof" value="count"/>
|
||||
<element key="strchr" value="strstr"/>
|
||||
<element key="user_error" value="trigger_error"/>
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid useless inline string concatenation -->
|
||||
<rule ref="Generic.Strings.UnnecessaryStringConcat">
|
||||
<!-- But multiline is useful for readability -->
|
||||
<properties>
|
||||
<property name="allowMultiline" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid backtick operator -->
|
||||
<rule ref="Generic.PHP.BacktickOperator"/>
|
||||
|
||||
<!-- Force PHP 7 param and return types to be lowercased -->
|
||||
<rule ref="Generic.PHP.LowerCaseType"/>
|
||||
|
||||
<!-- Forbid `php_sapi_name()` function -->
|
||||
<rule ref="Generic.PHP.SAPIUsage"/>
|
||||
|
||||
<!-- Forbid comments starting with # -->
|
||||
<rule ref="PEAR.Commenting.InlineComment"/>
|
||||
|
||||
<!-- Disallow else if in favor of elseif -->
|
||||
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed">
|
||||
<type>error</type>
|
||||
</rule>
|
||||
|
||||
<!-- Require that single line arrays have the correct spacing: no space around brackets and one space after comma -->
|
||||
<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/>
|
||||
|
||||
<!-- Require comma after last element in multi-line array -->
|
||||
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
|
||||
|
||||
<!-- Require presence of constant visibility -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility">
|
||||
<properties>
|
||||
<property name="fixable" value="true"/>
|
||||
</properties>
|
||||
</rule> -->
|
||||
|
||||
<!-- Forbid LSB for constants (static::FOO) -->
|
||||
<rule ref="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants"/>
|
||||
|
||||
<!-- Forbid more than one constant declared per statement -->
|
||||
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition"/>
|
||||
|
||||
<!-- Forbid empty lines around type declarations -->
|
||||
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
|
||||
<properties>
|
||||
<property name="linesCountAfterOpeningBrace" value="0"/>
|
||||
<property name="linesCountBeforeClosingBrace" value="0"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Require usage of ::class instead of __CLASS__, get_class(), get_class($this), get_called_class() and get_parent_class() -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/> -->
|
||||
|
||||
<!-- Forbid uses of multiple traits separated by comma -->
|
||||
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration"/>
|
||||
|
||||
<!-- Require no spaces before trait use, between trait uses and one space after trait uses -->
|
||||
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing">
|
||||
<properties>
|
||||
<property name="linesCountAfterLastUse" value="1"/>
|
||||
<property name="linesCountAfterLastUseWhenLastInClass" value="0"/>
|
||||
<property name="linesCountBeforeFirstUse" value="0"/>
|
||||
<property name="linesCountBetweenUses" value="0"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid dead code -->
|
||||
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements"/>
|
||||
|
||||
<!-- Forbid useless annotations - Git and LICENCE file provide more accurate information -->
|
||||
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
|
||||
<properties>
|
||||
<property name="forbiddenAnnotations" type="array">
|
||||
<element value="@api"/>
|
||||
<element value="@author"/>
|
||||
<element value="@category"/>
|
||||
<element value="@copyright"/>
|
||||
<element value="@created"/>
|
||||
<element value="@license"/>
|
||||
<element value="@package"/>
|
||||
<element value="@since"/>
|
||||
<element value="@subpackage"/>
|
||||
<element value="@version"/>
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid empty comments -->
|
||||
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>
|
||||
|
||||
<!-- Forbid useless comments -->
|
||||
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
|
||||
<properties>
|
||||
<property name="forbiddenCommentPatterns" type="array">
|
||||
<element value="~^(?:(?!private|protected|static)\S+ )?(?:con|de)structor\.\z~i"/>
|
||||
<element value="~^Created by .+\.\z~i"/>
|
||||
<element value="~^(User|Date|Time): \S+\z~i"/>
|
||||
<element value="~^\S+ [gs]etter\.\z~i"/>
|
||||
<element value="~^(Class|Interface|Trait) \S+\z~i"/>
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Require specific order of phpDoc annotations with empty newline between specific groups -->
|
||||
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
|
||||
<properties>
|
||||
<property name="linesCountBeforeFirstContent" value="0"/>
|
||||
<property name="linesCountAfterLastContent" value="0"/>
|
||||
<property name="linesCountBetweenDescriptionAndAnnotations" value="1"/>
|
||||
<property name="linesCountBetweenAnnotationsGroups" value="1"/>
|
||||
<property name="annotationsGroups" type="array">
|
||||
<element value="
|
||||
@internal,
|
||||
@deprecated,
|
||||
"/>
|
||||
<element value="
|
||||
@link,
|
||||
@see,
|
||||
@uses,
|
||||
"/>
|
||||
<element value="@var"/>
|
||||
<element value="@ORM\"/>
|
||||
<element value="@param"/>
|
||||
<element value="@return"/>
|
||||
<element value="@throws"/>
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Report invalid format of inline phpDocs with @var -->
|
||||
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/>
|
||||
|
||||
<!-- Require comments with single line written as one-liners -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment"/> -->
|
||||
|
||||
<!-- Forbid assignments in conditions -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
|
||||
|
||||
<!-- Require consistent spacing for block structures -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing">
|
||||
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeControlStructure" />
|
||||
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeFirstControlStructure" />
|
||||
<properties>
|
||||
<property name="tokensToCheck" type="array">
|
||||
<element value="T_IF" />
|
||||
<element value="T_DO" />
|
||||
<element value="T_WHILE" />
|
||||
<element value="T_FOR" />
|
||||
<element value="T_FOREACH" />
|
||||
<element value="T_SWITCH" />
|
||||
<element value="T_TRY" />
|
||||
<element value="T_DEFAULT" />
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid fancy yoda conditions -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/> -->
|
||||
|
||||
<!-- Require usage of early exit -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit"/>
|
||||
|
||||
<!-- Require consistent spacing for jump statements -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing">
|
||||
<properties>
|
||||
<property name="linesCountBeforeWhenFirstInCaseOrDefault" value="0"/>
|
||||
<property name="linesCountAfterWhenLastInCaseOrDefault" value="1"/>
|
||||
<property name="linesCountAfterWhenLastInLastCaseOrDefault" value="0"/>
|
||||
<property name="tokensToCheck" type="array">
|
||||
<element value="T_RETURN" />
|
||||
<element value="T_THROW" />
|
||||
<element value="T_YIELD" />
|
||||
<element value="T_YIELD_FROM" />
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Require language constructs without parentheses -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
|
||||
|
||||
<!-- Require usage of null coalesce operator equal operator when possible -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/> -->
|
||||
|
||||
<!-- Require usage of null coalesce operator when possible -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/> -->
|
||||
|
||||
<!-- Forbid usage of conditions when a simple return can be used -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn"/>
|
||||
|
||||
<!-- Forbid usage of boolean-only ternary operator usage (e.g. $foo ? true : false) -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator"/>
|
||||
|
||||
<!-- Forbid useless unreachable catch blocks -->
|
||||
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
|
||||
|
||||
<!-- Require using Throwable instead of Exception -->
|
||||
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"/>
|
||||
|
||||
<!-- Ensure Arrow Functions declaration format -->
|
||||
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
|
||||
<properties>
|
||||
<property name="spacesCountAfterKeyword" value="1"/>
|
||||
<property name="spacesCountBeforeArrow" value="1"/>
|
||||
<property name="spacesCountAfterArrow" value="1"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Require closures not referencing $this be static -->
|
||||
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
|
||||
|
||||
<!-- Forbid unused variables passed to closures via `use` -->
|
||||
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
|
||||
|
||||
<!-- Require presence of declare(strict_types=1) -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
|
||||
<properties>
|
||||
<property name="newlinesCountBetweenOpenTagAndDeclare" value="2"/>
|
||||
<property name="spacesCountAroundEqualsSign" value="0"/>
|
||||
<property name="newlinesCountAfterDeclare" value="2"/>
|
||||
</properties>
|
||||
</rule> -->
|
||||
|
||||
<!-- Require consistent spacing for block structures -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing"/>
|
||||
|
||||
<!-- Forbid unused use statements -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
|
||||
<properties>
|
||||
<property name="searchAnnotations" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Require use statements to be alphabetically sorted -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
|
||||
|
||||
<!-- Forbid fancy group uses -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
|
||||
|
||||
<!-- Forbid multiple use statements on same line -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
|
||||
|
||||
<!-- Require newlines around namespace declaration -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing"/>
|
||||
|
||||
<!-- Forbid using absolute class name references -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/> -->
|
||||
|
||||
<!-- Forbid superfluous leading backslash in use statements -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
|
||||
|
||||
<!-- Forbid useless uses of the same namespace -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
|
||||
|
||||
<!-- Require empty newlines before and after uses -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
|
||||
<properties>
|
||||
<property name="linesCountAfterLastUse" value="1"/>
|
||||
<property name="linesCountBeforeFirstUse" value="1"/>
|
||||
<property name="linesCountBetweenUseTypes" value="1"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid useless alias for classes, constants and functions -->
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
|
||||
|
||||
<!-- Forbid weak comparisons -->
|
||||
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
|
||||
|
||||
<!-- Forbid spacing before the negative operator `-` -->
|
||||
<rule ref="SlevomatCodingStandard.Operators.NegationOperatorSpacing"/>
|
||||
|
||||
<!-- Require the usage of assignment operators, eg `+=`, `.=` when possible -->
|
||||
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>
|
||||
|
||||
<!-- Require no spacing after spread operator -->
|
||||
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"/>
|
||||
|
||||
<!-- Forbid `list(...)` syntax -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.PHP.ShortList"/> -->
|
||||
|
||||
<!-- Forbid use of longhand cast operators -->
|
||||
<rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
|
||||
|
||||
<!-- Forbid useless parentheses -->
|
||||
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses"/>
|
||||
|
||||
<!-- Forbid useless semicolon `;` -->
|
||||
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
|
||||
|
||||
<!-- Require use of short versions of scalar types (i.e. int instead of integer) -->
|
||||
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
|
||||
|
||||
<!-- Require the `null` type hint to be in the last position of annotations -->
|
||||
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/>
|
||||
|
||||
<!-- Require ? when default value is null -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/> -->
|
||||
|
||||
<!-- Require one space between typehint and variable, require no space between nullability sign and typehint -->
|
||||
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
|
||||
|
||||
<!-- Require space around colon in return types -->
|
||||
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing">
|
||||
<properties>
|
||||
<property name="spacesCountBeforeColon" value="0"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid useless @var for constants -->
|
||||
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/>
|
||||
|
||||
<!-- Forbid useless inherit doc comment -->
|
||||
<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
|
||||
|
||||
<!-- Forbid duplicated variables assignments -->
|
||||
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
|
||||
|
||||
<!-- Forbid useless variables -->
|
||||
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
|
||||
|
||||
<!-- Forbid spaces around square brackets -->
|
||||
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
|
||||
|
||||
<!-- Forbid class being in a file with different name -->
|
||||
<rule ref="Squiz.Classes.ClassFileName"/>
|
||||
|
||||
<!-- Force `self::` for self-reference, force lower-case self, forbid spaces around `::` -->
|
||||
<rule ref="Squiz.Classes.SelfMemberReference"/>
|
||||
|
||||
<!-- Forbid global functions -->
|
||||
<rule ref="Squiz.Functions.GlobalFunction"/>
|
||||
|
||||
<!-- Force camelCase variables -->
|
||||
<rule ref="Squiz.NamingConventions.ValidVariableName">
|
||||
<exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore" />
|
||||
</rule>
|
||||
|
||||
<!-- Force phpDoc alignment -->
|
||||
<rule ref="Squiz.Commenting.DocCommentAlignment">
|
||||
<!-- Allow extra spaces after star, i.e. for indented annotations -->
|
||||
<exclude name="Squiz.Commenting.DocCommentAlignment.SpaceAfterStar"/>
|
||||
</rule>
|
||||
|
||||
<!-- Force array declaration structure -->
|
||||
<rule ref="Squiz.Arrays.ArrayDeclaration">
|
||||
<!-- Disable arrow alignment -->
|
||||
<exclude name="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned"/>
|
||||
<!-- Uses indentation of only single space -->
|
||||
<exclude name="Squiz.Arrays.ArrayDeclaration.KeyNotAligned"/>
|
||||
<!-- Allow multiple values on a single line -->
|
||||
<exclude name="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed"/>
|
||||
<!-- Disable alignment of braces -->
|
||||
<exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"/>
|
||||
<!-- Disable alignment of values with opening brace -->
|
||||
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNotAligned"/>
|
||||
<!-- Checked by SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma -->
|
||||
<exclude name="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast"/>
|
||||
<exclude name="Squiz.Arrays.ArrayDeclaration.NoComma"/>
|
||||
</rule>
|
||||
|
||||
<!-- Force rules for function phpDoc -->
|
||||
<rule ref="Squiz.Commenting.FunctionComment">
|
||||
<!-- Allow `@throws` without description -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.EmptyThrows"/>
|
||||
<!-- Does not work properly with PHP 7 / short-named types -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.IncorrectParamVarName"/>
|
||||
<!-- Does not support collections, i.e. `string[]` -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.IncorrectTypeHint"/>
|
||||
<!-- Forces incorrect types -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.InvalidReturn"/>
|
||||
<!-- Breaks with compound return types, i.e. `string|null` -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.InvalidReturnNotVoid"/>
|
||||
<!-- Breaks when all params are not documented -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.InvalidTypeHint"/>
|
||||
<!-- Doc comment is not required for every method -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.Missing"/>
|
||||
<!-- Do not require comments for `@param` -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
|
||||
<!-- Do not require `@param` for all parameters -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/>
|
||||
<!-- Do not require `@return` for void methods -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.MissingReturn"/>
|
||||
<!-- Comments don't have to be sentences -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullFullStop"/>
|
||||
<!-- Comments don't have to be sentences -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentNotCapital"/>
|
||||
<!-- Breaks when all params are not documented -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.ParamNameNoMatch"/>
|
||||
<!-- Doesn't respect inheritance -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing"/>
|
||||
<!-- `@throws` lines can often be read as a sentence,
|
||||
i.e. `@throws RuntimeException if the file could not be written.` -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNotCapital"/>
|
||||
<!-- Doesn't work with self as typehint -->
|
||||
<exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid `AND` and `OR`, require `&&` and `||` -->
|
||||
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
|
||||
|
||||
<!-- Forbid `global` -->
|
||||
<rule ref="Squiz.PHP.GlobalKeyword"/>
|
||||
|
||||
<!-- Forbid functions inside functions -->
|
||||
<rule ref="Squiz.PHP.InnerFunctions"/>
|
||||
|
||||
<!-- Require PHP function calls in lowercase -->
|
||||
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
|
||||
|
||||
<!-- Forbid `$this` inside static function -->
|
||||
<rule ref="Squiz.Scope.StaticThisUsage"/>
|
||||
|
||||
<!-- Force whitespace before and after concatenation -->
|
||||
<!-- <rule ref="Squiz.Strings.ConcatenationSpacing">
|
||||
<properties>
|
||||
<property name="spacing" value="0"/>
|
||||
<property name="ignoreNewlines" value="true"/>
|
||||
</properties>
|
||||
</rule> -->
|
||||
|
||||
<!-- Forbid dead code -->
|
||||
<rule ref="Squiz.PHP.NonExecutableCode"/>
|
||||
|
||||
<!-- Forbid strings in `"` unless necessary -->
|
||||
<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
|
||||
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
|
||||
<message>Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead</message>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid braces around string in `echo` -->
|
||||
<rule ref="Squiz.Strings.EchoedStrings"/>
|
||||
|
||||
<!-- Forbid spaces in type casts -->
|
||||
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
|
||||
|
||||
<!-- Forbid blank line after function opening brace -->
|
||||
<rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/>
|
||||
|
||||
<!-- Require 1 line before and after function, except at the top and bottom -->
|
||||
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
|
||||
<properties>
|
||||
<property name="spacing" value="1" />
|
||||
<property name="spacingBeforeFirst" value="0"/>
|
||||
<property name="spacingAfterLast" value="0"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Require there be no space between increment/decrement operator and its operand -->
|
||||
<rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/>
|
||||
|
||||
<!-- Require space after language constructs -->
|
||||
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
|
||||
|
||||
<!-- Require space around logical operators -->
|
||||
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
|
||||
|
||||
<!-- Forbid spaces around `->` operator -->
|
||||
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
|
||||
<properties>
|
||||
<property name="ignoreNewlines" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Forbid spaces before semicolon `;` -->
|
||||
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
|
||||
|
||||
<!-- Forbid superfluous whitespaces -->
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
|
||||
<properties>
|
||||
<!-- turned on by PSR2 -> turning back off -->
|
||||
<property name="ignoreBlankLines" value="false"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
|
||||
<!-- turned off by PSR2 -> turning back on -->
|
||||
<severity>5</severity>
|
||||
</rule>
|
||||
|
||||
<!-- Checks that class/trait/interface members are in the correct order. -->
|
||||
<rule ref="SlevomatCodingStandard.Classes.ClassStructure"/>
|
||||
|
||||
<!-- Disallows use of continue without integer operand in switch because it emits a warning in PHP 7.3 and higher. -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch"/>
|
||||
|
||||
<!-- Enforces reasonable end bracket placement for multiline arrays. -->
|
||||
<rule ref="SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement"/>
|
||||
|
||||
<!-- Checks that there is a certain number of blank lines between properties. -->
|
||||
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing"/>
|
||||
|
||||
<!-- Require consistent spacing for jump statements -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing">
|
||||
<properties>
|
||||
<property name="tokensToCheck" type="array">
|
||||
<element value="T_RETURN" />
|
||||
<element value="T_THROW" />
|
||||
<element value="T_YIELD" />
|
||||
<element value="T_YIELD_FROM" />
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Require consistent spacing for block structures -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing">
|
||||
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeControlStructure" />
|
||||
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeFirstControlStructure" />
|
||||
<properties>
|
||||
<property name="tokensToCheck" type="array">
|
||||
<element value="T_IF" />
|
||||
<element value="T_DO" />
|
||||
<element value="T_WHILE" />
|
||||
<element value="T_FOR" />
|
||||
<element value="T_FOREACH" />
|
||||
<element value="T_SWITCH" />
|
||||
<element value="T_TRY" />
|
||||
<element value="T_DEFAULT" />
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Requires new with parentheses. -->
|
||||
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses"/>
|
||||
|
||||
<!-- Disallows usage of array type hint syntax (eg. int[], bool[][]) in phpDocs in favour of generic type hint syntax (eg. array<int>, array<array<bool>>) -->
|
||||
<!-- <rule ref="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax" />-->
|
||||
</ruleset>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META;
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
name: Auto Closer PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Hi, thank you for your contribution.
|
||||
|
||||
Unfortunately, this repository is read-only. It's a split from our main monorepo repository.
|
||||
|
||||
We'd like to kindly ask you to move the contribution there - https://github.com/php-flasher/php-flasher.
|
||||
|
||||
We'll check it, review it and give you feed back right way.
|
||||
|
||||
Thank you.
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Toastr\Symfony\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
||||
final class Configuration implements ConfigurationInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder('flasher_toastr');
|
||||
|
||||
if (\method_exists($treeBuilder, 'getRootNode')) {
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
} else {
|
||||
// BC layer for symfony/config 4.1 and older
|
||||
$rootNode = $treeBuilder->root('flasher_toastr');
|
||||
}
|
||||
|
||||
$rootNode
|
||||
->children()
|
||||
->arrayNode('scripts')
|
||||
->prototype('scalar')->end()
|
||||
->defaultValue(array(
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js',
|
||||
'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@0.1.3/dist/flasher-toastr.min.js',
|
||||
))
|
||||
->end()
|
||||
->arrayNode('styles')
|
||||
->prototype('scalar')->end()
|
||||
->defaultValue(array())
|
||||
->end()
|
||||
->arrayNode('options')
|
||||
->prototype('variable')->end()
|
||||
->ignoreExtraKeys(false)
|
||||
->defaultValue(array(
|
||||
'progressBar' => true,
|
||||
'timeOut' => 5000,
|
||||
))
|
||||
->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Toastr\Symfony\DependencyInjection;
|
||||
|
||||
use Flasher\Symfony\DependencyInjection\Extension;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
|
||||
final class FlasherToastrExtension extends Extension
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function getConfigFileLocator()
|
||||
{
|
||||
return new FileLocator(__DIR__.'/../Resources/config');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function getConfigClass()
|
||||
{
|
||||
return new Configuration();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Toastr\Symfony;
|
||||
|
||||
use Flasher\Toastr\Symfony\DependencyInjection\FlasherToastrExtension;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class FlasherToastrSymfonyBundle extends Bundle
|
||||
{
|
||||
public function getContainerExtension()
|
||||
{
|
||||
return new FlasherToastrExtension();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 PHPFlasher
|
||||
|
||||
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.
|
||||
@@ -1,67 +1,80 @@
|
||||
<p align="center"><img width="600" alt="flasher" src="https://user-images.githubusercontent.com/10859693/102468596-03317180-4052-11eb-9df3-44dc6235b238.png"></p>
|
||||
|
||||
<h1 align="center">A powerful and flexible flash notifications system for PHP, Laravel, Symfony</h1>
|
||||
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
|
||||
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
|
||||
</picture>
|
||||
:eyes: PHP Flasher helps you to add flash notifications to your PHP projects.
|
||||
This library was developed with the idea that you should be able to add flash notification to your application with ease and with few lines of code.
|
||||
No application-wide rewrites and no big investments upfront.
|
||||
</p>
|
||||
|
||||
## About PHPFlasher
|
||||
<p align="center">
|
||||
<a href="https://github.com/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/badge/source-php--flasher/flasher-blue.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://github.com/php-flasher/flasher/releases">
|
||||
<img src="https://img.shields.io/github/tag/php-flasher/flasher.svg">
|
||||
</a>
|
||||
<a href="https://github.com/php-flasher/flasher/blob/master/LICENSE">
|
||||
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg">
|
||||
</a>
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/dt/php-flasher/flasher.svg">
|
||||
</a>
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/php-v/php-flasher/flasher.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/backer/badge.svg?label=backer&color=brightgreen" />
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/sponsor/badge.svg?label=sponsor&color=brightgreen" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects.
|
||||
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
|
||||
# Why use PHP Flasher ?
|
||||
|
||||
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page.
|
||||
This improves user engagement and enhances the overall user experience on your website or application.
|
||||
The PHP Flasher project supports many notification libraries : __tailwindcss__, __bootstrap__, __toastr.js__, __sweet alert 2__, __pnotify__, __noty__, and __notyf__
|
||||
and its highly extendable so you can add your custom notifications.
|
||||
|
||||
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects.
|
||||
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
|
||||
This library is designed, so you can take full control when creating you notifications :
|
||||
|
||||
> * Display multiple notifications
|
||||
> * Sort and filter notifications
|
||||
> * Render notification from JSON object
|
||||
> * Limit the number of displayed notifications
|
||||
> * Show notifications from different libraries at the same time
|
||||
> * Framework angostic with integration for : Symfony and Laravel
|
||||
> * Support templates
|
||||
> * Easy migration from similar libraries.
|
||||
> * Very flexible so you can add you own adapters
|
||||
> * ...and more
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io).
|
||||
Documentation for PHP Flasher can be found on the [PHP Flasher website](https://php-flasher.github.io/).
|
||||
|
||||
## Contributors and sponsors
|
||||
## Backers && Sponsors
|
||||
|
||||
Join our team of contributors and make a lasting impact on our project!
|
||||
Support this project by becoming a sponsor. Your name will show up in the Contribute page of all PHP Flasher installations as well as here with a link to your website!
|
||||
|
||||
We are always looking for passionate individuals who want to contribute their skills and ideas.
|
||||
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration.
|
||||
Thank you to all our backers and sponsors! 🙏
|
||||
|
||||
Shining stars of our community:
|
||||
<a href="https://opencollective.com/php-flasher#backers" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/backers.svg?width=890" title="Backers" alt="Backers">
|
||||
</a>
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes-khoubza/"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes KHOUBZA"/><br /><sub><b>Younes KHOUBZA</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="https://opencollective.com/php-flasher#sponsors" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/sponsors.svg?width=890" title="Sponsors" alt="Sponsors">
|
||||
</a>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
### Contact
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
PHP Flasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. You can reach out with questions, bug reports, or feature requests
|
||||
on any of the following:
|
||||
|
||||
## Contact
|
||||
|
||||
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
|
||||
You can reach out with questions, bug reports, or feature requests on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
|
||||
- [Github Issues](https://github.com/php-flasher/flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
@@ -69,6 +82,6 @@ You can reach out with questions, bug reports, or feature requests on any of the
|
||||
|
||||
## License
|
||||
|
||||
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
PHP Flasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> </b> </p>
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> <b> </p>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
services:
|
||||
flasher.toastr:
|
||||
parent: 'flasher.notification_factory'
|
||||
class: Flasher\Toastr\Prime\ToastrFactory
|
||||
tags:
|
||||
- { name: 'flasher.factory', alias: 'toastr' }
|
||||
|
||||
Flasher\Toastr\Prime\ToastrFactory: '@flasher.toastr'
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Toastr\Symfony\Tests\DependencyInjection;
|
||||
|
||||
use Flasher\Prime\Tests\TestCase;
|
||||
use Flasher\Toastr\Symfony\DependencyInjection\Configuration;
|
||||
use Symfony\Component\Config\Definition\Processor;
|
||||
|
||||
class ConfigurationTest extends TestCase
|
||||
{
|
||||
public function testDefaultConfig()
|
||||
{
|
||||
$config = $this->process(array());
|
||||
|
||||
$expected = array(
|
||||
'scripts' => array(
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js',
|
||||
'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@0.1.3/dist/flasher-toastr.min.js',
|
||||
),
|
||||
'styles' => array(),
|
||||
'options' => array(
|
||||
'progressBar' => true,
|
||||
'timeOut' => 5000,
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertSame($expected, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes an array of configurations and returns a compiled version.
|
||||
*
|
||||
* @param array $configs An array of raw configurations
|
||||
*
|
||||
* @return array A normalized array
|
||||
*/
|
||||
private function process($configs)
|
||||
{
|
||||
$processor = new Processor();
|
||||
|
||||
return $processor->processConfiguration(new Configuration(), $configs);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Toastr\Symfony\Tests\DependencyInjection;
|
||||
|
||||
use Flasher\Prime\Tests\TestCase;
|
||||
use Flasher\Symfony\DependencyInjection\FlasherExtension;
|
||||
use Flasher\Symfony\FlasherSymfonyBundle;
|
||||
use Flasher\Toastr\Symfony\DependencyInjection\FlasherToastrExtension;
|
||||
use Flasher\Toastr\Symfony\FlasherToastrSymfonyBundle;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
class FlasherToastrExtensionTest extends TestCase
|
||||
{
|
||||
public function testContainerContainFlasherServices()
|
||||
{
|
||||
$container = $this->getRawContainer();
|
||||
$container->loadFromExtension('flasher', array());
|
||||
$container->loadFromExtension('flasher_toastr', array());
|
||||
$container->compile();
|
||||
|
||||
$this->assertTrue($container->has('flasher.toastr'));
|
||||
}
|
||||
|
||||
public function testCreateInstanceOfToastrAdapter()
|
||||
{
|
||||
$container = $this->getRawContainer();
|
||||
$container->loadFromExtension('flasher');
|
||||
$container->loadFromExtension('flasher_toastr');
|
||||
$container->compile();
|
||||
|
||||
$flasher = $container->getDefinition('flasher');
|
||||
$calls = $flasher->getMethodCalls();
|
||||
|
||||
$this->assertCount(2, $calls);
|
||||
$this->assertSame('addFactory', $calls[0][0]);
|
||||
$this->assertSame('template', $calls[0][1][0]);
|
||||
$this->assertSame('flasher.notification_factory', (string) $calls[0][1][1]);
|
||||
|
||||
$this->assertSame('addFactory', $calls[1][0]);
|
||||
$this->assertSame('toastr', $calls[1][1][0]);
|
||||
$this->assertSame('flasher.toastr', (string) $calls[1][1][1]);
|
||||
}
|
||||
|
||||
private function getRawContainer()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
|
||||
$container->registerExtension(new FlasherExtension());
|
||||
$flasherBundle = new FlasherSymfonyBundle();
|
||||
$flasherBundle->build($container);
|
||||
|
||||
$container->registerExtension(new FlasherToastrExtension());
|
||||
$adapterBundle = new FlasherToastrSymfonyBundle();
|
||||
$adapterBundle->build($container);
|
||||
|
||||
$container->getCompilerPassConfig()->setOptimizationPasses(array());
|
||||
$container->getCompilerPassConfig()->setRemovingPasses(array());
|
||||
$container->getCompilerPassConfig()->setAfterRemovingPasses(array());
|
||||
|
||||
return $container;
|
||||
}
|
||||
|
||||
private function getContainer()
|
||||
{
|
||||
$container = $this->getRawContainer();
|
||||
$container->loadFromExtension('flasher', array());
|
||||
$container->loadFromExtension('flasher_toastr', array());
|
||||
$container->compile();
|
||||
|
||||
return $container;
|
||||
}
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
/** @var \Flasher\Prime\Plugin\PluginInterface[] $plugins */
|
||||
$plugins = array(
|
||||
new \Flasher\Prime\Plugin\FlasherPlugin(),
|
||||
new \Flasher\Noty\Prime\NotyPlugin(),
|
||||
new \Flasher\Notyf\Prime\NotyfPlugin(),
|
||||
new \Flasher\Pnotify\Prime\PnotifyPlugin(),
|
||||
new \Flasher\SweetAlert\Prime\SweetAlertPlugin(),
|
||||
new \Flasher\Toastr\Prime\ToastrPlugin(),
|
||||
);
|
||||
|
||||
echo 'Downloading assets ...'. PHP_EOL;
|
||||
|
||||
foreach ($plugins as $plugin) {
|
||||
$scripts = $plugin->getScripts();
|
||||
|
||||
foreach ($scripts['cdn'] as $index => $script) {
|
||||
echo $script . PHP_EOL;
|
||||
|
||||
$path = $plugin->getAssetsDir() . '/'. pathinfo($script, PATHINFO_BASENAME);
|
||||
$content = file_get_contents($script);
|
||||
file_put_contents($path, $content);
|
||||
}
|
||||
|
||||
$styles = $plugin->getStyles();
|
||||
|
||||
foreach ($styles['cdn'] as $index => $script) {
|
||||
echo $script . PHP_EOL;
|
||||
|
||||
$path = $plugin->getAssetsDir() . '/'. pathinfo($script, PATHINFO_BASENAME);
|
||||
$content = file_get_contents($script);
|
||||
file_put_contents($path, $content);
|
||||
}
|
||||
}
|
||||
|
||||
echo 'DONE' . PHP_EOL;
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
$shared = realpath(__DIR__.'/../.shared');
|
||||
|
||||
$resources = array(
|
||||
$shared,
|
||||
__DIR__.'/../.github/FUNDING.yml',
|
||||
__DIR__.'/../README.md',
|
||||
__DIR__.'/../LICENSE',
|
||||
);
|
||||
|
||||
$dirs = array(__DIR__.'/../packs', __DIR__.'/../src');
|
||||
|
||||
$packages = array_reduce($dirs, function ($files, $dir) {
|
||||
return array_merge($files, glob("$dir/*/composer.json"), glob("$dir/*/*/composer.json"));
|
||||
}, array());
|
||||
|
||||
foreach ($packages as $package) {
|
||||
$package = realpath(dirname($package));
|
||||
foreach ($resources as $resource) {
|
||||
$resource = realpath($resource);
|
||||
$dest = $package.str_replace(realpath(__DIR__.'/../'), '', $resource);
|
||||
|
||||
if (!is_dir($resource) && file_exists($resource)) {
|
||||
copy($resource, $dest);
|
||||
continue;
|
||||
}
|
||||
|
||||
$files = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($resource, FilesystemIterator::SKIP_DOTS),
|
||||
RecursiveIteratorIterator::SELF_FIRST
|
||||
);
|
||||
|
||||
foreach ($files as $file) {
|
||||
$target = $resource === $shared
|
||||
? $package.str_replace($resource, '', $file->getPathname())
|
||||
: $dest .'/'. $file->getFilename();
|
||||
|
||||
if ($file->isDir()) {
|
||||
system('rm -rf -- ' . escapeshellarg($dest));
|
||||
@mkdir(dirname($target), 0777, true);
|
||||
continue;
|
||||
}
|
||||
|
||||
@mkdir(dirname($target), 0777, true);
|
||||
@copy($file->getPathname(), $target);
|
||||
}
|
||||
}
|
||||
}
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# Make sure the release tag is provided.
|
||||
if (( "$#" != 1 ))
|
||||
then
|
||||
echo "Tag has to be provided."
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RELEASE_BRANCH="main"
|
||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
VERSION=$1
|
||||
|
||||
# Make sure current branch and release branch match.
|
||||
if [[ "$RELEASE_BRANCH" != "$CURRENT_BRANCH" ]]
|
||||
then
|
||||
echo "Release branch ($RELEASE_BRANCH) does not match the current active branch ($CURRENT_BRANCH)."
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure the working directory is clear.
|
||||
if [[ ! -z "$(git status --porcelain)" ]]
|
||||
then
|
||||
echo "Your working directory is dirty. Did you forget to commit your changes?"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure latest changes are fetched first.
|
||||
git fetch origin
|
||||
|
||||
# Make sure that release branch is in sync with origin.
|
||||
if [[ $(git rev-parse HEAD) != $(git rev-parse origin/$RELEASE_BRANCH) ]]
|
||||
then
|
||||
echo "Your branch is out of date with its upstream. Did you forget to pull or push any changes before releasing?"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Always prepend with "v"
|
||||
if [[ $VERSION != v* ]]
|
||||
then
|
||||
VERSION="v$VERSION"
|
||||
fi
|
||||
|
||||
# Tag PHPFlasher
|
||||
git tag "$VERSION"
|
||||
git push origin --tags --force
|
||||
|
||||
# Tag Repositories
|
||||
for REMOTE in flasher flasher-laravel flasher-symfony \
|
||||
flasher-toastr flasher-toastr-laravel flasher-toastr-symfony \
|
||||
flasher-notyf flasher-notyf-laravel flasher-notyf-symfony \
|
||||
flasher-sweetalert flasher-sweetalert-laravel flasher-sweetalert-symfony \
|
||||
flasher-pnotify flasher-pnotify-laravel flasher-pnotify-symfony \
|
||||
flasher-noty flasher-noty-laravel flasher-noty-symfony \
|
||||
flasher-cli flasher-cli-laravel flasher-cli-symfony \
|
||||
laravel-pack php-pack symfony-pack
|
||||
do
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Releasing $REMOTE";
|
||||
|
||||
TMP_DIR="/tmp/php-flasher"
|
||||
REMOTE_URL="git@github.com:php-flasher/$REMOTE.git"
|
||||
|
||||
rm -rf $TMP_DIR;
|
||||
mkdir $TMP_DIR;
|
||||
|
||||
(
|
||||
cd $TMP_DIR;
|
||||
|
||||
git clone $REMOTE_URL .
|
||||
git checkout "$RELEASE_BRANCH";
|
||||
|
||||
git tag "$VERSION"
|
||||
git push origin --tags --force
|
||||
)
|
||||
done
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Set the "errexit" options
|
||||
set -o errexit
|
||||
|
||||
# Define colors and emoji for better visual feedback
|
||||
INDIGO='\033[0;94m'
|
||||
GREEN='\033[0;32m'
|
||||
NC='\033[0m' # No Color
|
||||
CHECK_MARK="✅"
|
||||
CROSS_MARK="❌"
|
||||
|
||||
# Initialize global flags
|
||||
DEBUG=0
|
||||
DRY_RUN=0
|
||||
|
||||
# Process command-line arguments
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--debug)
|
||||
DEBUG=1
|
||||
shift
|
||||
;;
|
||||
--dry-run)
|
||||
DRY_RUN=1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# Unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Debug message function
|
||||
debug_msg() {
|
||||
if [ "$DEBUG" -eq 1 ]; then
|
||||
echo -e "${INDIGO}Debug: $*${NC}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Define remotes
|
||||
REMOTES=(
|
||||
'src/Prime:flasher'
|
||||
'src/Laravel:flasher-laravel'
|
||||
'src/Symfony:flasher-symfony'
|
||||
|
||||
'src/Toastr/Prime:flasher-toastr'
|
||||
'src/Toastr/Laravel:flasher-toastr-laravel'
|
||||
'src/Toastr/Symfony:flasher-toastr-symfony'
|
||||
|
||||
'src/Notyf/Prime:flasher-notyf'
|
||||
'src/Notyf/Laravel:flasher-notyf-laravel'
|
||||
'src/Notyf/Symfony:flasher-notyf-symfony'
|
||||
|
||||
'src/SweetAlert/Prime:flasher-sweetalert'
|
||||
'src/SweetAlert/Laravel:flasher-sweetalert-laravel'
|
||||
'src/SweetAlert/Symfony:flasher-sweetalert-symfony'
|
||||
|
||||
'src/Pnotify/Prime:flasher-pnotify'
|
||||
'src/Pnotify/Laravel:flasher-pnotify-laravel'
|
||||
'src/Pnotify/Symfony:flasher-pnotify-symfony'
|
||||
|
||||
'src/Noty/Prime:flasher-noty'
|
||||
'src/Noty/Laravel:flasher-noty-laravel'
|
||||
'src/Noty/Symfony:flasher-noty-symfony'
|
||||
|
||||
'src/Cli/Prime:flasher-cli'
|
||||
'src/Cli/Laravel:flasher-cli-laravel'
|
||||
'src/Cli/Symfony:flasher-cli-symfony'
|
||||
|
||||
'packs/laravel-pack:laravel-pack'
|
||||
'packs/php-pack:php-pack'
|
||||
'packs/symfony-pack:symfony-pack'
|
||||
)
|
||||
|
||||
# Function to get the current git branch name
|
||||
function current_branch() {
|
||||
git rev-parse --abbrev-ref HEAD
|
||||
}
|
||||
|
||||
# Define a function to split and push code to a remote repository
|
||||
function split() {
|
||||
local prefix_and_remote="$1"
|
||||
local prefix="${prefix_and_remote%:*}"
|
||||
local remote="${prefix_and_remote#*:}"
|
||||
local current_branch=$(current_branch)
|
||||
|
||||
# Add remote if it does not exist (ignoring errors silently)
|
||||
if git remote add "$remote" "git@github.com:php-flasher/$remote.git" 2>/dev/null; then
|
||||
echo -e "${GREEN}Added remote ${INDIGO}$remote${NC} ${CHECK_MARK}"
|
||||
else
|
||||
debug_msg "Remote $remote already exists or could not be added."
|
||||
fi
|
||||
|
||||
# Split the code using the splitsh-lite utility
|
||||
SHA1=$(./bin/splitsh-lite --prefix="$prefix")
|
||||
debug_msg "SHA1 for $prefix is $SHA1."
|
||||
|
||||
# Push the code to the remote repository on the same branch as the current branch
|
||||
if [ "$DRY_RUN" -eq 0 ]; then
|
||||
git push "$remote" "$SHA1:refs/heads/$current_branch" -f
|
||||
else
|
||||
echo -e "${INDIGO}Dry run: Would push $SHA1 to $remote on branch $current_branch${NC}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Pull the latest code from the origin repository
|
||||
if [ "$DRY_RUN" -eq 0 ]; then
|
||||
echo -e "${INDIGO}Pulling the latest code from the origin repository on branch ${current_branch}...${NC}"
|
||||
git fetch origin "$current_branch"
|
||||
else
|
||||
echo -e "${INDIGO}Dry run: Would fetch latest code for branch $current_branch from the origin repository.${NC}"
|
||||
fi
|
||||
|
||||
# Iterate over the remotes and split and push the code
|
||||
for remote in "${REMOTES[@]}"; do
|
||||
split "$remote"
|
||||
done
|
||||
|
||||
echo -e "${GREEN}All done!${NC} ${CHECK_MARK}"
|
||||
Binary file not shown.
+27
-135
@@ -1,164 +1,56 @@
|
||||
{
|
||||
"name": "php-flasher/php-flasher",
|
||||
"description": "PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.",
|
||||
"license": "MIT",
|
||||
"type": "library",
|
||||
"name": "php-flasher/flasher-toastr-symfony",
|
||||
"type": "symfony-bundle",
|
||||
"description": "PHP Flasher Symfony adapter for Toastr",
|
||||
"keywords": [
|
||||
"php-flasher",
|
||||
"flash-messages",
|
||||
"notification-system",
|
||||
"user-feedback",
|
||||
"toastr",
|
||||
"sweetalert",
|
||||
"pnotify",
|
||||
"noty",
|
||||
"notyf",
|
||||
"desktop-notifications",
|
||||
"yoeunes",
|
||||
"notify",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"javascript",
|
||||
"yoeunes",
|
||||
"framework-agnostic",
|
||||
"phpstorm-auto-complete",
|
||||
"custom-adapter",
|
||||
"user-experience",
|
||||
"rtl",
|
||||
"dark-mode"
|
||||
"Lumen",
|
||||
"notifications",
|
||||
"messages",
|
||||
"alerts",
|
||||
"pnotify",
|
||||
"toastr ",
|
||||
"bundle",
|
||||
"flex"
|
||||
],
|
||||
"homepage": "https://php-flasher.github.io/",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes KHOUBZA",
|
||||
"name": "Younes Khoubza",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://www.linkedin.com/in/younes-khoubza",
|
||||
"homepage": "https://github.com/yoeunes",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-symfony": "^0.1",
|
||||
"php-flasher/flasher-toastr": "^0.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ergebnis/composer-normalize": "^2.31",
|
||||
"friendsofphp/php-cs-fixer": "^3.17",
|
||||
"illuminate/routing": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
|
||||
"illuminate/support": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
|
||||
"livewire/livewire": "^2.12.3 || ^3.0",
|
||||
"orchestra/testbench": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
|
||||
"phpro/grumphp": "^1.16",
|
||||
"phpstan/phpstan": "^1.10.16",
|
||||
"phpunit/phpunit": "^10.2.1",
|
||||
"symfony/config": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
"symfony/console": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
"symfony/dependency-injection": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
"symfony/framework-bundle": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
|
||||
"symfony/http-kernel": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
"symfony/translation": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
"symfony/twig-bundle": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
|
||||
"symplify/monorepo-builder": "^11.2.3.72",
|
||||
"vimeo/psalm": "^5.12"
|
||||
"phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0|^8.0|^9.0"
|
||||
},
|
||||
"replace": {
|
||||
"php-flasher/flasher": "self.version",
|
||||
"php-flasher/flasher-cli": "self.version",
|
||||
"php-flasher/flasher-cli-laravel": "self.version",
|
||||
"php-flasher/flasher-cli-symfony": "self.version",
|
||||
"php-flasher/flasher-laravel": "self.version",
|
||||
"php-flasher/flasher-noty": "self.version",
|
||||
"php-flasher/flasher-noty-laravel": "self.version",
|
||||
"php-flasher/flasher-noty-symfony": "self.version",
|
||||
"php-flasher/flasher-notyf": "self.version",
|
||||
"php-flasher/flasher-notyf-laravel": "self.version",
|
||||
"php-flasher/flasher-notyf-symfony": "self.version",
|
||||
"php-flasher/flasher-pnotify": "self.version",
|
||||
"php-flasher/flasher-pnotify-laravel": "self.version",
|
||||
"php-flasher/flasher-pnotify-symfony": "self.version",
|
||||
"php-flasher/flasher-sweetalert": "self.version",
|
||||
"php-flasher/flasher-sweetalert-laravel": "self.version",
|
||||
"php-flasher/flasher-sweetalert-symfony": "self.version",
|
||||
"php-flasher/flasher-symfony": "self.version",
|
||||
"php-flasher/flasher-toastr": "self.version",
|
||||
"php-flasher/flasher-toastr-laravel": "self.version",
|
||||
"php-flasher/flasher-toastr-symfony": "self.version"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\": "src/",
|
||||
"Flasher\\Cli\\Laravel\\": "src/Cli/Laravel/",
|
||||
"Flasher\\Cli\\Prime\\": "src/Cli/Prime/",
|
||||
"Flasher\\Cli\\Symfony\\": "src/Cli/Symfony/",
|
||||
"Flasher\\Laravel\\": "src/Laravel/",
|
||||
"Flasher\\Noty\\Laravel\\": "src/Noty/Laravel/",
|
||||
"Flasher\\Noty\\Prime\\": "src/Noty/Prime/",
|
||||
"Flasher\\Noty\\Symfony\\": "src/Noty/Symfony/",
|
||||
"Flasher\\Notyf\\Laravel\\": "src/Notyf/Laravel/",
|
||||
"Flasher\\Notyf\\Prime\\": "src/Notyf/Prime/",
|
||||
"Flasher\\Notyf\\Symfony\\": "src/Notyf/Symfony/",
|
||||
"Flasher\\Pnotify\\Laravel\\": "src/Pnotify/Laravel/",
|
||||
"Flasher\\Pnotify\\Prime\\": "src/Pnotify/Prime/",
|
||||
"Flasher\\Pnotify\\Symfony\\": "src/Pnotify/Symfony/",
|
||||
"Flasher\\Prime\\": "src/Prime/",
|
||||
"Flasher\\SweetAlert\\Laravel\\": "src/SweetAlert/Laravel/",
|
||||
"Flasher\\SweetAlert\\Prime\\": "src/SweetAlert/Prime/",
|
||||
"Flasher\\SweetAlert\\Symfony\\": "src/SweetAlert/Symfony/",
|
||||
"Flasher\\Symfony\\": "src/Symfony/",
|
||||
"Flasher\\Toastr\\Laravel\\": "src/Toastr/Laravel/",
|
||||
"Flasher\\Toastr\\Prime\\": "src/Toastr/Prime/",
|
||||
"Flasher\\Toastr\\Symfony\\": "src/Toastr/Symfony/"
|
||||
"Flasher\\Toastr\\Symfony\\": ""
|
||||
},
|
||||
"files": [
|
||||
"src/Cli/Prime/helpers.php",
|
||||
"src/Noty/Prime/helpers.php",
|
||||
"src/Notyf/Prime/helpers.php",
|
||||
"src/Pnotify/Prime/helpers.php",
|
||||
"src/Prime/helpers.php",
|
||||
"src/SweetAlert/Prime/helpers.php",
|
||||
"src/Toastr/Prime/helpers.php"
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flasher\\Tests\\": "tests/"
|
||||
"Flasher\\Toastr\\Symfony\\Tests\\": "Tests/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"ergebnis/composer-normalize": true,
|
||||
"kylekatarnls/update-helper": true,
|
||||
"phpro/grumphp": true
|
||||
},
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"aliases": {
|
||||
"Flasher": "Flasher\\Laravel\\Facade\\Flasher",
|
||||
"Noty": "Flasher\\Laravel\\Facade\\Flasher",
|
||||
"Notyf": "Flasher\\Notyf\\Laravel\\Facade\\Notyf",
|
||||
"Pnotify": "Flasher\\Pnotify\\Laravel\\Facade\\Pnotify",
|
||||
"SweetAlert": "Flasher\\SweetAlert\\Laravel\\Facade\\SweetAlert",
|
||||
"Toastr": "Flasher\\Toastr\\Laravel\\Facade\\Toastr"
|
||||
},
|
||||
"providers": [
|
||||
"Flasher\\Cli\\Laravel\\FlasherCliServiceProvider",
|
||||
"Flasher\\Toastr\\Laravel\\FlasherToastrServiceProvider",
|
||||
"Flasher\\Laravel\\FlasherServiceProvider",
|
||||
"Flasher\\Noty\\Laravel\\FlasherNotyServiceProvider",
|
||||
"Flasher\\Pnotify\\Laravel\\FlasherPnotifyServiceProvider",
|
||||
"Flasher\\Notyf\\Laravel\\FlasherNotyfServiceProvider",
|
||||
"Flasher\\SweetAlert\\Laravel\\FlasherSweetAlertServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"check-syntax": "test `find ./src -iname \"*.php\" | xargs -n1 -P6 php -l | grep -Fv \"No syntax errors\" | wc -l` -eq 0",
|
||||
"lint": "git diff --staged | php ./vendor/bin/grumphp run",
|
||||
"normalize-composer": "find src -name \"composer.json\" -exec composer normalize {} \\;",
|
||||
"normalize-packs": "find packs -name \"composer.json\" -exec composer normalize {} \\;",
|
||||
"validate-composer": "find src -name \"composer.json\" -exec composer validate --strict {} \\;"
|
||||
}
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"name": "php-flasher/flasher-toastr-symfony",
|
||||
"type": "symfony-bundle",
|
||||
"description": "PHP Flasher Symfony adapter for Toastr",
|
||||
"keywords": [
|
||||
"yoeunes",
|
||||
"notify",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"Lumen",
|
||||
"notifications",
|
||||
"messages",
|
||||
"alerts",
|
||||
"pnotify",
|
||||
"toastr ",
|
||||
"bundle",
|
||||
"flex"
|
||||
],
|
||||
"homepage": "https://php-flasher.github.io/",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes Khoubza",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://github.com/yoeunes",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"repositories": [
|
||||
{
|
||||
"type": "path",
|
||||
"url": "../../Symfony",
|
||||
"options": {
|
||||
"symlink": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "path",
|
||||
"url": "../Prime",
|
||||
"options": {
|
||||
"symlink": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-symfony": "@dev",
|
||||
"php-flasher/flasher-toastr": "@dev"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0|^8.0|^9.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\Toastr\\Symfony\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flasher\\Toastr\\Symfony\\Tests\\": "Tests/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true,
|
||||
"platform": {
|
||||
"php": "5.3.10"
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
grumphp:
|
||||
ascii: ~
|
||||
tasks:
|
||||
# composer: ~
|
||||
# composer_normalize: ~
|
||||
# composer_script:
|
||||
# script: check-syntax
|
||||
# phpcsfixer: ~
|
||||
# jsonlint: ~
|
||||
# yamllint: ~
|
||||
# phpstan: ~
|
||||
# phpunit: ~
|
||||
# git_branch_name:
|
||||
# blacklist:
|
||||
# - main
|
||||
git_commit_message:
|
||||
allow_empty_message: false
|
||||
enforce_capitalized_subject: false
|
||||
max_subject_width: 93
|
||||
type_scope_conventions:
|
||||
types:
|
||||
- build
|
||||
- ci
|
||||
- chore
|
||||
- docs
|
||||
- feat
|
||||
- fix
|
||||
- perf
|
||||
- refactor
|
||||
- revert
|
||||
- style
|
||||
- test
|
||||
scopes:
|
||||
- core
|
||||
- flasher
|
||||
- toastr
|
||||
- noty
|
||||
- notyf
|
||||
- pnotify
|
||||
- sweetalert
|
||||
- notify
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
use Symplify\MonorepoBuilder\Config\MBConfig;
|
||||
|
||||
return static function (MBConfig $config) {
|
||||
$config->packageDirectories(array(
|
||||
__DIR__.'/src',
|
||||
));
|
||||
|
||||
$config->packageAliasFormat('2.x-dev');
|
||||
|
||||
$config->workers(array(
|
||||
// 'Symplify\MonorepoBuilder\Release\ReleaseWorker\AddTagToChangelogReleaseWorker',
|
||||
// 'Symplify\MonorepoBuilder\Release\ReleaseWorker\PushNextDevReleaseWorker',
|
||||
// 'Symplify\MonorepoBuilder\Release\ReleaseWorker\PushTagReleaseWorker',
|
||||
// 'Symplify\MonorepoBuilder\Release\ReleaseWorker\SetCurrentMutualDependenciesReleaseWorker',
|
||||
// 'Symplify\MonorepoBuilder\Release\ReleaseWorker\TagVersionReleaseWorker',
|
||||
// 'Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateBranchAliasReleaseWorker',
|
||||
));
|
||||
};
|
||||
Generated
-2161
File diff suppressed because it is too large
Load Diff
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"commitizen": "^4.3.0",
|
||||
"cz-conventional-changelog": "^3.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"commit": "cz"
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
github: yoeunes
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: https://www.paypal.com/paypalme/yoeunes
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Auto Closer PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Hi, thank you for your contribution.
|
||||
|
||||
Unfortunately, this repository is read-only. It's a split from our main monorepo repository.
|
||||
|
||||
We'd like to kindly ask you to move the contribution there - https://github.com/php-flasher/php-flasher.
|
||||
|
||||
We'll check it, review it and give you feed back right way.
|
||||
|
||||
Thank you.
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 PHPFlasher
|
||||
|
||||
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.
|
||||
@@ -1,74 +0,0 @@
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
|
||||
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
## About PHPFlasher
|
||||
|
||||
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects.
|
||||
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
|
||||
|
||||
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page.
|
||||
This improves user engagement and enhances the overall user experience on your website or application.
|
||||
|
||||
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects.
|
||||
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io).
|
||||
|
||||
## Contributors and sponsors
|
||||
|
||||
Join our team of contributors and make a lasting impact on our project!
|
||||
|
||||
We are always looking for passionate individuals who want to contribute their skills and ideas.
|
||||
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration.
|
||||
|
||||
Shining stars of our community:
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes-khoubza/"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes KHOUBZA"/><br /><sub><b>Younes KHOUBZA</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
## Contact
|
||||
|
||||
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
|
||||
You can reach out with questions, bug reports, or feature requests on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
- [Email me directly](mailto:younes.khoubza@gmail.com)
|
||||
|
||||
## License
|
||||
|
||||
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> </b> </p>
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"name": "php-flasher/laravel-pack",
|
||||
"description": "PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.",
|
||||
"license": "MIT",
|
||||
"type": "flasher-pack",
|
||||
"keywords": [
|
||||
"php-flasher",
|
||||
"flash-messages",
|
||||
"notification-system",
|
||||
"user-feedback",
|
||||
"toastr",
|
||||
"sweetalert",
|
||||
"pnotify",
|
||||
"noty",
|
||||
"notyf",
|
||||
"desktop-notifications",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"javascript",
|
||||
"yoeunes",
|
||||
"framework-agnostic",
|
||||
"phpstorm-auto-complete",
|
||||
"custom-adapter",
|
||||
"user-experience",
|
||||
"rtl",
|
||||
"dark-mode"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes KHOUBZA",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://www.linkedin.com/in/younes-khoubza",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php-flasher/flasher-cli-laravel": "*",
|
||||
"php-flasher/flasher-noty-laravel": "*",
|
||||
"php-flasher/flasher-notyf-laravel": "*",
|
||||
"php-flasher/flasher-pnotify-laravel": "*",
|
||||
"php-flasher/flasher-sweetalert-laravel": "*",
|
||||
"php-flasher/flasher-toastr-laravel": "*"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
github: yoeunes
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: https://www.paypal.com/paypalme/yoeunes
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Auto Closer PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Hi, thank you for your contribution.
|
||||
|
||||
Unfortunately, this repository is read-only. It's a split from our main monorepo repository.
|
||||
|
||||
We'd like to kindly ask you to move the contribution there - https://github.com/php-flasher/php-flasher.
|
||||
|
||||
We'll check it, review it and give you feed back right way.
|
||||
|
||||
Thank you.
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 PHPFlasher
|
||||
|
||||
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.
|
||||
@@ -1,74 +0,0 @@
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
|
||||
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
## About PHPFlasher
|
||||
|
||||
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects.
|
||||
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
|
||||
|
||||
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page.
|
||||
This improves user engagement and enhances the overall user experience on your website or application.
|
||||
|
||||
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects.
|
||||
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io).
|
||||
|
||||
## Contributors and sponsors
|
||||
|
||||
Join our team of contributors and make a lasting impact on our project!
|
||||
|
||||
We are always looking for passionate individuals who want to contribute their skills and ideas.
|
||||
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration.
|
||||
|
||||
Shining stars of our community:
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes-khoubza/"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes KHOUBZA"/><br /><sub><b>Younes KHOUBZA</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
## Contact
|
||||
|
||||
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
|
||||
You can reach out with questions, bug reports, or feature requests on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
- [Email me directly](mailto:younes.khoubza@gmail.com)
|
||||
|
||||
## License
|
||||
|
||||
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> </b> </p>
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"name": "php-flasher/php-pack",
|
||||
"description": "PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.",
|
||||
"license": "MIT",
|
||||
"type": "flasher-pack",
|
||||
"keywords": [
|
||||
"php-flasher",
|
||||
"flash-messages",
|
||||
"notification-system",
|
||||
"user-feedback",
|
||||
"toastr",
|
||||
"sweetalert",
|
||||
"pnotify",
|
||||
"noty",
|
||||
"notyf",
|
||||
"desktop-notifications",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"javascript",
|
||||
"yoeunes",
|
||||
"framework-agnostic",
|
||||
"phpstorm-auto-complete",
|
||||
"custom-adapter",
|
||||
"user-experience",
|
||||
"rtl",
|
||||
"dark-mode"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes KHOUBZA",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://www.linkedin.com/in/younes-khoubza",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php-flasher/flasher-cli": "*",
|
||||
"php-flasher/flasher-noty": "*",
|
||||
"php-flasher/flasher-notyf": "*",
|
||||
"php-flasher/flasher-pnotify": "*",
|
||||
"php-flasher/flasher-sweetalert": "*",
|
||||
"php-flasher/flasher-toastr": "*"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
github: yoeunes
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: https://www.paypal.com/paypalme/yoeunes
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Auto Closer PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Hi, thank you for your contribution.
|
||||
|
||||
Unfortunately, this repository is read-only. It's a split from our main monorepo repository.
|
||||
|
||||
We'd like to kindly ask you to move the contribution there - https://github.com/php-flasher/php-flasher.
|
||||
|
||||
We'll check it, review it and give you feed back right way.
|
||||
|
||||
Thank you.
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 PHPFlasher
|
||||
|
||||
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.
|
||||
@@ -1,74 +0,0 @@
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
|
||||
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
## About PHPFlasher
|
||||
|
||||
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects.
|
||||
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
|
||||
|
||||
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page.
|
||||
This improves user engagement and enhances the overall user experience on your website or application.
|
||||
|
||||
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects.
|
||||
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io).
|
||||
|
||||
## Contributors and sponsors
|
||||
|
||||
Join our team of contributors and make a lasting impact on our project!
|
||||
|
||||
We are always looking for passionate individuals who want to contribute their skills and ideas.
|
||||
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration.
|
||||
|
||||
Shining stars of our community:
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes-khoubza/"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes KHOUBZA"/><br /><sub><b>Younes KHOUBZA</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
## Contact
|
||||
|
||||
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
|
||||
You can reach out with questions, bug reports, or feature requests on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
- [Email me directly](mailto:younes.khoubza@gmail.com)
|
||||
|
||||
## License
|
||||
|
||||
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> </b> </p>
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"name": "php-flasher/symfony-pack",
|
||||
"description": "PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.",
|
||||
"license": "MIT",
|
||||
"type": "flasher-pack",
|
||||
"keywords": [
|
||||
"php-flasher",
|
||||
"flash-messages",
|
||||
"notification-system",
|
||||
"user-feedback",
|
||||
"toastr",
|
||||
"sweetalert",
|
||||
"pnotify",
|
||||
"noty",
|
||||
"notyf",
|
||||
"desktop-notifications",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"javascript",
|
||||
"yoeunes",
|
||||
"framework-agnostic",
|
||||
"phpstorm-auto-complete",
|
||||
"custom-adapter",
|
||||
"user-experience",
|
||||
"rtl",
|
||||
"dark-mode"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes KHOUBZA",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://www.linkedin.com/in/younes-khoubza",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php-flasher/flasher-cli-symfony": "*",
|
||||
"php-flasher/flasher-noty-symfony": "*",
|
||||
"php-flasher/flasher-notyf-symfony": "*",
|
||||
"php-flasher/flasher-pnotify-symfony": "*",
|
||||
"php-flasher/flasher-sweetalert-symfony": "*",
|
||||
"php-flasher/flasher-toastr-symfony": "*"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
parameters:
|
||||
level: 9
|
||||
paths:
|
||||
- src
|
||||
excludePaths:
|
||||
- src/Symfony/Bridge/
|
||||
- src/Laravel/Middleware/HttpKernelFlasherMiddleware.php
|
||||
- src/Laravel/Middleware/HttpKernelSessionMiddleware.php
|
||||
- src/*/Symfony/Flasher*SymfonyBundle.php
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META;
|
||||
|
||||
override(\Illuminate\Foundation\Application::make(0), map([
|
||||
'config' => \Illuminate\Contracts\Config\Repository::class,
|
||||
'session' => \Illuminate\Session\SessionManager::class,
|
||||
'view' => \Illuminate\View\Factory::class,
|
||||
]));
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
stopOnFailure="true"
|
||||
cacheDirectory=".phpunit.cache"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="flasher">
|
||||
<directory>tests/Prime</directory>
|
||||
<directory>tests/Laravel</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<coverage/>
|
||||
<source>
|
||||
<include>
|
||||
<directory suffix=".php">src</directory>
|
||||
</include>
|
||||
</source>
|
||||
</phpunit>
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
stopOnFailure="true"
|
||||
cacheDirectory=".phpunit.cache"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="flasher">
|
||||
<directory>tests/Prime</directory>
|
||||
<directory>tests/Symfony</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<coverage/>
|
||||
<source>
|
||||
<include>
|
||||
<directory suffix=".php">src</directory>
|
||||
</include>
|
||||
</source>
|
||||
</phpunit>
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
stopOnFailure="true"
|
||||
cacheDirectory=".phpunit.cache"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="default">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<coverage/>
|
||||
<source>
|
||||
<include>
|
||||
<directory suffix=".php">src</directory>
|
||||
</include>
|
||||
</source>
|
||||
</phpunit>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
verbose="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="true">
|
||||
<testsuites>
|
||||
<testsuite name="Flasher Test Suite">
|
||||
<directory>Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">./</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<psalm
|
||||
errorLevel="4"
|
||||
resolveFromConfigFile="true"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="https://getpsalm.org/schema/config"
|
||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||
findUnusedBaselineEntry="true"
|
||||
findUnusedCode="false"
|
||||
>
|
||||
<projectFiles>
|
||||
<directory name="src/Prime" />
|
||||
<ignoreFiles>
|
||||
<directory name="vendor" />
|
||||
<file name="phpstorm/Laravel/.phpstorm.meta.php" />
|
||||
<file name="src/SweetAlert/Prime/.phpstorm.meta.php" />
|
||||
<file name="src/Notyf/Prime/.phpstorm.meta.php" />
|
||||
<file name="src/Pnotify/Prime/.phpstorm.meta.php" />
|
||||
<file name="src/Noty/Prime/.phpstorm.meta.php" />
|
||||
<file name="src/Laravel/.phpstorm.meta.php" />
|
||||
<file name="src/Toastr/Prime/.phpstorm.meta.php" />
|
||||
<file name="src/Prime/.phpstorm.meta.php" />
|
||||
<file name="src/Cli/Prime/.phpstorm.meta.php" />
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
</psalm>
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
github: yoeunes
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: https://www.paypal.com/paypalme/yoeunes
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Auto Closer PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Hi, thank you for your contribution.
|
||||
|
||||
Unfortunately, this repository is read-only. It's a split from our main monorepo repository.
|
||||
|
||||
We'd like to kindly ask you to move the contribution there - https://github.com/php-flasher/php-flasher.
|
||||
|
||||
We'll check it, review it and give you feed back right way.
|
||||
|
||||
Thank you.
|
||||
@@ -1,106 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Laravel;
|
||||
|
||||
use Flasher\Cli\Prime\CliFactory;
|
||||
use Flasher\Cli\Prime\EventListener\RenderListener;
|
||||
use Flasher\Cli\Prime\Notify;
|
||||
use Flasher\Cli\Prime\Presenter\CliPresenter;
|
||||
use Flasher\Prime\EventDispatcher\EventDispatcherInterface;
|
||||
use Flasher\Prime\FlasherInterface;
|
||||
use Flasher\Prime\Response\ResponseManagerInterface;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
final class FlasherCliServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->processConfiguration();
|
||||
$this->registerRenderListener();
|
||||
$this->registerPresenter();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->registerNotifierFactory();
|
||||
$this->registerNotifier();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function processConfiguration()
|
||||
{
|
||||
$name = 'flasher_cli';
|
||||
$config = $this->app->make('config');
|
||||
|
||||
$config->set($name, $config->get($name, array())); // @phpstan-ignore-line
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function registerNotifierFactory()
|
||||
{
|
||||
$this->app->singleton('flasher.cli', function (Container $app) {
|
||||
return new CliFactory($app->make('flasher.storage_manager')); // @phpstan-ignore-line
|
||||
});
|
||||
|
||||
$this->app->alias('flasher.cli', 'Flasher\Cli\Prime\CliFactory');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function registerNotifier()
|
||||
{
|
||||
$this->app->singleton('flasher.notify', function (Container $app) {
|
||||
/** @phpstan-ignore-next-line */
|
||||
$title = $app->make('config')->get('flasher_cli.title', null);
|
||||
$icons = $app->make('config')->get('flasher_cli.icons', array()); // @phpstan-ignore-line
|
||||
|
||||
return new Notify($title, $icons);
|
||||
});
|
||||
|
||||
$this->app->alias('flasher.notify', 'Flasher\Cli\Prime\Notify');
|
||||
$this->app->alias('flasher.notify', 'Flasher\Cli\Prime\NotifyInterface');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function registerRenderListener()
|
||||
{
|
||||
/** @var FlasherInterface $flasher */
|
||||
$flasher = $this->app->make('flasher');
|
||||
$this->app->extend('flasher.event_dispatcher', function (EventDispatcherInterface $dispatcher) use ($flasher) {
|
||||
$dispatcher->addSubscriber(new RenderListener($flasher));
|
||||
|
||||
return $dispatcher;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function registerPresenter()
|
||||
{
|
||||
$this->app->extend('flasher.response_manager', function (ResponseManagerInterface $manager, Container $app) {
|
||||
$manager->addPresenter(CliPresenter::NAME, new CliPresenter($app->make('flasher.notify'))); // @phpstan-ignore-line
|
||||
|
||||
return $manager;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 PHPFlasher
|
||||
|
||||
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.
|
||||
@@ -1,74 +0,0 @@
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
|
||||
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
## About PHPFlasher
|
||||
|
||||
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects.
|
||||
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
|
||||
|
||||
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page.
|
||||
This improves user engagement and enhances the overall user experience on your website or application.
|
||||
|
||||
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects.
|
||||
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io).
|
||||
|
||||
## Contributors and sponsors
|
||||
|
||||
Join our team of contributors and make a lasting impact on our project!
|
||||
|
||||
We are always looking for passionate individuals who want to contribute their skills and ideas.
|
||||
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration.
|
||||
|
||||
Shining stars of our community:
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes-khoubza/"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes KHOUBZA"/><br /><sub><b>Younes KHOUBZA</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
## Contact
|
||||
|
||||
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
|
||||
You can reach out with questions, bug reports, or feature requests on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
- [Email me directly](mailto:younes.khoubza@gmail.com)
|
||||
|
||||
## License
|
||||
|
||||
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> </b> </p>
|
||||
@@ -1,61 +0,0 @@
|
||||
{
|
||||
"name": "php-flasher/flasher-cli-laravel",
|
||||
"description": "PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.",
|
||||
"license": "MIT",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"php-flasher",
|
||||
"flash-messages",
|
||||
"notification-system",
|
||||
"user-feedback",
|
||||
"toastr",
|
||||
"sweetalert",
|
||||
"pnotify",
|
||||
"noty",
|
||||
"notyf",
|
||||
"desktop-notifications",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"javascript",
|
||||
"yoeunes",
|
||||
"framework-agnostic",
|
||||
"phpstorm-auto-complete",
|
||||
"custom-adapter",
|
||||
"user-experience",
|
||||
"rtl",
|
||||
"dark-mode"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes KHOUBZA",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://www.linkedin.com/in/younes-khoubza",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-cli": "^1.15.14",
|
||||
"php-flasher/flasher-laravel": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\Cli\\Laravel\\": ""
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Flasher\\Cli\\Laravel\\FlasherCliServiceProvider"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
github: yoeunes
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: https://www.paypal.com/paypalme/yoeunes
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Auto Closer PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Hi, thank you for your contribution.
|
||||
|
||||
Unfortunately, this repository is read-only. It's a split from our main monorepo repository.
|
||||
|
||||
We'd like to kindly ask you to move the contribution there - https://github.com/php-flasher/php-flasher.
|
||||
|
||||
We'll check it, review it and give you feed back right way.
|
||||
|
||||
Thank you.
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META;
|
||||
|
||||
override(\Flasher\Prime\FlasherInterface::create(), map([
|
||||
'cli' => \Flasher\Cli\Prime\CliFactory::class
|
||||
]));
|
||||
|
||||
override(\Flasher\Prime\FlasherInterface::using(), map([
|
||||
'cli' => \Flasher\Cli\Prime\CliFactory::class
|
||||
]));
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime;
|
||||
|
||||
use Flasher\Prime\Notification\NotificationBuilder;
|
||||
|
||||
final class CliBuilder extends NotificationBuilder
|
||||
{
|
||||
/**
|
||||
* @param string $title
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function title($title)
|
||||
{
|
||||
/** @var Notification $notification */
|
||||
$notification = $this->envelope->getNotification();
|
||||
$notification->setTitle($title);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $icon
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function icon($icon)
|
||||
{
|
||||
/** @var Notification $notification */
|
||||
$notification = $this->envelope->getNotification();
|
||||
$notification->setIcon($icon);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime;
|
||||
|
||||
use Flasher\Prime\Factory\NotificationFactory;
|
||||
|
||||
final class CliFactory extends NotificationFactory
|
||||
{
|
||||
public function createNotificationBuilder()
|
||||
{
|
||||
return new CliBuilder($this->getStorageManager(), new Notification(), 'cli');
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\EventListener;
|
||||
|
||||
use Flasher\Cli\Prime\Presenter\CliPresenter;
|
||||
use Flasher\Prime\EventDispatcher\Event\PostPersistEvent;
|
||||
use Flasher\Prime\EventDispatcher\EventListener\EventSubscriberInterface;
|
||||
use Flasher\Prime\FlasherInterface;
|
||||
|
||||
final class RenderListener implements EventSubscriberInterface
|
||||
{
|
||||
/**
|
||||
* @var FlasherInterface
|
||||
*/
|
||||
private $flasher;
|
||||
|
||||
public function __construct(FlasherInterface $flasher)
|
||||
{
|
||||
$this->flasher = $flasher;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function __invoke(PostPersistEvent $event)
|
||||
{
|
||||
if ('cli' !== \PHP_SAPI) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->flasher->render(array(), CliPresenter::NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return 'Flasher\Prime\EventDispatcher\Event\PostPersistEvent';
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 PHPFlasher
|
||||
|
||||
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.
|
||||
@@ -1,228 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime;
|
||||
|
||||
use Flasher\Prime\Notification\Envelope;
|
||||
use Flasher\Prime\Notification\Notification as BaseNotification;
|
||||
use Flasher\Prime\Notification\NotificationInterface;
|
||||
|
||||
final class Notification extends BaseNotification
|
||||
{
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $icon;
|
||||
|
||||
/**
|
||||
* @param string|null $message
|
||||
* @param string|null $title
|
||||
* @param string|null $icon
|
||||
* @param string $type
|
||||
* @param array<string, mixed> $options
|
||||
*/
|
||||
public function __construct($message = null, $title = null, $icon = null, $type = self::INFO, array $options = array())
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->title = $title;
|
||||
$this->icon = $icon;
|
||||
$this->type = $type;
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Notification|string $notification
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function wrap($notification)
|
||||
{
|
||||
if ($notification instanceof Notification) {
|
||||
return $notification;
|
||||
}
|
||||
|
||||
return self::create($notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param string|null $icon
|
||||
* @param string $type
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function create($message, $title = null, $icon = null, $type = self::INFO, array $options = array())
|
||||
{
|
||||
return new self($message, $title, $icon, $type, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param string|null $icon
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function error($message, $title = null, $icon = null, array $options = array())
|
||||
{
|
||||
return self::create($message, $title, $icon, NotificationInterface::ERROR, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param string|null $icon
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function info($message, $title = null, $icon = null, array $options = array())
|
||||
{
|
||||
return self::create($message, $title, $icon, NotificationInterface::INFO, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param string|null $icon
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function success($message, $title = null, $icon = null, array $options = array())
|
||||
{
|
||||
return self::create($message, $title, $icon, NotificationInterface::SUCCESS, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param string|null $icon
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function warning($message, $title = null, $icon = null, array $options = array())
|
||||
{
|
||||
return self::create($message, $title, $icon, NotificationInterface::WARNING, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
$message = parent::getMessage();
|
||||
|
||||
if (\is_string($message)) {
|
||||
$message = addslashes($message);
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getOption($name, $default = null)
|
||||
{
|
||||
$option = parent::getOption($name, $default);
|
||||
|
||||
if (\is_string($option)) {
|
||||
$option = addslashes($option);
|
||||
}
|
||||
|
||||
return $option;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
$title = $this->title;
|
||||
|
||||
if (\is_string($title)) {
|
||||
$title = addslashes($title);
|
||||
}
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $title
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getIcon()
|
||||
{
|
||||
return $this->icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $icon
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function setIcon($icon)
|
||||
{
|
||||
$this->icon = $icon;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return array_merge(parent::toArray(), array(
|
||||
'title' => $this->getTitle(),
|
||||
'icon' => $this->getIcon(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return static
|
||||
*/
|
||||
public static function fromEnvelope(Envelope $envelope)
|
||||
{
|
||||
$self = new self();
|
||||
|
||||
$self->setType($envelope->getType());
|
||||
$self->setMessage($envelope->getMessage());
|
||||
$self->setOptions($envelope->getOptions());
|
||||
|
||||
$notification = $envelope->getNotification();
|
||||
if (!$notification instanceof self) {
|
||||
return $self;
|
||||
}
|
||||
|
||||
$self->setTitle($notification->getTitle());
|
||||
$self->setIcon($notification->getIcon());
|
||||
|
||||
return $self;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
|
||||
final class AppleScriptBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addArgument(sprintf('display notification "%s"', $notification->getMessage()))
|
||||
->addArgument(sprintf('with title "%s"', $notification->getTitle()));
|
||||
|
||||
/** @var string $subtitle */
|
||||
$subtitle = $notification->getOption('subtitle');
|
||||
if ($subtitle) {
|
||||
$cmd->addArgument(sprintf('subtitle "%s"', $subtitle));
|
||||
}
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
if (!$this->getProgram()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return OS::isMacOS() && version_compare(OS::getMacOSVersion(), '10.9.0', '>=');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'osascript';
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\NotifyInterface;
|
||||
use Flasher\Cli\Prime\System\Path;
|
||||
use Flasher\Cli\Prime\System\Program;
|
||||
use Flasher\Prime\Notification\NotificationInterface;
|
||||
|
||||
abstract class BaseNotifier implements NotifyInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getPriority()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|string[]
|
||||
*/
|
||||
public function getBinaryPaths()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getProgram()
|
||||
{
|
||||
if (Program::exist($this->getBinary())) {
|
||||
return $this->getBinary();
|
||||
}
|
||||
|
||||
foreach ((array) $this->getBinaryPaths() as $path) {
|
||||
$path = Path::realpath($path);
|
||||
|
||||
if (file_exists($path)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function success($message, $title = null, $options = array())
|
||||
{
|
||||
$this->type(NotificationInterface::SUCCESS, $message, $title, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function info($message, $title = null, $options = array())
|
||||
{
|
||||
$this->type(NotificationInterface::INFO, $message, $title, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function error($message, $title = null, $options = array())
|
||||
{
|
||||
$this->type(NotificationInterface::ERROR, $message, $title, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function warning($message, $title = null, $options = array())
|
||||
{
|
||||
$this->type(NotificationInterface::WARNING, $message, $title, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function type($type, $message, $title = null, $options = array())
|
||||
{
|
||||
$notification = new Notification($message, $title, null, $type, $options);
|
||||
|
||||
$this->send($notification);
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
|
||||
final class GrowlNotifyBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addOption('--message', $notification->getMessage())
|
||||
->addOption('--title', $notification->getTitle())
|
||||
->addOption('--image', $notification->getIcon());
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return OS::isMacOS() && $this->getProgram();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'growlnotify';
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
|
||||
final class KDialogBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addOption('--passivepopup', $notification->getMessage())
|
||||
->addOption('--title', $notification->getTitle())
|
||||
->addArgument(5);
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return OS::isUnix() && $this->getProgram();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'kdialog';
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
use Flasher\Cli\Prime\System\Path;
|
||||
|
||||
final class NotifuBaseNotifier extends BaseNotifier
|
||||
{
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addOption('/m', $notification->getMessage())
|
||||
->addOption('/p', $notification->getTitle())
|
||||
->addOption('/i', $notification->getIcon());
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return OS::isWindowsSeven() && $this->getProgram();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'notifu';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinaryPaths()
|
||||
{
|
||||
return Path::realpath(__DIR__.'/../Resources/bin/notifu/notifu.exe');
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
|
||||
final class NotifySendBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addOption('--urgency', 'normal')
|
||||
->addOption('--app-name', 'notify')
|
||||
->addOption('--icon', $notification->getIcon())
|
||||
->addOption('--expire-time', 1)
|
||||
->addArgument($notification->getTitle())
|
||||
->addArgument($notification->getMessage());
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return OS::isUnix() && $this->getProgram();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'notify-send';
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
final class NullBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
use Flasher\Cli\Prime\System\Path;
|
||||
|
||||
final class SnoreToastBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addOption('-m', $notification->getMessage())
|
||||
->addOption('-t', $notification->getTitle())
|
||||
->addOption('-p', $notification->getIcon());
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
if (!$this->getProgram()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return OS::isWindowsEightOrHigher() || OS::isWindowsSubsystemForLinux();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'snoretoast';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinaryPaths()
|
||||
{
|
||||
return Path::realpath(__DIR__.'/../Resources/bin/snoreToast/snoretoast-x86.exe');
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
|
||||
final class TerminalNotifierBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addOption('-message', $notification->getMessage())
|
||||
->addOption('-title', $notification->getTitle());
|
||||
|
||||
if (version_compare(OS::getMacOSVersion(), '10.9.0', '>=')) {
|
||||
$cmd->addOption('-appIcon', $notification->getIcon());
|
||||
}
|
||||
|
||||
/** @var string|null $url */
|
||||
$url = $notification->getOption('url');
|
||||
if ($url) {
|
||||
$cmd->addOption('-open', $url);
|
||||
}
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return OS::isMacOS() && $this->getProgram();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'terminal-notifier';
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
use Flasher\Cli\Prime\System\Path;
|
||||
|
||||
final class ToasterBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addOption('-t', $notification->getTitle())
|
||||
->addOption('-m', $notification->getMessage())
|
||||
->addOption('-p', $notification->getIcon())
|
||||
->addArgument('-w');
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
if (!$this->getProgram()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return OS::isWindowsEightOrHigher() || OS::isWindowsSubsystemForLinux();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'toast';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinaryPaths()
|
||||
{
|
||||
return Path::realpath(__DIR__.'/../Resources/bin/toaster/toast.exe');
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Notifier;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\System\Command;
|
||||
use Flasher\Cli\Prime\System\OS;
|
||||
|
||||
final class ZenityBaseNotifier extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
$cmd = new Command($this->getProgram());
|
||||
|
||||
$cmd
|
||||
->addArgument('--notification')
|
||||
->addOption('--text', $notification->getTitle().'\n\n'.$notification->getMessage())
|
||||
->addOption('--window-icon', $notification->getIcon());
|
||||
|
||||
$cmd->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return OS::isUnix() && $this->getProgram();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBinary()
|
||||
{
|
||||
return 'zenity';
|
||||
}
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime;
|
||||
|
||||
use Flasher\Cli\Prime\Notifier\BaseNotifier;
|
||||
use Flasher\Cli\Prime\System\Path;
|
||||
use Flasher\Prime\Notification\NotificationInterface;
|
||||
|
||||
final class Notify extends BaseNotifier
|
||||
{
|
||||
/**
|
||||
* @var NotifyInterface|null
|
||||
*/
|
||||
private $notifier;
|
||||
|
||||
/**
|
||||
* @var NotifyInterface[]
|
||||
*/
|
||||
private $notifiers = array();
|
||||
|
||||
/**
|
||||
* @var NotifyInterface[]
|
||||
*/
|
||||
private $sorted = array();
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private $isSupported;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @var array{success?: string, error?: string, info?: string, warning?: string}
|
||||
*/
|
||||
private $icons = array();
|
||||
|
||||
/**
|
||||
* @param string|null $title
|
||||
* @param array{success?: string, error?: string, info?: string, warning?: string}|string $icons
|
||||
*/
|
||||
public function __construct($title = 'PHPFlasher', $icons = array())
|
||||
{
|
||||
$this->title = $title;
|
||||
$this->icons = $this->configureIcons($icons);
|
||||
|
||||
$this->addNotifier(new Notifier\NotifySendBaseNotifier());
|
||||
$this->addNotifier(new Notifier\AppleScriptBaseNotifier());
|
||||
$this->addNotifier(new Notifier\GrowlNotifyBaseNotifier());
|
||||
$this->addNotifier(new Notifier\KDialogBaseNotifier());
|
||||
$this->addNotifier(new Notifier\NotifuBaseNotifier());
|
||||
$this->addNotifier(new Notifier\SnoreToastBaseNotifier());
|
||||
$this->addNotifier(new Notifier\TerminalNotifierBaseNotifier());
|
||||
$this->addNotifier(new Notifier\ToasterBaseNotifier());
|
||||
$this->addNotifier(new Notifier\ZenityBaseNotifier());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $title
|
||||
* @param array{success?: string, error?: string, info?: string, warning?: string}|string $icons
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function create($title = null, $icons = array())
|
||||
{
|
||||
return new self($title, $icons);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function send($notification)
|
||||
{
|
||||
$notification = $this->configureNotification($notification);
|
||||
|
||||
$notifier = $this->createNotifier();
|
||||
$notifier->send($notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function addNotifier(NotifyInterface $notifier)
|
||||
{
|
||||
$this->notifiers[] = $notifier;
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getPriority()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
if (null !== $this->isSupported) {
|
||||
return $this->isSupported;
|
||||
}
|
||||
|
||||
if ($this->notifier instanceof NotifyInterface) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($this->getNotifiers() as $notifier) {
|
||||
if ($notifier->isSupported()) {
|
||||
return $this->isSupported = true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function reset()
|
||||
{
|
||||
$this->notifier = null;
|
||||
$this->sorted = array();
|
||||
$this->isSupported = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NotifyInterface[]
|
||||
*/
|
||||
private function getNotifiers()
|
||||
{
|
||||
if (array() !== $this->sorted) {
|
||||
return $this->sorted;
|
||||
}
|
||||
|
||||
$this->sorted = $this->notifiers;
|
||||
|
||||
usort($this->sorted, static function (NotifyInterface $a, NotifyInterface $b) {
|
||||
$priorityA = $a->getPriority();
|
||||
$priorityB = $b->getPriority();
|
||||
|
||||
if ($priorityA === $priorityB) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $priorityA < $priorityB ? 1 : -1;
|
||||
});
|
||||
|
||||
return $this->sorted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NotifyInterface
|
||||
*/
|
||||
private function createNotifier()
|
||||
{
|
||||
if ($this->notifier instanceof NotifyInterface) {
|
||||
return $this->notifier;
|
||||
}
|
||||
|
||||
foreach ($this->getNotifiers() as $notifier) {
|
||||
if ($notifier->isSupported()) {
|
||||
return $this->notifier = $notifier;
|
||||
}
|
||||
}
|
||||
|
||||
return new Notifier\NullBaseNotifier();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{success?: string, error?: string, info?: string, warning?: string}|string $icons
|
||||
*
|
||||
* @return array<'default'|'error'|'info'|'success'|'warning', string>
|
||||
*/
|
||||
private function configureIcons($icons = array())
|
||||
{
|
||||
$icons = $icons ?: array();
|
||||
|
||||
if (!\is_array($icons)) {
|
||||
$icons = array(
|
||||
NotificationInterface::SUCCESS => $icons,
|
||||
NotificationInterface::ERROR => $icons,
|
||||
NotificationInterface::INFO => $icons,
|
||||
NotificationInterface::WARNING => $icons,
|
||||
'default' => $icons,
|
||||
);
|
||||
}
|
||||
|
||||
return array_merge(array(
|
||||
NotificationInterface::SUCCESS => Path::realpath(__DIR__.'/Resources/icons/success.png'),
|
||||
NotificationInterface::ERROR => Path::realpath(__DIR__.'/Resources/icons/error.png'),
|
||||
NotificationInterface::INFO => Path::realpath(__DIR__.'/Resources/icons/info.png'),
|
||||
NotificationInterface::WARNING => Path::realpath(__DIR__.'/Resources/icons/warning.png'),
|
||||
'default' => Path::realpath(__DIR__.'/Resources/icons/info.png'),
|
||||
), $icons);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Notification|string $notification
|
||||
*
|
||||
* @return Notification
|
||||
*/
|
||||
private function configureNotification($notification)
|
||||
{
|
||||
$notification = Notification::wrap($notification);
|
||||
|
||||
if (null === $notification->getTitle()) {
|
||||
$notification->setTitle($this->title);
|
||||
}
|
||||
|
||||
if (null === $notification->getIcon() && isset($this->icons[$notification->getType()])) {
|
||||
$notification->setIcon($this->icons[$notification->getType()]);
|
||||
}
|
||||
|
||||
if (null === $notification->getIcon()) {
|
||||
$notification->setIcon($this->icons['default']); // @phpstan-ignore-line
|
||||
}
|
||||
|
||||
return $notification;
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime;
|
||||
|
||||
interface NotifyInterface
|
||||
{
|
||||
/**
|
||||
* @param Notification|string $notification
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function send($notification);
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPriority();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSupported();
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function type($type, $message, $title = null, $options = array());
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function warning($message, $title = null, $options = array());
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function info($message, $title = null, $options = array());
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function error($message, $title = null, $options = array());
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $title
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function success($message, $title = null, $options = array());
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\Presenter;
|
||||
|
||||
use Flasher\Cli\Prime\Notification;
|
||||
use Flasher\Cli\Prime\Notify;
|
||||
use Flasher\Cli\Prime\NotifyInterface;
|
||||
use Flasher\Prime\Response\Presenter\PresenterInterface;
|
||||
use Flasher\Prime\Response\Response;
|
||||
|
||||
final class CliPresenter implements PresenterInterface
|
||||
{
|
||||
const NAME = 'cli';
|
||||
|
||||
/**
|
||||
* @var NotifyInterface
|
||||
*/
|
||||
private $notifier;
|
||||
|
||||
public function __construct(NotifyInterface $notifier = null)
|
||||
{
|
||||
$this->notifier = $notifier ?: new Notify();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render(Response $response)
|
||||
{
|
||||
if ('cli' !== \PHP_SAPI || array() === $response->getEnvelopes()) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($response->getEnvelopes() as $envelope) {
|
||||
$notification = Notification::fromEnvelope($envelope);
|
||||
$this->notifier->send($notification);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
|
||||
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
## About PHPFlasher
|
||||
|
||||
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects.
|
||||
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
|
||||
|
||||
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page.
|
||||
This improves user engagement and enhances the overall user experience on your website or application.
|
||||
|
||||
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects.
|
||||
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io).
|
||||
|
||||
## Contributors and sponsors
|
||||
|
||||
Join our team of contributors and make a lasting impact on our project!
|
||||
|
||||
We are always looking for passionate individuals who want to contribute their skills and ideas.
|
||||
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration.
|
||||
|
||||
Shining stars of our community:
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes-khoubza/"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes KHOUBZA"/><br /><sub><b>Younes KHOUBZA</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
## Contact
|
||||
|
||||
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
|
||||
You can reach out with questions, bug reports, or feature requests on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
- [Email me directly](mailto:younes.khoubza@gmail.com)
|
||||
|
||||
## License
|
||||
|
||||
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> </b> </p>
|
||||
@@ -1,7 +0,0 @@
|
||||
# Notifu
|
||||
|
||||
This binary come from the [Notifu](http://www.paralint.com/projects/notifu)
|
||||
project. All credits for this Windows tool goes to their original authors.
|
||||
|
||||
Only the required file was extracted here. If you want to fully test it, please
|
||||
have a look at [this url](http://www.paralint.com/projects/notifu) instead.
|
||||
@@ -1,166 +0,0 @@
|
||||
// Retrieved from https://github.com/KDE/snoretoast/blob/master/COPYING.LGPL-3 version 0.7.0
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
@@ -1,7 +0,0 @@
|
||||
# SnoreToast
|
||||
|
||||
These toaster binary files come from the [KDE/snoretoast](https://github.com/KDE/snoretoast)
|
||||
project. All credits for this Windows 8* application goes to [KDE project](https://github.com/KDE).
|
||||
|
||||
Only the required files were extracted here. If you want to fully test it,
|
||||
please have a look at the github project instead.
|
||||
@@ -1,7 +0,0 @@
|
||||
# Toaster
|
||||
|
||||
These toaster binary files come from the [nels-o/toaster](https://github.com/nels-o/toaster)
|
||||
project. All credits for this Windows 8 application goes to [nels-o](https://github.com/nels-o).
|
||||
|
||||
Only the required files were extracted here. If you want to fully test it,
|
||||
please have a look at the github project instead.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB |
@@ -1,100 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\System;
|
||||
|
||||
final class Command
|
||||
{
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $command;
|
||||
|
||||
/**
|
||||
* @var array<string, int|string|null>
|
||||
*/
|
||||
private $options = array();
|
||||
|
||||
/**
|
||||
* @var array<int|string|null>
|
||||
*/
|
||||
private $arguments = array();
|
||||
|
||||
/**
|
||||
* @param string|null $command
|
||||
*/
|
||||
public function __construct($command)
|
||||
{
|
||||
$this->command = null !== $command ? escapeshellcmd((string) $command) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param int|string|null $value
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function addOption($name, $value = null)
|
||||
{
|
||||
$this->options[$name] = null !== $value ? escapeshellarg((string) $value) : null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|string|null $argument
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function addArgument($argument)
|
||||
{
|
||||
$this->arguments[] = null !== $argument ? escapeshellarg((string) $argument) : $argument;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$command = $this->command.' '.$this->formatOptions().' '.$this->formatArguments();
|
||||
|
||||
if (OS::isWindows()) {
|
||||
pclose(popen('start /B '.$command, 'r')); // @phpstan-ignore-line
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
exec($command);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function formatArguments()
|
||||
{
|
||||
return implode(' ', $this->arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function formatOptions()
|
||||
{
|
||||
$line = '';
|
||||
|
||||
foreach ($this->options as $name => $value) {
|
||||
$line .= $name;
|
||||
if ($value) {
|
||||
$line .= ' '.$value.' ';
|
||||
}
|
||||
}
|
||||
|
||||
return $line;
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\System;
|
||||
|
||||
final class OS
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return php_uname('s');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getRelease()
|
||||
{
|
||||
return php_uname('r');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function isUnix()
|
||||
{
|
||||
return \in_array(self::getName(), array(
|
||||
'Linux',
|
||||
'FreeBSD',
|
||||
'NetBSD',
|
||||
'OpenBSD',
|
||||
'SunOS',
|
||||
'DragonFly',
|
||||
), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function isWindows()
|
||||
{
|
||||
return 'WIN' === strtoupper(substr(self::getName(), 0, 3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function isWindowsSeven()
|
||||
{
|
||||
return self::isWindows() && '6.1' === self::getRelease();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function isWindowsEightOrHigher()
|
||||
{
|
||||
return self::isWindows() && version_compare(self::getRelease(), '6.2', '>=');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function isWindowsSubsystemForLinux()
|
||||
{
|
||||
return self::isUnix() && false !== mb_strpos(strtolower(self::getName()), 'microsoft');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function isMacOS()
|
||||
{
|
||||
return false !== strpos(self::getName(), 'Darwin');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getMacOSVersion()
|
||||
{
|
||||
exec('sw_vers -productVersion', $output);
|
||||
|
||||
$output = (array) $output;
|
||||
|
||||
return trim(reset($output));
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\System;
|
||||
|
||||
final class Path
|
||||
{
|
||||
/**
|
||||
* @param string $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function realpath($path)
|
||||
{
|
||||
return (string) realpath(str_replace(array('/', '\\'), \DIRECTORY_SEPARATOR, $path));
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Cli\Prime\System;
|
||||
|
||||
final class Program
|
||||
{
|
||||
/**
|
||||
* @param string|null $program
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function exist($program)
|
||||
{
|
||||
if (null === $program) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (OS::isWindows()) {
|
||||
$output = shell_exec("where {$program} 2>null");
|
||||
|
||||
return !empty($output);
|
||||
}
|
||||
|
||||
$output = shell_exec("command -v {$program}");
|
||||
|
||||
return !empty($output);
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
{
|
||||
"name": "php-flasher/flasher-cli",
|
||||
"description": "PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.",
|
||||
"license": "MIT",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"php-flasher",
|
||||
"flash-messages",
|
||||
"notification-system",
|
||||
"user-feedback",
|
||||
"toastr",
|
||||
"sweetalert",
|
||||
"pnotify",
|
||||
"noty",
|
||||
"notyf",
|
||||
"desktop-notifications",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"javascript",
|
||||
"yoeunes",
|
||||
"framework-agnostic",
|
||||
"phpstorm-auto-complete",
|
||||
"custom-adapter",
|
||||
"user-experience",
|
||||
"rtl",
|
||||
"dark-mode"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes KHOUBZA",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://www.linkedin.com/in/younes-khoubza",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"homepage": "https://php-flasher.io",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"ext-mbstring": "*",
|
||||
"php-flasher/flasher": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\Cli\\Prime\\": ""
|
||||
},
|
||||
"files": [
|
||||
"helpers.php"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
use Flasher\Prime\Container\FlasherContainer;
|
||||
|
||||
if (!function_exists('notify')) {
|
||||
/**
|
||||
* @param Flasher\Cli\Prime\Notification|string|null $notification
|
||||
*
|
||||
* @return Flasher\Cli\Prime\Notify
|
||||
*/
|
||||
function notify($notification = null)
|
||||
{
|
||||
/** @var Flasher\Cli\Prime\Notify $notifier */
|
||||
$notifier = FlasherContainer::create('flasher.notify');
|
||||
|
||||
if (null === $notification || 0 === func_num_args()) {
|
||||
return $notifier;
|
||||
}
|
||||
|
||||
$notifier->send($notification);
|
||||
|
||||
return $notifier;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user