Skip to content

Commit

Permalink
Suppport default strategy.
Browse files Browse the repository at this point in the history
Signed-off-by: overtrue <[email protected]>
  • Loading branch information
overtrue committed Apr 30, 2017
1 parent 90809bc commit f4ddc89
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions src/Strategies/OrderStrategy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/*
* This file is part of the overtrue/easy-sms.
* (c) overtrue <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Overtrue\EasySms\Strategies;

use Overtrue\EasySms\Contracts\StrategyInterface;

/**
* Class OrderStrategy.
*/
class OrderStrategy implements StrategyInterface
{
/**
* Apply the strategy and return result.
*
* @param array $gateways
*
* @return array
*/
public function apply(array $gateways)
{
return $gateways;
}
}
2 changes: 1 addition & 1 deletion src/Strategies/RadomStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RandomStrategy implements StrategyInterface
*/
public function apply(array $gateways)
{
uasort($gateways, function() {
uasort($gateways, function () {
return mt_rand() - mt_rand();
});

Expand Down

0 comments on commit f4ddc89

Please sign in to comment.