Skip to content

Commit 8938631

Browse files
committed
Move from nutgram/nutgram
0 parents  commit 8938631

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2190
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WIP

.editorconfig

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
max_line_length = 120
11+
12+
[*.php]
13+
ij_php_phpdoc_param_spaces_between_type_and_name = 2
14+
ij_php_phpdoc_param_spaces_between_tag_and_type = 2
15+
ij_php_phpdoc_wrap_long_lines = true
16+
ij_php_else_if_style = combine
17+
ij_php_align_multiline_parameters = false
18+
ij_php_method_parameters_right_paren_on_new_line = true
19+
ij_php_method_parameters_new_line_after_left_paren = true
20+
ij_php_space_before_short_closure_left_parenthesis = true
21+
ij_php_space_before_closure_left_parenthesis = true
22+
ij_php_keep_indents_on_empty_lines = false
23+
ij_php_space_after_type_cast = false
24+
ij_php_concat_spaces = false
25+
26+
[*.json]
27+
indent_size = 2

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Global
2+
* @Lukasss93

.github/CODE_OF_CONDUCT.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

.github/CONTRIBUTING.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
Please read and understand the contribution guide before creating an issue or pull request.
6+
7+
## Etiquette
8+
9+
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10+
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11+
extremely unfair for them to suffer abuse or anger for their hard work.
12+
13+
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14+
world that developers are civilized and selfless people.
15+
16+
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17+
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
18+
19+
## Viability
20+
21+
When requesting or submitting new features, first consider whether it might be useful to others. Open
22+
source projects are used by many developers, who may have entirely different needs to your own. Think about
23+
whether or not your feature is likely to be used by other users of the project.
24+
25+
## Procedure
26+
27+
Before filing an issue:
28+
29+
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30+
- Check to make sure your feature suggestion isn't already present within the project.
31+
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32+
- Check the pull requests tab to ensure that the feature isn't already in progress.
33+
34+
Before submitting a pull request:
35+
36+
- Check the codebase to ensure that your feature doesn't already exist.
37+
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
38+
39+
## Requirements
40+
41+
If the project maintainer has any additional requirements, you will find them listed here.
42+
43+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).
44+
45+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
46+
47+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
48+
49+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
50+
51+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
52+
53+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
54+
55+
**Happy coding**!

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [SergiX44,Lukasss93]

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.idea
2+
.vscode
3+
.DS_Store
4+
5+
/vendor/
6+
composer.lock
7+
8+
phpunit.xml
9+
coverage.xml
10+
.phpunit.result.cache

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) sergix44 <[email protected]>
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
13+
all 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
21+
THE SOFTWARE.

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# WIP - Do not use before Nutgram 4.0
2+
3+
#### TODO:
4+
- [ ] Replace namespace from "SergiX44\Nutgram" to "Nutgram"
5+
- [ ] Bump PHP version to 8.1
6+
- [ ] Bump Laravel version to 9.0
7+
- [ ] Update this README.md
8+
- [ ] Add github workflows for tests and changelog

composer.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"name": "nutgram/laravel",
3+
"description": "Laravel package for Nutgram",
4+
"keywords": [
5+
"laravel",
6+
"telegram",
7+
"nutgram",
8+
"bot",
9+
"api",
10+
"library",
11+
"framework"
12+
],
13+
"homepage": "https://github.com/nutgram/nutgram-laravel",
14+
"license": "MIT",
15+
"type": "library",
16+
"authors": [
17+
{
18+
"name": "Luca Patera",
19+
"email": "[email protected]",
20+
"role": "Developer"
21+
},
22+
{
23+
"name": "Sergio Brighenti",
24+
"email": "[email protected]",
25+
"role": "Developer"
26+
}
27+
],
28+
"minimum-stability": "dev",
29+
"prefer-stable": true,
30+
"require": {
31+
"php": "^8.0",
32+
"nutgram/nutgram": "^3.13"
33+
},
34+
"require-dev": {
35+
"illuminate/testing": "^8.0|^9.0|^10.0",
36+
"orchestra/testbench": "^6.0|^7.0|^8.0",
37+
"pestphp/pest": "^1.1",
38+
"pestphp/pest-plugin-mock": "^1.0",
39+
"roave/security-advisories": "dev-latest",
40+
"vimeo/psalm": "^4.30"
41+
},
42+
"autoload": {
43+
"psr-4": {
44+
"Nutgram\\Laravel\\": "src/"
45+
}
46+
},
47+
"autoload-dev": {
48+
"psr-4": {
49+
"Nutgram\\Laravel\\Tests\\": "tests/"
50+
}
51+
},
52+
"extra": {
53+
"laravel": {
54+
"providers": [
55+
"Nutgram\\Laravel\\NutgramServiceProvider"
56+
]
57+
}
58+
},
59+
"config": {
60+
"sort-packages": true,
61+
"allow-plugins": {
62+
"pestphp/pest-plugin": true
63+
}
64+
},
65+
"scripts": {
66+
"test": "@php vendor/bin/pest",
67+
"test-coverage": "@php vendor/bin/pest --coverage --coverage-clover=coverage.xml",
68+
"psalm": "@php vendor/bin/psalm"
69+
}
70+
}

composer.phar

2.7 MB
Binary file not shown.

config/nutgram.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
return [
4+
// The Telegram BOT api token
5+
'token' => env('TELEGRAM_TOKEN'),
6+
7+
// if the webhook mode must validate the incoming IP range is from a telegram server
8+
'safe_mode' => env('APP_ENV', 'local') === 'production',
9+
10+
// Extra or specific configurations
11+
'config' => [],
12+
13+
// Set if the service provider should automatically load
14+
// handlers from /routes/telegram.php
15+
'routes' => true,
16+
17+
// Enable or disable Nutgram mixins
18+
'mixins' => false,
19+
20+
// Path to save files generated by nutgram:make command
21+
'namespace' => app_path('Telegram'),
22+
23+
// Set log channel
24+
'log_channel' => env('TELEGRAM_LOG_CHANNEL', 'null'),
25+
];

phpunit.xml.dist

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
>
7+
<testsuites>
8+
<testsuite name="Test Suite">
9+
<directory suffix="Test.php">./tests</directory>
10+
</testsuite>
11+
</testsuites>
12+
<coverage processUncoveredFiles="true">
13+
<include>
14+
<directory suffix=".php">./src</directory>
15+
</include>
16+
<exclude>
17+
<directory suffix=".php">./tests</directory>
18+
<directory suffix=".php">./src/Facades</directory>
19+
<directory suffix=".php">./src/Log</directory>
20+
<file>./src/NutgramServiceProvider.php</file>
21+
<file>./src/Console/RunCommand.php</file>
22+
<file>./src/Console/BaseMakeCommand.php</file>
23+
<file>./src/Mixins/MixinUtils.php</file>
24+
</exclude>
25+
</coverage>
26+
<php>
27+
<env name="TELEGRAM_TOKEN" value="TELEGRAM_TOKEN_HERE" force="true"/>
28+
</php>
29+
</phpunit>

psalm.xml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="8"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
<issueHandlers>
16+
<PropertyNotSetInConstructor>
17+
<errorLevel type="suppress">
18+
<directory name="src"/>
19+
</errorLevel>
20+
</PropertyNotSetInConstructor>
21+
<InvalidThrow>
22+
<errorLevel type="suppress">
23+
<referencedClass name="Psr\SimpleCache\InvalidArgumentException"/>
24+
</errorLevel>
25+
</InvalidThrow>
26+
<UndefinedMethod>
27+
<errorLevel type="suppress">
28+
<referencedMethod name="ReflectionType::getName"/>
29+
</errorLevel>
30+
</UndefinedMethod>
31+
<PossiblyNullPropertyAssignmentValue>
32+
<errorLevel type="suppress">
33+
<directory name="src"/>
34+
</errorLevel>
35+
</PossiblyNullPropertyAssignmentValue>
36+
<UndefinedInterfaceMethod>
37+
<errorLevel type="suppress">
38+
<referencedMethod name="Psr\Container\ContainerInterface::getNew"/>
39+
<referencedMethod name="Psr\Container\ContainerInterface::extend"/>
40+
<referencedMethod name="Psr\Http\Client\ClientInterface::get"/>
41+
<referencedMethod name="Psr\Http\Client\ClientInterface::post"/>
42+
<referencedMethod name="Illuminate\Contracts\Filesystem\Filesystem::path"/>
43+
<referencedMethod name="Illuminate\Contracts\Filesystem\Filesystem::putFileAs"/>
44+
</errorLevel>
45+
</UndefinedInterfaceMethod>
46+
<InvalidScope>
47+
<errorLevel type="suppress">
48+
<directory name="tests/"/>
49+
</errorLevel>
50+
</InvalidScope>
51+
</issueHandlers>
52+
</psalm>

0 commit comments

Comments
 (0)