Skip to content

Commit e4fbaff

Browse files
committed
Updates
1 parent 116ad0d commit e4fbaff

File tree

10 files changed

+33
-16
lines changed

10 files changed

+33
-16
lines changed

Command/MySQLProviderSetupCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ protected function configure()
2121
/**
2222
* @param InputInterface $input
2323
* @param OutputInterface $output
24+
* @return int|null|void
25+
* @throws \Doctrine\DBAL\DBALException
2426
*/
2527
protected function execute(InputInterface $input, OutputInterface $output)
2628
{

DependencyInjection/NVRequestLimitExtension.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
class NVRequestLimitExtension extends Extension
1111
{
1212
/**
13-
* {@inheritdoc}
13+
* Loads a specific configuration.
14+
*
15+
* @param array $configs
16+
* @param ContainerBuilder $container
17+
* @throws \Exception
1418
*/
1519
public function load(array $configs, ContainerBuilder $container) {
1620
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

Exception/RequestLimitReachedException.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ class RequestLimitReachedException extends \Exception
99
/**
1010
* @inheritdoc
1111
*/
12-
public function __construct($message = "You reached defined requests limit, please try again later", $code = 403, Throwable $previous = null)
13-
{
12+
public function __construct(
13+
$message = "You reached defined requests limit, please try again later",
14+
$code = 403,
15+
Throwable $previous = null
16+
) {
1417
parent::__construct($message, $code, $previous);
1518
}
1619
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/f5a67663-c028-4e4f-90c9-1cdf8152253e/mini.png)](https://insight.sensiolabs.com/projects/f5a67663-c028-4e4f-90c9-1cdf8152253e) [![Build Status](https://travis-ci.org/NovikovViktor/RequestLimitBundle.svg?branch=master)](https://travis-ci.org/NovikovViktor/RequestLimitBundle) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/NovikovViktor/RequestLimitBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/NovikovViktor/RequestLimitBundle/?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/04d63d9f536e077027b0/maintainability)](https://codeclimate.com/github/NovikovViktor/RequestLimitBundle/maintainability)
1+
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/f5a67663-c028-4e4f-90c9-1cdf8152253e/mini.png)](https://insight.sensiolabs.com/projects/f5a67663-c028-4e4f-90c9-1cdf8152253e) [![Build Status](https://travis-ci.org/nowiko/RequestLimitBundle.svg?branch=master)](https://travis-ci.org/nowiko/RequestLimitBundle) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/NovikovViktor/RequestLimitBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/NovikovViktor/RequestLimitBundle/?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/04d63d9f536e077027b0/maintainability)](https://codeclimate.com/github/NovikovViktor/RequestLimitBundle/maintainability)
22

33
RequestLimitBundle
44
==========================

Storage/Provider/MySQLProvider.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public function configure($configuration)
2727
}
2828

2929
/**
30-
* @inheritdoc
30+
* {@inheritdoc}
31+
*
32+
* @throws \Doctrine\DBAL\DBALException
3133
*/
3234
public function get($key)
3335
{
@@ -48,7 +50,9 @@ public function get($key)
4850
}
4951

5052
/**
51-
* @inheritdoc
53+
* {@inheritdoc}
54+
55+
* @throws \Doctrine\DBAL\DBALException
5256
*/
5357
public function set($key, $expiresAt)
5458
{

Tests/AppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public function registerBundles()
1717

1818
public function registerContainerConfiguration(LoaderInterface $loader)
1919
{
20-
$loader->load(__DIR__.'/config.yml');
20+
$loader->load(__DIR__ . '/config.yml');
2121
}
2222
}

Tests/Storage/Provider/MemcachedProviderTest.php renamed to Tests/Functional/Storage/Provider/MemcachedProviderTest.php

File renamed without changes.

Utils/RequestRestrictor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function __construct(StorageManager $storageManager)
2323
/**
2424
* @param $userIp
2525
* @return mixed
26+
* @throws RequestLimitReachedException
2627
*/
2728
public function restrictRequestByIp($userIp)
2829
{
@@ -32,6 +33,7 @@ public function restrictRequestByIp($userIp)
3233
/**
3334
* @param $userId
3435
* @return mixed
36+
* @throws RequestLimitReachedException
3537
*/
3638
public function restrictRequestByUserId($userId)
3739
{

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
],
2121
"require" : {
2222
"php": ">=5.5.9",
23-
"symfony/framework-bundle": ">=3.0"
23+
"symfony/symfony": ">=3.0",
24+
"doctrine/common": "~2.4"
2425
},
2526
"require-dev": {
27+
"doctrine/dbal": "~2.4",
28+
"doctrine/orm": "~2.4,>=2.4.5",
29+
"doctrine/doctrine-bundle": "~1.4",
2630
"phpunit/phpunit": "4.*.*"
2731
},
2832
"autoload" : {

phpunit.xml.dist

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit bootstrap="Tests/bootstrap.php" colors="true">
4-
<php>
5-
<server name="KERNEL_DIR" value="Tests/Fixtures/app" />
6-
</php>
74
<testsuites>
8-
<testsuite name="RequestLimitBundle test suite">
9-
<directory suffix="Test.php">./Tests</directory>
5+
<testsuite name="unit">
6+
<directory>./Tests/Unit</directory>
107
</testsuite>
11-
</testsuites>
128

9+
<testsuite name="functional">
10+
<directory>./Tests/Functional</directory>
11+
</testsuite>
12+
</testsuites>
1313
<filter>
1414
<whitelist>
1515
<directory>./</directory>
1616
<exclude>
17-
<directory>Resources</directory>
18-
<directory>Tests</directory>
1917
<directory>vendor</directory>
2018
</exclude>
2119
</whitelist>

0 commit comments

Comments
 (0)