-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "dino-ma/php-speed-limit", | ||
"description": "This is an php speed limit project;", | ||
"authors": [ | ||
{ | ||
"name": "dino.ma", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"type": "library", | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"dino-ma\\php-speed-limit\\": "src/" | ||
}}, | ||
"require": { | ||
"php": "^7.1", | ||
"predis/predis": "^1.1" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: dino.ma | ||
* Date: 2019/9/5 | ||
* Time: 4:23 PM | ||
*/ | ||
|
||
namespace DinoMa\PhpSpeedLimit\Services; | ||
|
||
|
||
class SpeedLimitService implements SpeedLimitServiceInterface | ||
{ | ||
|
||
|
||
private static $instance; | ||
|
||
private function __construct() | ||
{ | ||
} | ||
|
||
private function __clone() | ||
{ | ||
} | ||
|
||
|
||
public static function getInstance(): SpeedLimitService | ||
{ | ||
if (!self::$instance instanceof self) { | ||
self::$instance = new self(); | ||
} | ||
return self::$instance; | ||
} | ||
|
||
public function test() : int | ||
{ | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* | ||
* This file is part of the php-speedlimit package. | ||
* | ||
* (c) Dino <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace DinoMa\PhpSpeedLimit\Services; | ||
|
||
interface SpeedLimitServiceInterface | ||
{ | ||
|
||
public static function getInstance() : SpeedLimitService; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* | ||
* This file is part of the php-speedlimit package. | ||
* | ||
* (c) Dino <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace DinoMa\PhpSpeedLimit; | ||
|
||
|
||
use DinoMa\PhpSpeedLimit\Services\SpeedLimitService; | ||
|
||
class SpeedLimit extends SpeedLimitService | ||
{ | ||
public function test(): int | ||
{ | ||
return parent::test(); | ||
} | ||
|
||
} |