From 76f4695b9b33f6c63f5b98615aa0a59a2d287a0e Mon Sep 17 00:00:00 2001 From: PopNatanael Date: Fri, 12 Apr 2024 13:49:55 +0300 Subject: [PATCH 1/7] Added documentation for v3 --- .github/workflows/docs-build.yml | 16 ++++++ docs/book/index.md | 1 + docs/book/v3/installation.md | 7 +++ docs/book/v3/overview.md | 3 ++ docs/book/v3/usage.md | 84 ++++++++++++++++++++++++++++++++ mkdocs.yml | 18 +++++++ 6 files changed, 129 insertions(+) create mode 100644 .github/workflows/docs-build.yml create mode 100644 docs/book/index.md create mode 100644 docs/book/v3/installation.md create mode 100644 docs/book/v3/overview.md create mode 100644 docs/book/v3/usage.md create mode 100644 mkdocs.yml diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml new file mode 100644 index 0000000..a18edb1 --- /dev/null +++ b/.github/workflows/docs-build.yml @@ -0,0 +1,16 @@ +name: docs-build + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build-deploy: + runs-on: ubuntu-latest + steps: + - name: Build Docs + uses: dotkernel/documentation-theme/github-actions/docs@main + env: + DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/book/index.md b/docs/book/index.md new file mode 100644 index 0000000..4c0539a --- /dev/null +++ b/docs/book/index.md @@ -0,0 +1 @@ +../../README.md diff --git a/docs/book/v3/installation.md b/docs/book/v3/installation.md new file mode 100644 index 0000000..bd1b937 --- /dev/null +++ b/docs/book/v3/installation.md @@ -0,0 +1,7 @@ +# Installation + +Install dotkernel/dot-user-agent-sniffer by executing the following Composer command in your project directory: + + composer require dotkernel/dot-user-agent-sniffer + +Before adding this library as a dependency to your service, you need to add `Dot\UserAgentSniffer\ConfigProvider::class,` to your application's `config/config.php` file. diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md new file mode 100644 index 0000000..42c8584 --- /dev/null +++ b/docs/book/v3/overview.md @@ -0,0 +1,3 @@ +# Overview + +`dot-user-agent-sniffer` is DotKernel's component based on device-detector, providing details about a device by parsing a user agent. diff --git a/docs/book/v3/usage.md b/docs/book/v3/usage.md new file mode 100644 index 0000000..03e5653 --- /dev/null +++ b/docs/book/v3/usage.md @@ -0,0 +1,84 @@ +# Usage + + deviceService = $deviceService; + } + + /** + * @param string $userAgent + * @return DeviceData + */ + public function myMethod(string $userAgent) + { + return $this->deviceService->getDetails($userAgent); + } + } + +When called with an `$userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/78.0.3904.84 Mobile/15E148 Safari/604.1'`, `myMethod($userAgent)` returns an object with the following structure: + + Dot\UserAgentSniffer\Data\DeviceData::__set_state(array( + 'type' => 'smartphone', + 'brand' => 'Apple', + 'model' => 'iPhone', + 'isBot' => false, + 'isMobile' => true, + 'os' => + Dot\UserAgentSniffer\Data\OsData::__set_state(array( + 'name' => 'iOS', + 'version' => '13.2', + 'platform' => '', + )), + 'client' => + Dot\UserAgentSniffer\Data\ClientData::__set_state(array( + 'type' => 'browser', + 'name' => 'Chrome Mobile iOS', + 'engine' => 'WebKit', + 'version' => '78.0', + )), + )) + +The above call can also be chained as `myMethod($userAgent)->getArrayCopy()`, to retrieve the details as an array: + + array ( + 'type' => 'smartphone', + 'brand' => 'Apple', + 'model' => 'iPhone', + 'isMobile' => true, + 'isBot' => false, + 'os' => + array ( + 'name' => 'iOS', + 'version' => '13.2', + 'platform' => '', + ), + 'client' => + array ( + 'type' => 'browser', + 'name' => 'Chrome Mobile iOS', + 'engine' => 'WebKit', + 'version' => '78.0', + ), + ) diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..6615196 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,18 @@ +docs_dir: docs/book +site_dir: docs/html +extra: + project: Packages + current_version: v3 + versions: + - v3 +nav: + - Home: index.md + - v3: + - Overview: v3/overview.md + - Installation: v3/installation.md + - Usage: v3/usage.md +site_name: dot-annotated-services +site_description: "DotKernel's component based on device-detector, providing details about a device by parsing a user agent." +repo_url: "https://github.com/dotkernel/dot-user-agent-sniffer" +plugins: + - search From 082b39b97c0139137c01433888cebee16d98b549 Mon Sep 17 00:00:00 2001 From: PopNatanael Date: Mon, 15 Apr 2024 13:00:02 +0300 Subject: [PATCH 2/7] Indent fixes and workflow changes --- .github/workflows/continuous-integration.yml | 11 ++ .github/workflows/cs-tests.yml | 47 ------ .github/workflows/static-analysis.yml | 47 ------ .github/workflows/unit-tests.yml | 47 ------ docs/book/index.md | 2 +- docs/book/v3/installation.md | 14 +- docs/book/v3/overview.md | 6 +- docs/book/v3/usage.md | 168 +++++++++---------- mkdocs.yml | 2 +- 9 files changed, 107 insertions(+), 237 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 .github/workflows/cs-tests.yml delete mode 100644 .github/workflows/static-analysis.yml delete mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..72dde2f --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,11 @@ +name: "Continuous Integration" + +on: + pull_request: + push: + branches: + tags: + +jobs: + ci: + uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x diff --git a/.github/workflows/cs-tests.yml b/.github/workflows/cs-tests.yml deleted file mode 100644 index e8bbade..0000000 --- a/.github/workflows/cs-tests.yml +++ /dev/null @@ -1,47 +0,0 @@ -on: - - push - -name: Run phpcs checks - -jobs: - mutation: - name: PHP ${{ matrix.php }}-${{ matrix.os }} - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: - - ubuntu-latest - - php: - - "8.1" - - "8.2" - - "8.3" - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "${{ matrix.php }}" - tools: composer:v2, cs2pr - coverage: none - - - name: Determine composer cache directory - run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - - - name: Cache dependencies installed with composer - uses: actions/cache@v3 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: | - php${{ matrix.php }}-composer- - - name: Install dependencies with composer - run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - - name: Run phpcs checks - run: vendor/bin/phpcs diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index b592a19..0000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,47 +0,0 @@ -on: - - push - -name: Run static analysis - -jobs: - mutation: - name: PHP ${{ matrix.php }}-${{ matrix.os }} - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: - - ubuntu-latest - - php: - - "8.1" - - "8.2" - - "8.3" - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "${{ matrix.php }}" - tools: composer:v2, cs2pr - coverage: none - - - name: Determine composer cache directory - run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - - - name: Cache dependencies installed with composer - uses: actions/cache@v3 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: | - php${{ matrix.php }}-composer- - - name: Install dependencies with composer - run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - - name: Run static analysis - run: vendor/bin/psalm --no-cache --output-format=github --show-info=false --threads=4 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index 8f6f990..0000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,47 +0,0 @@ -on: - - push - -name: Run PHPUnit tests - -jobs: - mutation: - name: PHP ${{ matrix.php }}-${{ matrix.os }} - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: - - ubuntu-latest - - php: - - "8.1" - - "8.2" - - "8.3" - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "${{ matrix.php }}" - tools: composer:v2, cs2pr - coverage: none - - - name: Determine composer cache directory - run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - - - name: Cache dependencies installed with composer - uses: actions/cache@v3 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: | - php${{ matrix.php }}-composer- - - name: Install dependencies with composer - run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - - name: Run PHPUnit tests - run: vendor/bin/phpunit --colors=always diff --git a/docs/book/index.md b/docs/book/index.md index 4c0539a..ae42a26 100644 --- a/docs/book/index.md +++ b/docs/book/index.md @@ -1 +1 @@ -../../README.md +../../README.md diff --git a/docs/book/v3/installation.md b/docs/book/v3/installation.md index bd1b937..2746213 100644 --- a/docs/book/v3/installation.md +++ b/docs/book/v3/installation.md @@ -1,7 +1,7 @@ -# Installation - -Install dotkernel/dot-user-agent-sniffer by executing the following Composer command in your project directory: - - composer require dotkernel/dot-user-agent-sniffer - -Before adding this library as a dependency to your service, you need to add `Dot\UserAgentSniffer\ConfigProvider::class,` to your application's `config/config.php` file. +# Installation + +Install dotkernel/dot-user-agent-sniffer by executing the following Composer command in your project directory: + + composer require dotkernel/dot-user-agent-sniffer + +Before adding this library as a dependency to your service, you need to add `Dot\UserAgentSniffer\ConfigProvider::class,` to your application's `config/config.php` file. diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index 42c8584..495f8ac 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -1,3 +1,3 @@ -# Overview - -`dot-user-agent-sniffer` is DotKernel's component based on device-detector, providing details about a device by parsing a user agent. +# Overview + +`dot-user-agent-sniffer` is DotKernel's component based on device-detector, providing details about a device by parsing a user agent. diff --git a/docs/book/v3/usage.md b/docs/book/v3/usage.md index 03e5653..901753a 100644 --- a/docs/book/v3/usage.md +++ b/docs/book/v3/usage.md @@ -1,84 +1,84 @@ -# Usage - - deviceService = $deviceService; - } - - /** - * @param string $userAgent - * @return DeviceData - */ - public function myMethod(string $userAgent) - { - return $this->deviceService->getDetails($userAgent); - } - } - -When called with an `$userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/78.0.3904.84 Mobile/15E148 Safari/604.1'`, `myMethod($userAgent)` returns an object with the following structure: - - Dot\UserAgentSniffer\Data\DeviceData::__set_state(array( - 'type' => 'smartphone', - 'brand' => 'Apple', - 'model' => 'iPhone', - 'isBot' => false, - 'isMobile' => true, - 'os' => - Dot\UserAgentSniffer\Data\OsData::__set_state(array( - 'name' => 'iOS', - 'version' => '13.2', - 'platform' => '', - )), - 'client' => - Dot\UserAgentSniffer\Data\ClientData::__set_state(array( - 'type' => 'browser', - 'name' => 'Chrome Mobile iOS', - 'engine' => 'WebKit', - 'version' => '78.0', - )), - )) - -The above call can also be chained as `myMethod($userAgent)->getArrayCopy()`, to retrieve the details as an array: - - array ( - 'type' => 'smartphone', - 'brand' => 'Apple', - 'model' => 'iPhone', - 'isMobile' => true, - 'isBot' => false, - 'os' => - array ( - 'name' => 'iOS', - 'version' => '13.2', - 'platform' => '', - ), - 'client' => - array ( - 'type' => 'browser', - 'name' => 'Chrome Mobile iOS', - 'engine' => 'WebKit', - 'version' => '78.0', - ), - ) +# Usage + + deviceService = $deviceService; + } + + /** + * @param string $userAgent + * @return DeviceData + */ + public function myMethod(string $userAgent) + { + return $this->deviceService->getDetails($userAgent); + } + } + +When called with an `$userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/78.0.3904.84 Mobile/15E148 Safari/604.1'`, `myMethod($userAgent)` returns an object with the following structure: + + Dot\UserAgentSniffer\Data\DeviceData::__set_state(array( + 'type' => 'smartphone', + 'brand' => 'Apple', + 'model' => 'iPhone', + 'isBot' => false, + 'isMobile' => true, + 'os' => + Dot\UserAgentSniffer\Data\OsData::__set_state(array( + 'name' => 'iOS', + 'version' => '13.2', + 'platform' => '', + )), + 'client' => + Dot\UserAgentSniffer\Data\ClientData::__set_state(array( + 'type' => 'browser', + 'name' => 'Chrome Mobile iOS', + 'engine' => 'WebKit', + 'version' => '78.0', + )), + )) + +The above call can also be chained as `myMethod($userAgent)->getArrayCopy()`, to retrieve the details as an array: + + array ( + 'type' => 'smartphone', + 'brand' => 'Apple', + 'model' => 'iPhone', + 'isMobile' => true, + 'isBot' => false, + 'os' => + array ( + 'name' => 'iOS', + 'version' => '13.2', + 'platform' => '', + ), + 'client' => + array ( + 'type' => 'browser', + 'name' => 'Chrome Mobile iOS', + 'engine' => 'WebKit', + 'version' => '78.0', + ), + ) diff --git a/mkdocs.yml b/mkdocs.yml index 6615196..a20ebd0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,7 +11,7 @@ nav: - Overview: v3/overview.md - Installation: v3/installation.md - Usage: v3/usage.md -site_name: dot-annotated-services +site_name: dot-user-agent-sniffer site_description: "DotKernel's component based on device-detector, providing details about a device by parsing a user agent." repo_url: "https://github.com/dotkernel/dot-user-agent-sniffer" plugins: From e53d94d78b5c002d73676e67d7314dde7d551d33 Mon Sep 17 00:00:00 2001 From: PopNatanael Date: Mon, 15 Apr 2024 13:18:10 +0300 Subject: [PATCH 3/7] Fixing CI errors --- README.md | 155 ++++++++++++++++++++++++-------------------------- composer.json | 2 +- mkdocs.yml | 36 ++++++------ 3 files changed, 92 insertions(+), 101 deletions(-) diff --git a/README.md b/README.md index c5535f0..fe0e19a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # dot-user-agent-sniffer + DotKernel component based on [device-detector](https://github.com/matomo-org/device-detector), providing details about a device by parsing a user agent. ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-user-agent-sniffer) @@ -14,105 +15,95 @@ DotKernel component based on [device-detector](https://github.com/matomo-org/dev [![SymfonyInsight](https://insight.symfony.com/projects/2e87cb23-ba35-4bef-a576-f9cb3a989ee9/big.svg)](https://insight.symfony.com/projects/2e87cb23-ba35-4bef-a576-f9cb3a989ee9) - ## Install You can install this library by running the following command: composer require dotkernel/dot-user-agent-sniffer - Before adding this library as a dependency to your service, you need to add `Dot\UserAgentSniffer\ConfigProvider::class,` to your application's `config/config.php` file. - ## Usage example -```php -deviceService = $deviceService; + /** @var DeviceServiceInterface $deviceService */ + protected $deviceService; + + /** + * MyService constructor. + * @param DeviceServiceInterface $deviceService + */ + public function __construct(DeviceServiceInterface $deviceService) + { + $this->deviceService = $deviceService; + } + + /** + * @param string $userAgent + * @return DeviceData + */ + public function myMethod(string $userAgent) + { + return $this->deviceService->getDetails($userAgent); + } } - /** - * @param string $userAgent - * @return DeviceData - */ - public function myMethod(string $userAgent) - { - return $this->deviceService->getDetails($userAgent); - } -} -``` - - When called with an `$userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/78.0.3904.84 Mobile/15E148 Safari/604.1'`, `myMethod($userAgent)` returns an object with the following structure: -```php -Dot\UserAgentSniffer\Data\DeviceData::__set_state(array( - 'type' => 'smartphone', - 'brand' => 'Apple', - 'model' => 'iPhone', - 'isBot' => false, - 'isMobile' => true, - 'os' => - Dot\UserAgentSniffer\Data\OsData::__set_state(array( - 'name' => 'iOS', - 'version' => '13.2', - 'platform' => '', - )), - 'client' => - Dot\UserAgentSniffer\Data\ClientData::__set_state(array( - 'type' => 'browser', - 'name' => 'Chrome Mobile iOS', - 'engine' => 'WebKit', - 'version' => '78.0', - )), -)) -``` + Dot\UserAgentSniffer\Data\DeviceData::__set_state(array( + 'type' => 'smartphone', + 'brand' => 'Apple', + 'model' => 'iPhone', + 'isBot' => false, + 'isMobile' => true, + 'os' => + Dot\UserAgentSniffer\Data\OsData::__set_state(array( + 'name' => 'iOS', + 'version' => '13.2', + 'platform' => '', + )), + 'client' => + Dot\UserAgentSniffer\Data\ClientData::__set_state(array( + 'type' => 'browser', + 'name' => 'Chrome Mobile iOS', + 'engine' => 'WebKit', + 'version' => '78.0', + )), + )) The above call can also be chained as `myMethod($userAgent)->getArrayCopy()`, to retrieve the details as an array: -```php -array ( - 'type' => 'smartphone', - 'brand' => 'Apple', - 'model' => 'iPhone', - 'isMobile' => true, - 'isBot' => false, - 'os' => - array ( - 'name' => 'iOS', - 'version' => '13.2', - 'platform' => '', - ), - 'client' => - array ( - 'type' => 'browser', - 'name' => 'Chrome Mobile iOS', - 'engine' => 'WebKit', - 'version' => '78.0', - ), -) -``` + array ( + 'type' => 'smartphone', + 'brand' => 'Apple', + 'model' => 'iPhone', + 'isMobile' => true, + 'isBot' => false, + 'os' => + array ( + 'name' => 'iOS', + 'version' => '13.2', + 'platform' => '', + ), + 'client' => + array ( + 'type' => 'browser', + 'name' => 'Chrome Mobile iOS', + 'engine' => 'WebKit', + 'version' => '78.0', + ), + ) diff --git a/composer.json b/composer.json index 83527b2..8e5dcf3 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "matomo/device-detector": "^6.0.1", "psr/container": "^1.1.2", - "laminas/laminas-stdlib": "^3.10.1" + "laminas/laminas-stdlib": "^3.18.0" }, "autoload": { "psr-4": { diff --git a/mkdocs.yml b/mkdocs.yml index a20ebd0..ef98b40 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,18 +1,18 @@ -docs_dir: docs/book -site_dir: docs/html -extra: - project: Packages - current_version: v3 - versions: - - v3 -nav: - - Home: index.md - - v3: - - Overview: v3/overview.md - - Installation: v3/installation.md - - Usage: v3/usage.md -site_name: dot-user-agent-sniffer -site_description: "DotKernel's component based on device-detector, providing details about a device by parsing a user agent." -repo_url: "https://github.com/dotkernel/dot-user-agent-sniffer" -plugins: - - search +docs_dir: docs/book +site_dir: docs/html +extra: + project: Packages + current_version: v3 + versions: + - v3 +nav: + - Home: index.md + - v3: + - Overview: v3/overview.md + - Installation: v3/installation.md + - Usage: v3/usage.md +site_name: dot-user-agent-sniffer +site_description: "DotKernel's component based on device-detector, providing details about a device by parsing a user agent." +repo_url: "https://github.com/dotkernel/dot-user-agent-sniffer" +plugins: + - search From 78292d9b4f2653b9aa84da967fb84a2ee5a7fcec Mon Sep 17 00:00:00 2001 From: PopNatanael Date: Mon, 15 Apr 2024 13:31:30 +0300 Subject: [PATCH 4/7] Fixing CI erorrs --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8e5dcf3..79b72c8 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "matomo/device-detector": "^6.0.1", + "matomo/device-detector": "6.3.0", "psr/container": "^1.1.2", "laminas/laminas-stdlib": "^3.18.0" }, From 49b03f26b38212d77cce3c04db60cb333122e792 Mon Sep 17 00:00:00 2001 From: PopNatanael Date: Mon, 15 Apr 2024 13:32:02 +0300 Subject: [PATCH 5/7] Fixing CI erorrs --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 79b72c8..e3122f3 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "matomo/device-detector": "6.3.0", + "matomo/device-detector": "^6.3.0", "psr/container": "^1.1.2", "laminas/laminas-stdlib": "^3.18.0" }, From c359278e01f3e7fdbb4520f2be309ec63cad0b98 Mon Sep 17 00:00:00 2001 From: PopNatanael Date: Tue, 16 Apr 2024 12:16:11 +0300 Subject: [PATCH 6/7] Changed line separators for files --- .github/workflows/continuous-integration.yml | 22 +++++++------- .github/workflows/docs-build.yml | 32 ++++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 72dde2f..26c5802 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,11 +1,11 @@ -name: "Continuous Integration" - -on: - pull_request: - push: - branches: - tags: - -jobs: - ci: - uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x +name: "Continuous Integration" + +on: + pull_request: + push: + branches: + tags: + +jobs: + ci: + uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index a18edb1..1a7aa24 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -1,16 +1,16 @@ -name: docs-build - -on: - release: - types: [published] - workflow_dispatch: - -jobs: - build-deploy: - runs-on: ubuntu-latest - steps: - - name: Build Docs - uses: dotkernel/documentation-theme/github-actions/docs@main - env: - DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +name: docs-build + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build-deploy: + runs-on: ubuntu-latest + steps: + - name: Build Docs + uses: dotkernel/documentation-theme/github-actions/docs@main + env: + DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9784aabe7f72a2a52ece9ebd49fb4c65c726cc9b Mon Sep 17 00:00:00 2001 From: PopNatanael Date: Tue, 23 Apr 2024 12:54:32 +0300 Subject: [PATCH 7/7] Replaced static-analysis.yml with continuous-integration.yml in static badge and added SECURITY.md --- README.md | 2 +- SECURITY.md | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 SECURITY.md diff --git a/README.md b/README.md index fe0e19a..d8bb2d1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ DotKernel component based on [device-detector](https://github.com/matomo-org/dev [![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-user-agent-sniffer)](https://github.com/dotkernel/dot-user-agent-sniffer/stargazers) [![GitHub license](https://img.shields.io/github/license/dotkernel/dot-user-agent-sniffer)](https://github.com/dotkernel/dot-user-agent-sniffer/blob/3.0/LICENSE) -[![Build Static](https://github.com/dotkernel/dot-user-agent-sniffer/actions/workflows/static-analysis.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-user-agent-sniffer/actions/workflows/static-analysis.yml) +[![Build Static](https://github.com/dotkernel/dot-user-agent-sniffer/actions/workflows/continuous-integration.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-user-agent-sniffer/actions/workflows/continuous-integration.yml) [![codecov](https://codecov.io/gh/dotkernel/dot-user-agent-sniffer/graph/badge.svg?token=HZKFRQWDSV)](https://codecov.io/gh/dotkernel/dot-user-agent-sniffer) [![SymfonyInsight](https://insight.symfony.com/projects/2e87cb23-ba35-4bef-a576-f9cb3a989ee9/big.svg)](https://insight.symfony.com/projects/2e87cb23-ba35-4bef-a576-f9cb3a989ee9) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..db2ffd0 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,39 @@ +# Security Policy + +## Supported Versions + + +| Version | Supported | PHP Version | +|---------|--------------------|------------------------------------------------------------------------------------------------------------------------| +| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-user-agent-sniffer/3.4.0) | +| <= 2.x | :x: | | + + +## Reporting Potential Security Issues + +If you have encountered a potential security vulnerability in this project, +please report it to us at . We will work with you to +verify the vulnerability and patch it. + +When reporting issues, please provide the following information: + +- Component(s) affected +- A description indicating how to reproduce the issue +- A summary of the security vulnerability and impact + +We request that you contact us via the email address above and give the +project contributors a chance to resolve the vulnerability and issue a new +release prior to any public exposure; this helps protect the project's +users, and provides them with a chance to upgrade and/or update in order to +protect their applications. + + +## Policy + +If we verify a reported security vulnerability, our policy is: + +- We will patch the current release branch, as well as the immediate prior minor + release branch. + +- After patching the release branches, we will immediately issue new security + fix releases for each patched release branch. \ No newline at end of file