Skip to content

Commit f6f9de6

Browse files
committed
Fix linter stubs
0 parents  commit f6f9de6

23 files changed

Lines changed: 910 additions & 0 deletions

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml,neon}]
15+
indent_size = 2

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
* text=auto eol=lf
2+
3+
# GIT
4+
.editorconfig export-ignore
5+
.gitattributes export-ignore
6+
.gitignore export-ignore
7+
8+
# Tools
9+
.php-cs-fixer.php export-ignore
10+
phpstan.neon export-ignore
11+
12+
# Tests + CI
13+
phpunit.xml export-ignore
14+
15+
/.github export-ignore
16+
/tests export-ignore
17+
18+
# JavaScript
19+
tsconfig.json export-ignore
20+
21+
vite.config.js export-ignore
22+
/resources/src export-ignore

.github/workflows/tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
name: Tests (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }})
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '8.4', '8.5' ]
15+
os: [ ubuntu-latest, macos-latest, windows-latest ]
16+
stability: [ prefer-lowest, prefer-stable ]
17+
steps:
18+
- name: Set Git To Use LF
19+
run: |
20+
git config --global core.autocrlf false
21+
git config --global core.eol lf
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
- name: Setup PHP ${{ matrix.php }}
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
extensions: ffi
29+
tools: pecl
30+
ini-values: "memory_limit=-1"
31+
- name: Validate Composer
32+
run: composer validate
33+
- name: Get Composer Cache Directory
34+
id: composer-cache
35+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
36+
- name: Restore Composer Cache
37+
uses: actions/cache@v3
38+
with:
39+
path: ${{ steps.composer-cache.outputs.dir }}
40+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
42+
- name: Install Dependencies
43+
uses: nick-invision/retry@v2
44+
with:
45+
timeout_minutes: 5
46+
max_attempts: 5
47+
command: composer update --${{ matrix.stability }} --ignore-platform-reqs --prefer-dist --no-interaction --no-progress
48+
- name: Execute Tests
49+
run: php vendor/bin/phpunit

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# IDE
2+
/.idea
3+
/.cursor
4+
5+
# Composer
6+
/composer.lock
7+
/vendor
8+
/node_modules
9+
/build
10+
11+
# Testing
12+
test.php
13+
14+
# Toolset
15+
*.phar

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Nesmeyanov Kirill
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<a href="https://github.com/boson-php/boson">
2+
<img align="center" src="https://habrastorage.org/webt/-8/h1/5o/-8h15o6klbga13kzsltqqmk8jlm.png" />
3+
</a>
4+
5+
---
6+
7+
<p align="center">
8+
<a href="https://packagist.org/packages/boson-php/app-ext-alert"><img src="https://poser.pugx.org/boson-php/app-ext-alert/require/php?style=for-the-badge" alt="PHP 8.4+"></a>
9+
<a href="https://packagist.org/packages/boson-php/app-ext-alert"><img src="https://poser.pugx.org/boson-php/app-ext-alert/version?style=for-the-badge" alt="Latest Stable Version"></a>
10+
<a href="https://packagist.org/packages/boson-php/app-ext-alert"><img src="https://poser.pugx.org/boson-php/app-ext-alert/v/unstable?style=for-the-badge" alt="Latest Unstable Version"></a>
11+
<a href="https://raw.githubusercontent.com/boson-php/boson/blob/master/LICENSE"><img src="https://poser.pugx.org/boson-php/app-ext-alert/license?style=for-the-badge" alt="License MIT"></a>
12+
<a href="https://t.me/boson_php"><img src="https://img.shields.io/static/v1?label=&message=Join+To+Community&color=24A1DE&style=for-the-badge&logo=telegram&logoColor=white" alt="Telegram" /></a>
13+
</p>
14+
<p align="center">
15+
<a href="https://github.com/boson-php/app-ext-alert/actions/workflows/tests.yml"><img src="https://img.shields.io/github/actions/workflow/status/boson-php/boson/tests.yml?label=Tests&style=flat-square&logo=unpkg"></a>
16+
</p>
17+
18+
## Installation
19+
20+
Boson package is available as Composer repository and can
21+
be installed using the following command in a root of your project:
22+
23+
```bash
24+
composer require boson-php/app-ext-alert
25+
```
26+
27+
## Documentation
28+
29+
- You can learn more [about what a Boson is](https://bosonphp.com/doc/0.17/introduction).
30+
- Information [about the configs](https://bosonphp.com/doc/0.17/configuration) is
31+
available on the [corresponding pages](https://bosonphp.com/doc/0.17/application-configuration).
32+
- A more detailed description of working with the [application](https://bosonphp.com/doc/0.17/application),
33+
[windows](https://bosonphp.com/doc/0.17/window) and [webview](https://bosonphp.com/doc/0.17/webview)
34+
is also available.
35+
- Also, do not miss the detailed guide on additional apps for working with
36+
[function bindings](https://bosonphp.com/doc/0.17/bindings-api),
37+
[scripts](https://bosonphp.com/doc/0.17/scripts-api),
38+
[request interception](https://bosonphp.com/doc/0.17/schemes-api), and more.
39+
- If you want to build an application based on
40+
[Symfony](https://bosonphp.com/doc/0.17/symfony-adapter),
41+
[Laravel](https://bosonphp.com/doc/0.17/laravel-adapter) and
42+
[others](https://bosonphp.com/doc/0.17/psr7-adapter),
43+
then similar functionality is also available.
44+
45+
## Community
46+
47+
- Any questions left? You can ask them
48+
[in the chat `t.me/boson_php`](https://t.me/boson_php)!
49+
50+
## Contributing
51+
52+
Boson is an Open Source, [community-driven project](https://github.com/boson-php/boson/graphs/contributors).
53+
Join them [contributing code](https://bosonphp.com/doc/0.17/contribution).
54+

composer.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "boson-php/app-ext-alert",
3+
"description": "Provides Alert (Message Box) API support",
4+
"type": "library",
5+
"license": "MIT",
6+
"homepage": "https://bosonphp.com",
7+
"support": {
8+
"issues": "https://github.com/boson-php/boson/issues",
9+
"source": "https://github.com/boson-php/app-ext-alert"
10+
},
11+
"authors": [
12+
{
13+
"name": "Kirill Nesmeyanov",
14+
"email": "nesk@xakep.ru"
15+
}
16+
],
17+
"require": {
18+
"php": "^8.4",
19+
"boson-php/runtime": "^0.18"
20+
},
21+
"autoload": {
22+
"psr-4": {
23+
"Boson\\Api\\Alert\\": "src"
24+
}
25+
},
26+
"require-dev": {
27+
"phpunit/phpunit": "^12.0"
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Boson\\Api\\Alert\\Tests\\": "tests"
32+
}
33+
},
34+
"extra": {
35+
"branch-alias": {
36+
"dev-master": "0.18.x-dev",
37+
"dev-main": "0.18.x-dev"
38+
}
39+
},
40+
"config": {
41+
"sort-packages": true,
42+
"platform-check": true,
43+
"bin-compat": "full",
44+
"optimize-autoloader": true,
45+
"preferred-install": {
46+
"*": "dist"
47+
}
48+
},
49+
"minimum-stability": "dev",
50+
"prefer-stable": true
51+
}

phpstan.neon

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
parameters:
2+
level: max
3+
scanFiles:
4+
- resources/stubs/ffi.stub.php
5+
excludePaths:
6+
- src/Driver/Windows/User32.php
7+
- src/Driver/MacOS/LibObjectC.php
8+
strictRules:
9+
allRules: true
10+
fileExtensions:
11+
- php
12+
paths:
13+
- src
14+
tmpDir: vendor/.cache.phpstan

phpunit.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
colors="true"
5+
backupGlobals="true"
6+
stopOnFailure="false"
7+
processIsolation="false"
8+
bootstrap="vendor/autoload.php"
9+
cacheDirectory="vendor/.cache.phpunit"
10+
backupStaticProperties="false"
11+
>
12+
<testsuites>
13+
<testsuite name="library">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
18+
<coverage/>
19+
20+
<source>
21+
<include>
22+
<directory suffix=".php">src</directory>
23+
</include>
24+
</source>
25+
26+
<php>
27+
<ini name="error_reporting" value="-1"/>
28+
<ini name="memory_limit" value="-1"/>
29+
</php>
30+
</phpunit>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Boson;
6+
7+
use Boson\Api\Alert\AlertExtensionInterface;
8+
9+
class Application
10+
{
11+
/**
12+
* Gets access to the Alert API of the application.
13+
*/
14+
public readonly AlertExtensionInterface $alert;
15+
}

0 commit comments

Comments
 (0)