Browse Source

Code formatting

main
Cédric Belin 5 months ago
parent
commit
a746625b59
4 changed files with 10 additions and 12 deletions
  1. +0
    -2
      .editorconfig
  2. +1
    -1
      doc/index.md
  3. +3
    -3
      doc/installation.md
  4. +6
    -6
      doc/usage.md

+ 0
- 2
.editorconfig View File

@@ -5,8 +5,6 @@ root = true
charset = utf-8
indent_style = tab
insert_final_newline = true
max_line_length = 200
quote_type = double
tab_width = 2
trim_trailing_whitespace = true



+ 1
- 1
doc/index.md View File

@@ -23,7 +23,7 @@ This will give you an identification key allowing access to the [Free Mobile](ht
### Get the library
Install the latest version of **Free Mobile for Yii** with [Composer](https://getcomposer.org):

```shell
``` shell
composer require cedx/yii2-free-mobile
```



+ 3
- 3
doc/installation.md View File

@@ -6,7 +6,7 @@ and [Composer](https://getcomposer.org), the PHP package manager, up and running

You can verify if you're already good to go with the following commands:

```shell
``` shell
php --version
# PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:19) ( NTS Visual C++ 2017 x64 )

@@ -23,14 +23,14 @@ composer --version
### 1. Install it
From a command prompt, run:

```shell
``` shell
composer require cedx/yii2-free-mobile
```

### 2. Import it
Now in your [PHP](https://www.php.net) code, you can use:

```php
``` php
<?php
use yii\freemobile\{
Client,


+ 6
- 6
doc/usage.md View File

@@ -3,7 +3,7 @@
## SMS notifications
**Free Mobile for Yii** provides the `yii\freemobile\Client` class, which allow to send SMS messages to your mobile phone by using the `sendMessage()` method:

```php
``` php
<?php
use yii\freemobile\{Client, ClientException};

@@ -38,7 +38,7 @@ The `yii\freemobile\Client` class triggers some [events](https://www.yiiframewor
### The `Client::eventRequest` event
Emitted every time a request is made to the remote service:

```php
``` php
<?php
use yii\freemobile\{Client};
use yii\httpclient\{RequestEvent};
@@ -54,7 +54,7 @@ function main(): void {
### The `Client::eventResponse` event
Emitted every time a response is received from the remote service:

```php
``` php
<?php
use yii\freemobile\{Client};
use yii\httpclient\{RequestEvent};
@@ -72,7 +72,7 @@ function main(): void {
### Application component
In your [application configuration](https://www.yiiframework.com/doc/guide/2.0/en/concept-configurations#application-configurations) file, you can register the `yii\freemobile\Client` class as an [application component](https://www.yiiframework.com/doc/guide/2.0/en/structure-application-components):

```php
``` php
<?php return [
"components" => [
"freemobile" => [
@@ -86,7 +86,7 @@ In your [application configuration](https://www.yiiframework.com/doc/guide/2.0/e

Once the `freemobile` component is initialized with your credentials, you can use its `sendMessage()` method, available through the [application instance](https://www.yiiframework.com/doc/guide/2.0/en/structure-applications):

```php
``` php
<?php
$client = \Yii::$app->get("freemobile");
$client->sendMessage("Hello World!");
@@ -95,7 +95,7 @@ $client->sendMessage("Hello World!");
### Logging
In your [application configuration](https://www.yiiframework.com/doc/guide/2.0/en/concept-configurations#application-configurations) file, you can register the `yii\freemobile\LogTarget` class as a [log target](https://www.yiiframework.com/doc/guide/2.0/en/runtime-logging#log-targets):

```php
``` php
<?php return [
"bootstrap" => ["log"],
"components" => [


Loading…
Cancel
Save