Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

PSR2 compliance

  • Loading branch information...
commit 613cb0af3c50604e901d67a7aa439da87050b7f9 1 parent fea4506
@hnrysmth authored
View
15 Makefile
@@ -0,0 +1,15 @@
+default: build
+build: phpcs phpunit
+
+phpcs: vendor
+ ./vendor/bin/phpcs --standard="tests/phpcs-ruleset.xml" --error-severity=1 src
+ ./vendor/bin/phpcs --standard="tests/phpcs-ruleset.xml" --error-severity=1 tests
+
+phpunit: vendor
+ ./vendor/bin/phpunit
+
+vendor:
+ php composer.phar install --dev
+
+.PHONY: build default phpcs phpunit
+
View
1  src/Reddit/Api/Session/Storage/Chain.php
@@ -29,4 +29,3 @@ public function retrieveSession($username)
}
}
}
-
View
1  src/Reddit/Api/Session/Storage/Disk.php
@@ -39,4 +39,3 @@ private function generateFilename($username)
);
}
}
-
View
1  src/Reddit/Api/Session/Subscriber.php
@@ -64,4 +64,3 @@ private function isSuccessfulLogin($body)
return isset($body->json->data->modhash);
}
}
-
View
6 src/Reddit/Reddit.php
@@ -249,7 +249,7 @@ public function getLinksByUsername($name)
* @param integer $limit [optional] Maximum number of links
* @return array
*/
- public function getLinksBySubreddit($subredditName, $limit=25)
+ public function getLinksBySubreddit($subredditName, $limit = 25)
{
$verb = 'GET';
$url = "http://www.reddit.com/r/{$subredditName}.json?limit={$limit}";
@@ -554,8 +554,8 @@ public function submit($subredditName, $linkType, $title, $linkUrl)
'.error.RATELIMIT.field-ratelimit',
'you aren\'t allowed to post there.',
'that reddit doesn\'t exist',
- 'care to try these again?',
- 'a url is required',
+ 'care to try these again?',
+ 'a url is required',
);
foreach ($response['jquery'] as $element) {
View
1  tests/Api/Response/HandlerTest.php
@@ -84,5 +84,4 @@ public function processListing()
$output = Api\Response\Handler::fromCommand($this->command);
$this->assertEquals(array($thing), $output);
}
-
}
View
1  tests/Api/Session/Storage/ChainTest.php
@@ -59,4 +59,3 @@ public function retrieveSessionStopsWhenFound()
$this->assertEquals($this->session, $session);
}
}
-
View
27 tests/Api/Session/SubscriberTest.php
@@ -64,22 +64,23 @@ public function onRequestAfterSend()
$this->response
->shouldReceive('getBody')
- ->andReturn('{
- "json": {
- "errors": [],
+ ->andReturn(
+ '{
+ "json": {
+ "errors": [],
"data": {
"modhash": "e17aznbup819e98e407734a18ef5a38e4b808dcd3c307ae919",
- "cookie": "23636817,2013-11-25T16:21:14,2ab7f75beab690d42276b3d747d587c7a2bc0e27"
- }
- }
- }
- ')
- ->once();
+ "cookie": "23636817,2013-11-25T16:21:14,2ab7f75beab690d42276b3d747d587c7a2bc0e27"
+ }
+ }
+ }'
+ )
+ ->once();
- $this->storage
- ->shouldReceive('storeSession')
- ->once();
+ $this->storage
+ ->shouldReceive('storeSession')
+ ->once();
- $this->subscriber->onRequestAfterSend($this->event);
+ $this->subscriber->onRequestAfterSend($this->event);
}
}
View
1  tests/bootstrap.php
@@ -1,3 +1,2 @@
<?php
require_once __DIR__ . '/../vendor/autoload.php';
-
View
5 tests/phpcs-ruleset.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<ruleset name="Custom Standard">
+ <description>PSR2</description>
+ <rule ref="PSR2"/>
+</ruleset>
Please sign in to comment.
Something went wrong with that request. Please try again.