Skip to content

Commit

Permalink
Rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill li committed Apr 22, 2018
1 parent 91478e5 commit 9e42200
Show file tree
Hide file tree
Showing 22 changed files with 179 additions and 147 deletions.
2 changes: 1 addition & 1 deletion LENCESE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Anomaly
Copyright (c) 2018 Ofcold

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><img src="https://github.com/anomalylab/luminous-sms/raw/master/sms.svg?sanitize=true"></p>
<p align="center"><img src="https://github.com/ofcold/luminous-sms/raw/master/sms.svg?sanitize=true"></p>
A powerful international SMS push.

## Features
Expand All @@ -22,16 +22,16 @@ A powerful international SMS push.
## Intalling

```shell
$ composer require anomalylab/luminous-sms
$ composer require ofcold/luminous-sms
```

## Usage

```php

use AnomalyLab\LuminousSMS\Contracts\MessagerInterface;

$sms = (new AnomalyLab\LuminousSMS\LuminousSms)
use Ofcold\LuminousSMS\Contracts\MessagerInterface;

$sms = (new Ofcold\LuminousSMS\LuminousSms)
->setConfig([
'default_handler' => 'qcloud',
'supported' => [
Expand All @@ -54,7 +54,7 @@ $sms->sender(function($messager) {
$messager
->setMobilePhone('18898726543')
// Use voice.
->setType(AnomalyLab\LuminousSMS\Contracts\MessagerInterface::VOICE_MESSAGE)
->setType(Ofcold\LuminousSMS\Contracts\MessagerInterface::VOICE_MESSAGE)
->setContent('{name},您的验证码是{code}, 验证码将在{time}分钟后失效!请及时使用。')
->setData([
'name' => 'Hello',
Expand Down Expand Up @@ -137,7 +137,7 @@ A message to support multi-platform send, each sent in a different way, but we a
## API

```php
AnomalyLab\LuminousSMS\LuminousSMS
Ofcold\LuminousSMS\LuminousSMS
```

##### sender(callable | array $callback, null|string $handler)
Expand All @@ -160,7 +160,7 @@ A message to support multi-platform send, each sent in a different way, but we a
<td>true</td>
<td>callable | array</td>
<td>none</td>
<td>Send information data, AnomalyLab\LuminousSMS\Messenger::class</td>
<td>Send information data, Ofcold\LuminousSMS\Messenger::class</td>
</tr>

<tr>
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"authors": [
{
"name": "bill li",
"email": "bill.li@anomaly.ink"
"email": "bill.li@ofcold.com"
}
],
"require": {
Expand All @@ -25,12 +25,12 @@
},
"autoload": {
"psr-4": {
"AnomalyLab\\LuminousSMS\\": "src/"
"Ofcold\\LuminousSMS\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"AnomalyLab\\LuminousSMS\\Tests\\": "tests/"
"Ofcold\\LuminousSMS\\Tests\\": "tests/"
}
}
}
16 changes: 9 additions & 7 deletions src/Contracts/HandlerInterface.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?php

namespace AnomalyLab\LuminousSMS\Contracts;
namespace Ofcold\LuminousSMS\Contracts;

/**
* Interface HandlerInterface
*
* @link https://anomaly.ink
* @author Anomaly lab, Inc <[email protected]>
* @author Bill Li <[email protected]>
* @package AnomalyLab\LuminousSMS\Contracts\HandlerInterface
* @link https://ofcold.com
*
* @author Ofcold, Inc <[email protected]>
* @author Bill Li <[email protected]>
*
* @package Ofcold\LuminousSMS\Contracts\HandlerInterface
*/
interface HandlerInterface
{
Expand All @@ -25,11 +27,11 @@ public function getName() : string;
* The current drive service providers to implement push information content.
*
* @param int|string $to
* @param \AnomalyLab\LuminousSMS\Contracts\MessagerInterface $messager
* @param \Ofcold\LuminousSMS\Contracts\MessagerInterface $messager
*
* @return array
*
* @throws \AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
* @throws \Ofcold\LuminousSMS\Exceptions\HandlerBadException;
*/
public function send(MessagerInterface $messager) : array;
}
12 changes: 7 additions & 5 deletions src/Contracts/MessagerInterface.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?php

namespace AnomalyLab\LuminousSMS\Contracts;
namespace Ofcold\LuminousSMS\Contracts;

/**
* Interface MessagerInterface
*
* @link https://anomaly.ink
* @author Anomaly lab, Inc <[email protected]>
* @author Bill Li <[email protected]>
* @package AnomalyLab\LuminousSMS\Contracts\MessagerInterface
* @link https://ofcold.com
*
* @author Ofcold, Inc <[email protected]>
* @author Bill Li <[email protected]>
*
* @package Ofcold\LuminousSMS\Contracts\MessagerInterface
*/
interface MessagerInterface
{
Expand Down
12 changes: 6 additions & 6 deletions src/Exceptions/HandlerBadException.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php

namespace AnomalyLab\LuminousSMS\Exceptions;
namespace Ofcold\LuminousSMS\Exceptions;

use Exception;

/**
* Class HandlerBadException
*
* @link https://anomaly.ink
* @link https://ofcold.com
*
* @author Anomaly lab, Inc <support@anomaly.ink>
* @author Bill Li <bill@anomaly.ink>
* @author Ofcold, Inc <support@ofcold.com>
* @author Bill Li <bill[email protected]>
*
* @package AnomalyLab\LuminousSMS\Exceptions\HandlerBadException
* @package Ofcold\LuminousSMS\Exceptions\HandlerBadException
*/
class HandlerBadException extends Exception
{

}
22 changes: 12 additions & 10 deletions src/Handlers/Alidayu.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?php

namespace AnomalyLab\LuminousSMS\Handlers;
namespace Ofcold\LuminousSMS\Handlers;

use AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
use AnomalyLab\LuminousSMS\Contracts\MessagerInterface;
use AnomalyLab\LuminousSMS\Support\Arrays;
use Ofcold\LuminousSMS\Exceptions\HandlerBadException;
use Ofcold\LuminousSMS\Contracts\MessagerInterface;
use Ofcold\LuminousSMS\Support\Arrays;

/**
* Class Alidayu
*
* @link https://anomaly.ink
* @author Anomaly lab, Inc <[email protected]>
* @author Bill Li <[email protected]>
* @package AnomalyLab\LuminousSMS\Handlers\Alidayu
* @link https://ofcold.com
*
* @author Ofcold, Inc <[email protected]>
* @author Bill Li <[email protected]>
*
* @package Ofcold\LuminousSMS\Handlers\Alidayu
*/
class Alidayu extends Handler
{
Expand All @@ -36,11 +38,11 @@ class Alidayu extends Handler
*
* The current drive service providers to implement push information content.
*
* @param \AnomalyLab\LuminousSMS\Contracts\MessagerInterface $messager
* @param \Ofcold\LuminousSMS\Contracts\MessagerInterface $messager
*
* @return array
*
* @throws \AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
* @throws \Ofcold\LuminousSMS\Exceptions\HandlerBadException;
*/
public function send(MessagerInterface $messager) : array
{
Expand Down
24 changes: 13 additions & 11 deletions src/Handlers/Baidu.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?php

namespace AnomalyLab\LuminousSMS\Handlers;
namespace Ofcold\LuminousSMS\Handlers;

use AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
use AnomalyLab\LuminousSMS\Contracts\MessagerInterface;
use AnomalyLab\LuminousSMS\Support\Arrays;
use Ofcold\LuminousSMS\Exceptions\HandlerBadException;
use Ofcold\LuminousSMS\Contracts\MessagerInterface;
use Ofcold\LuminousSMS\Support\Arrays;

/**
* Class Baidu
*
* @link https://anomaly.ink
* @author Anomaly lab, Inc <[email protected]>
* @author Bill Li <[email protected]>
* @package AnomalyLab\LuminousSMS\Handlers\Baidu
* @link https://ofcold.com
*
* @author Ofcold, Inc <[email protected]>
* @author Bill Li <[email protected]>
*
* @package Ofcold\LuminousSMS\Handlers\Baidu
*/
class Baidu extends Handler
{
Expand All @@ -30,19 +32,19 @@ class Baidu extends Handler
protected const BCE_AUTH_VERSION = 'bce-auth-v1';

protected const DEFAULT_EXPIRATION_IN_SECONDS = 1800; //签名有效期默认1800秒

protected const SUCCESS_CODE = 1000;

/**
* Seed message.
*
* The current drive service providers to implement push information content.
*
* @param \AnomalyLab\LuminousSMS\Contracts\MessagerInterface $messager
* @param \Ofcold\LuminousSMS\Contracts\MessagerInterface $messager
*
* @return array
*
* @throws \AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
* @throws \Ofcold\LuminousSMS\Exceptions\HandlerBadException;
*/
public function send(MessagerInterface $messager) : array
{
Expand Down
20 changes: 11 additions & 9 deletions src/Handlers/Handler.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?php

namespace AnomalyLab\LuminousSMS\Handlers;
namespace Ofcold\LuminousSMS\Handlers;

use AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
use AnomalyLab\LuminousSMS\Traits\HttpRequest;
use AnomalyLab\LuminousSMS\Contracts\HandlerInterface;
use Ofcold\LuminousSMS\Exceptions\HandlerBadException;
use Ofcold\LuminousSMS\Traits\HttpRequest;
use Ofcold\LuminousSMS\Contracts\HandlerInterface;

/**
* Class Handler
*
* @link https://anomaly.ink
* @author Anomaly lab, Inc <[email protected]>
* @author Bill Li <[email protected]>
* @package AnomalyLab\LuminousSMS\Handlers\Handler
* @link https://ofcold.com
*
* @author Ofcold, Inc <[email protected]>
* @author Bill Li <[email protected]>
*
* @package Ofcold\LuminousSMS\Handlers\Handler
*/
abstract class Handler implements HandlerInterface
{
Expand Down Expand Up @@ -86,7 +88,7 @@ function($key) use($remove) {
*
* @return string
*
* @throws \AnomalyLab\LuminousSMS\Exceptions\HandlerBadException
* @throws \Ofcold\LuminousSMS\Exceptions\HandlerBadException
*/
public function getMethod(string $method) : string
{
Expand Down
22 changes: 12 additions & 10 deletions src/Handlers/Juhe.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?php

namespace AnomalyLab\LuminousSMS\Handlers;
namespace Ofcold\LuminousSMS\Handlers;

use AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
use AnomalyLab\LuminousSMS\Contracts\MessagerInterface;
use AnomalyLab\LuminousSMS\Support\Arrays;
use Ofcold\LuminousSMS\Exceptions\HandlerBadException;
use Ofcold\LuminousSMS\Contracts\MessagerInterface;
use Ofcold\LuminousSMS\Support\Arrays;

/**
* Class Juhe
*
* @link https://anomaly.ink
* @author Anomaly lab, Inc <[email protected]>
* @author Bill Li <[email protected]>
* @package AnomalyLab\LuminousSMS\Handlers\Juhe
* @link https://ofcold.com
*
* @author Ofcold, Inc <[email protected]>
* @author Bill Li <[email protected]>
*
* @package Ofcold\LuminousSMS\Handlers\Juhe
*/
class Juhe extends Handler
{
Expand All @@ -39,11 +41,11 @@ class Juhe extends Handler
*
* The current drive service providers to implement push information content.
*
* @param \AnomalyLab\LuminousSMS\Contracts\MessagerInterface $messager
* @param \Ofcold\LuminousSMS\Contracts\MessagerInterface $messager
*
* @return array
*
* @throws \AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
* @throws \Ofcold\LuminousSMS\Exceptions\HandlerBadException;
*/
public function send(MessagerInterface $messager) : array
{
Expand Down
24 changes: 13 additions & 11 deletions src/Handlers/Qcloud.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<?php

namespace AnomalyLab\LuminousSMS\Handlers;
namespace Ofcold\LuminousSMS\Handlers;

use AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
use AnomalyLab\LuminousSMS\Contracts\MessagerInterface;
use AnomalyLab\LuminousSMS\Support\Arrays;
use AnomalyLab\LuminousSMS\Support\Stringy;
use Ofcold\LuminousSMS\Exceptions\HandlerBadException;
use Ofcold\LuminousSMS\Contracts\MessagerInterface;
use Ofcold\LuminousSMS\Support\Arrays;
use Ofcold\LuminousSMS\Support\Stringy;

/**
* Class Qcloud
*
* @link https://anomaly.ink
* @author Anomaly lab, Inc <[email protected]>
* @author Bill Li <[email protected]>
* @package AnomalyLab\LuminousSMS\Handlers\Qcloud
* @link https://ofcold.com
*
* @author Ofcold, Inc <[email protected]>
* @author Bill Li <[email protected]>
*
* @package Ofcold\LuminousSMS\Handlers\Qcloud
*/
class Qcloud extends Handler
{
Expand All @@ -40,11 +42,11 @@ class Qcloud extends Handler
*
* The current drive service providers to implement push information content.
*
* @param \AnomalyLab\LuminousSMS\Contracts\MessagerInterface $messager
* @param \Ofcold\LuminousSMS\Contracts\MessagerInterface $messager
*
* @return array
*
* @throws \AnomalyLab\LuminousSMS\Exceptions\HandlerBadException;
* @throws \Ofcold\LuminousSMS\Exceptions\HandlerBadException;
*/
public function send(MessagerInterface $messager) : array
{
Expand Down
Loading

0 comments on commit 9e42200

Please sign in to comment.