Skip to content

Commit

Permalink
Remark - MD lint (#80)
Browse files Browse the repository at this point in the history
MD lint
  • Loading branch information
yoanm authored Jun 25, 2022
1 parent a5fe1f3 commit 76b1eb1
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 96 deletions.
1 change: 1 addition & 0 deletions .remarkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
6 changes: 6 additions & 0 deletions .remarkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
"remark-preset-lint-consistent",
"remark-preset-lint-recommended"
]
}
26 changes: 13 additions & 13 deletions CHANGELOG-3.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@

### PHP Versions

* 🗑️ Drop PHP 7.2 support
* 🗑️ Drop PHP 7.2 support

* ✔️ PHP 7.3
* ✔️ PHP 7.3

* ✔️ PHP 7.4
* ✔️ PHP 7.4

* 🚀 Add PHP 8.0
* 🚀 Add PHP 8.0

* 🚀 Add PHP 8.1
* 🚀 Add PHP 8.1

* 🧪 Set PHP 8.2 for nightly
* 🧪 Set PHP 8.2 for nightly

### Symfony Versions

* ✔️ Symfony 4.4
* ✔️ Symfony 4.4

* ✔️ Symfony 5.4
* ✔️ Symfony 5.4

* 🧪 Set Symfony 6.0 for nightly
* 🧪 Set Symfony 6.0 for nightly

### Chore

* ✏️ Add EditorConfig files
* ✏️ Add EditorConfig files

* :octocat: Move CI from Travis to Github Action
* :octocat: Move CI from Travis to Github Action

* 📊 Configure CodeCov
* 📊 Configure CodeCov

* 🔬 Configure Codacy
* 🔬 Configure Codacy
26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
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
* 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
* 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

Expand Down
64 changes: 34 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
# Contributing

## Getting Started
* Fork, then clone the repo:
```bash
git clone git@github.com:your-username/symfony-jsonrpc-http-server.git
````

* Make sure everything goes well:
```bash
make build
make test
```

* Make your changes (Add/Update tests according to your changes).
* Make sure tests are still green:
```bash
make test
```

* To check code coverage, launch
```bash
make coverage
```

* Push to your fork and [submit a pull request](https://github.com/yoanm/symfony-jsonrpc-http-server/compare/).
* Wait for feedback or merge.

Some stuff that will increase your pull request's acceptance:
* Write tests.
* Follow PSR-2 coding style.
* Write good commit messages.
* Do not rebase or squash your commits when a review has been made.

* Fork, then clone the repo:
```bash
git clone git@github.com:your-username/symfony-jsonrpc-http-server.git
```

* Make sure everything goes well:
```bash
make build
make test
```

* Make your changes (Add/Update tests according to your changes).

* Make sure tests are still green:
```bash
make test
```

* To check code coverage, launch
```bash
make coverage
```

* Push to your fork and [submit a pull request](https://github.com/yoanm/symfony-jsonrpc-http-server/compare/).

* Wait for feedback or merge.

Some stuff that will increase your pull request's acceptance:
* Write tests.
* Follow PSR-2 coding style.
* Write good commit messages.
* Do not rebase or squash your commits when a review has been made.
87 changes: 47 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Symfony JSON-RPC server

[![License](https://img.shields.io/github/license/yoanm/symfony-jsonrpc-http-server.svg)](https://github.com/yoanm/symfony-jsonrpc-http-server)
[![Code size](https://img.shields.io/github/languages/code-size/yoanm/symfony-jsonrpc-http-server.svg)](https://github.com/yoanm/symfony-jsonrpc-http-server)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=yoanm/symfony-jsonrpc-http-server)](https://dependabot.com)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github\&repo=yoanm/symfony-jsonrpc-http-server)](https://dependabot.com)

[![Scrutinizer Build Status](https://img.shields.io/scrutinizer/build/g/yoanm/symfony-jsonrpc-http-server.svg?label=Scrutinizer&logo=scrutinizer)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server/build-status/master)
[![Scrutinizer Build Status](https://img.shields.io/scrutinizer/build/g/yoanm/symfony-jsonrpc-http-server.svg?label=Scrutinizer\&logo=scrutinizer)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server/build-status/master)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/yoanm/symfony-jsonrpc-http-server/master.svg?logo=scrutinizer)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server/?branch=master)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/8f39424add044b43a70bdb238e2f48db)](https://www.codacy.com/gh/yoanm/symfony-jsonrpc-http-server/dashboard?utm_source=github.com&utm_medium=referral&utm_content=yoanm/symfony-jsonrpc-http-server&utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/8f39424add044b43a70bdb238e2f48db)](https://www.codacy.com/gh/yoanm/symfony-jsonrpc-http-server/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=yoanm/symfony-jsonrpc-http-server\&utm_campaign=Badge_Grade)

[![CI](https://github.com/yoanm/symfony-jsonrpc-http-server/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/yoanm/symfony-jsonrpc-http-server/actions/workflows/CI.yml)
[![codecov](https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server/branch/master/graph/badge.svg?token=NHdwEBUFK5)](https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server)
Expand All @@ -24,12 +25,13 @@ See [yoanm/symfony-jsonrpc-http-server-doc](https://github.com/yoanm/symfony-jso

## Versions

- Symfony v3/4 - PHP >=7.1 : `^2.0`
* Symfony v3/4 - PHP >=7.1 : `^2.0`

⚠️⚠️ `v2.1.0` and `v2.1.1` were badly taggued, used `v3.0.0` instead ! ⚠️⚠️

⚠️⚠️ `v2.1.0` and `v2.1.1` were badly taggued, used `v3.0.0` instead ! ⚠️⚠️
* Symfony v4/5 - PHP >=7.2 : `~3.0.0`

- Symfony v4/5 - PHP >=7.2 : `~3.0.0`
- Symfony v4/5 - PHP >=7.3 : `^3.1`
* Symfony v4/5 - PHP >=7.3 : `^3.1`

## How to use

Expand All @@ -39,45 +41,48 @@ See below how to configure it.

## Configuration

Bundle requires only one thing :
- JSON-RPC Methods which are compatible with [`yoanm/jsonrpc-server-sdk`](https://raw.githubusercontent.com/yoanm/php-jsonrpc-server-sdk)

Bundle requires only one thing :

* JSON-RPC Methods which are compatible with [`yoanm/jsonrpc-server-sdk`](https://raw.githubusercontent.com/yoanm/php-jsonrpc-server-sdk)

It comes with [built-in method resolver](./src/Resolver/MethodResolver.php) which use a [service locator](https://symfony.com/doc/3.4/service_container/service_subscribers_locators.html#defining-a-service-locator). Using a service locator allow to load (and so instanciate dependencies, dependencies of dependencies, etc) method only when required (usually only one method is required by request, except for batch requests which will load one or more methods).

*[Behat demo app configuration folders](./features/demo_app/) can be used as examples.*

- Add the bundles in your `config/bundles.php` file:
```php
// config/bundles.php
return [
...
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Yoanm\SymfonyJsonRpcHttpServer\JsonRpcHttpServerBundle::class => ['all' => true],
...
];
```
- Add the following in your routing configuration :
```yaml
# config/routes.yaml
json-rpc-endpoint:
resource: '@JsonRpcHttpServerBundle/Resources/config/routing/endpoint.xml'
```
- Add the following in your configuration :
```yaml
# config/config.yaml
framework:
secret: '%env(APP_SECRET)%'

json_rpc_http_server: ~
# Or the following in case you want to customize endpoint path
#json_rpc_http_server:
# endpoint: '/my-custom-endpoint' # Default to '/json-rpc'
```
* Add the bundles in your `config/bundles.php` file:
```php
// config/bundles.php
return [
...
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Yoanm\SymfonyJsonRpcHttpServer\JsonRpcHttpServerBundle::class => ['all' => true],
...
];
```

* Add the following in your routing configuration :
```yaml
# config/routes.yaml
json-rpc-endpoint:
resource: '@JsonRpcHttpServerBundle/Resources/config/routing/endpoint.xml'
```

* Add the following in your configuration :
```yaml
# config/config.yaml
framework:
secret: '%env(APP_SECRET)%'

json_rpc_http_server: ~
# Or the following in case you want to customize endpoint path
#json_rpc_http_server:
# endpoint: '/my-custom-endpoint' # Default to '/json-rpc'
```

### JSON-RPC Method mapping

In order to inject yours JSON-RPC method into the server add the tag `json_rpc_http_server.jsonrpc_method` and the key/value `method` like following example :

```yaml
services:
method-a.service-id:
Expand All @@ -88,6 +93,7 @@ services:
```

### Methods mapping aware

In case you want to be aware of which methods are registered inside the JSON-RPC server, you can use the `json_rpc_http_server.method_aware`. Your class must implements `JsonRpcMethodAwareInterface`.

```php
Expand Down Expand Up @@ -121,4 +127,5 @@ mapping_aware_service:
```
## Contributing
See [contributing note](./CONTRIBUTING.md)

0 comments on commit 76b1eb1

Please sign in to comment.