Skip to content

Commit

Permalink
Move from nutgram/nutgram
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasss93 committed Feb 22, 2023
0 parents commit 8938631
Show file tree
Hide file tree
Showing 45 changed files with 2,190 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WIP
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
max_line_length = 120

[*.php]
ij_php_phpdoc_param_spaces_between_type_and_name = 2
ij_php_phpdoc_param_spaces_between_tag_and_type = 2
ij_php_phpdoc_wrap_long_lines = true
ij_php_else_if_style = combine
ij_php_align_multiline_parameters = false
ij_php_method_parameters_right_paren_on_new_line = true
ij_php_method_parameters_new_line_after_left_paren = true
ij_php_space_before_short_closure_left_parenthesis = true
ij_php_space_before_closure_left_parenthesis = true
ij_php_keep_indents_on_empty_lines = false
ij_php_space_after_type_cast = false
ij_php_concat_spaces = false

[*.json]
indent_size = 2
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Global
* @Lukasss93
76 changes: 76 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
55 changes: 55 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

Please read and understand the contribution guide before creating an issue or pull request.

## Etiquette

This project is open source, and as such, the maintainers give their free time to build and maintain the source code
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
extremely unfair for them to suffer abuse or anger for their hard work.

Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
world that developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
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.

## Viability

When requesting or submitting new features, first consider whether it might be useful to others. Open
source projects are used by many developers, who may have entirely different needs to your own. Think about
whether or not your feature is likely to be used by other users of the project.

## Procedure

Before filing an issue:

- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.

Before submitting a pull request:

- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.

## Requirements

If the project maintainer has any additional requirements, you will find them listed here.

- **[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).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **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.

**Happy coding**!
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [SergiX44,Lukasss93]
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea
.vscode
.DS_Store

/vendor/
composer.lock

phpunit.xml
coverage.xml
.phpunit.result.cache
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) sergix44 <[email protected]>

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.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# WIP - Do not use before Nutgram 4.0

#### TODO:
- [ ] Replace namespace from "SergiX44\Nutgram" to "Nutgram"
- [ ] Bump PHP version to 8.1
- [ ] Bump Laravel version to 9.0
- [ ] Update this README.md
- [ ] Add github workflows for tests and changelog
70 changes: 70 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "nutgram/laravel",
"description": "Laravel package for Nutgram",
"keywords": [
"laravel",
"telegram",
"nutgram",
"bot",
"api",
"library",
"framework"
],
"homepage": "https://github.com/nutgram/nutgram-laravel",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "Luca Patera",
"email": "[email protected]",
"role": "Developer"
},
{
"name": "Sergio Brighenti",
"email": "[email protected]",
"role": "Developer"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.0",
"nutgram/nutgram": "^3.13"
},
"require-dev": {
"illuminate/testing": "^8.0|^9.0|^10.0",
"orchestra/testbench": "^6.0|^7.0|^8.0",
"pestphp/pest": "^1.1",
"pestphp/pest-plugin-mock": "^1.0",
"roave/security-advisories": "dev-latest",
"vimeo/psalm": "^4.30"
},
"autoload": {
"psr-4": {
"Nutgram\\Laravel\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Nutgram\\Laravel\\Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"providers": [
"Nutgram\\Laravel\\NutgramServiceProvider"
]
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"test": "@php vendor/bin/pest",
"test-coverage": "@php vendor/bin/pest --coverage --coverage-clover=coverage.xml",
"psalm": "@php vendor/bin/psalm"
}
}
Binary file added composer.phar
Binary file not shown.
25 changes: 25 additions & 0 deletions config/nutgram.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

return [
// The Telegram BOT api token
'token' => env('TELEGRAM_TOKEN'),

// if the webhook mode must validate the incoming IP range is from a telegram server
'safe_mode' => env('APP_ENV', 'local') === 'production',

// Extra or specific configurations
'config' => [],

// Set if the service provider should automatically load
// handlers from /routes/telegram.php
'routes' => true,

// Enable or disable Nutgram mixins
'mixins' => false,

// Path to save files generated by nutgram:make command
'namespace' => app_path('Telegram'),

// Set log channel
'log_channel' => env('TELEGRAM_LOG_CHANNEL', 'null'),
];
29 changes: 29 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory suffix=".php">./tests</directory>
<directory suffix=".php">./src/Facades</directory>
<directory suffix=".php">./src/Log</directory>
<file>./src/NutgramServiceProvider.php</file>
<file>./src/Console/RunCommand.php</file>
<file>./src/Console/BaseMakeCommand.php</file>
<file>./src/Mixins/MixinUtils.php</file>
</exclude>
</coverage>
<php>
<env name="TELEGRAM_TOKEN" value="TELEGRAM_TOKEN_HERE" force="true"/>
</php>
</phpunit>
52 changes: 52 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0"?>
<psalm
errorLevel="8"
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"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<directory name="src"/>
</errorLevel>
</PropertyNotSetInConstructor>
<InvalidThrow>
<errorLevel type="suppress">
<referencedClass name="Psr\SimpleCache\InvalidArgumentException"/>
</errorLevel>
</InvalidThrow>
<UndefinedMethod>
<errorLevel type="suppress">
<referencedMethod name="ReflectionType::getName"/>
</errorLevel>
</UndefinedMethod>
<PossiblyNullPropertyAssignmentValue>
<errorLevel type="suppress">
<directory name="src"/>
</errorLevel>
</PossiblyNullPropertyAssignmentValue>
<UndefinedInterfaceMethod>
<errorLevel type="suppress">
<referencedMethod name="Psr\Container\ContainerInterface::getNew"/>
<referencedMethod name="Psr\Container\ContainerInterface::extend"/>
<referencedMethod name="Psr\Http\Client\ClientInterface::get"/>
<referencedMethod name="Psr\Http\Client\ClientInterface::post"/>
<referencedMethod name="Illuminate\Contracts\Filesystem\Filesystem::path"/>
<referencedMethod name="Illuminate\Contracts\Filesystem\Filesystem::putFileAs"/>
</errorLevel>
</UndefinedInterfaceMethod>
<InvalidScope>
<errorLevel type="suppress">
<directory name="tests/"/>
</errorLevel>
</InvalidScope>
</issueHandlers>
</psalm>
Loading

0 comments on commit 8938631

Please sign in to comment.