Skip to content

Commit

Permalink
Merge pull request #37 from chadicus/dev/phpcs
Browse files Browse the repository at this point in the history
Update PHPCS usage
  • Loading branch information
chadicus authored Oct 1, 2017
2 parents b1a38e4 + 667e566 commit 2f86900
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ With a checkout of the code get [Composer](http://getcomposer.org) in your PATH
```sh
composer install
./vendor/bin/phpunit
./vendor/bin/phpcs --standard=./vendor/chadicus/coding-standard/Chadicus -n src
./vendor/bin/phpcs
```

## Available Operations
Expand Down
7 changes: 7 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<file>.</file>
<exclude-pattern>*/vendor/*</exclude-pattern>
<arg value="p" />
<rule ref="./vendor/chadicus/coding-standard/Chadicus"/>
</ruleset>
29 changes: 6 additions & 23 deletions tests/RequestBridgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,12 @@ final class RequestBridgeTest extends \PHPUnit_Framework_TestCase
public function toOAuth2()
{
$uri = 'https://example.com/foo/bar';
$headers = ['Host' => ['example.com'], 'Accept' => ['application/json', 'text/json']];
$cookies = ['PHPSESSID' => uniqid()];
$server = ['SCRIPT_NAME' => __FILE__, 'SCRIPT_FILENAME' => __FILE__];
$json = json_encode(['foo' => 'bar', 'abc' => '123']);

$headers = [
'Host' => ['example.com'],
'Accept' => ['application/json', 'text/json'],
];

$cookies = [
'PHPSESSID' => uniqid(),
];

$server = [
'SCRIPT_NAME' => __FILE__,
'SCRIPT_FILENAME' => __FILE__,
];

$json = json_encode(
[
'foo' => 'bar',
'abc' => '123',
]
);

$stream = fopen('php://memory','r+');
$stream = fopen('php://memory', 'r+');
fwrite($stream, $json);
rewind($stream);

Expand Down Expand Up @@ -104,7 +87,7 @@ public function toOAuth2JsonContentType()
$data = ['foo' => 'bar', 'abc' => '123'];

$json = json_encode($data);
$stream = fopen('php://memory','r+');
$stream = fopen('php://memory', 'r+');
fwrite($stream, $json);
rewind($stream);

Expand Down

0 comments on commit 2f86900

Please sign in to comment.