Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
dino-ma committed Sep 5, 2019
1 parent 8462362 commit 9ba5948
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
20 changes: 20 additions & 0 deletions composer.json
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"
}
}
76 changes: 76 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions src/Services/SpeedLimitService.php
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;
}
}
21 changes: 21 additions & 0 deletions src/Services/SpeedLimitServiceInterface.php
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;

}
26 changes: 26 additions & 0 deletions src/SpeedLimit.php
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();
}

}

0 comments on commit 9ba5948

Please sign in to comment.