Skip to content

Commit e527849

Browse files
committed
yii2 coding standards
1 parent 5bd241d commit e527849

8 files changed

+10
-20
lines changed

src/JsonApiParser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ public function parse($rawBody, $contentType)
1414
// TODO probably need to validate 'type' property.
1515
return parent::parse($rawBody, $contentType);
1616
}
17-
18-
}
17+
}

src/JsonApiResponseFormatter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,4 @@ public function format($response)
5656
$response->content = Json::encode($apiDocument, $options);
5757
}
5858
}
59-
60-
}
59+
}

src/ResourceIdentifierInterface.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
namespace tuyakhov\jsonapi;
77

8-
98
interface ResourceIdentifierInterface
109
{
1110
public function getId();
1211

1312
public function getType();
14-
}
13+
}

src/ResourceInterface.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace tuyakhov\jsonapi;
77

8-
98
interface ResourceInterface extends ResourceIdentifierInterface
109
{
1110
public function getResourceAttributes(array $fields = []);
@@ -16,4 +15,4 @@ public function getLinks();
1615

1716
public function getMeta();
1817

19-
}
18+
}

src/ResourceTrait.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace tuyakhov\jsonapi;
77

8-
98
use yii\base\Arrayable;
109
use yii\db\ActiveRecordInterface;
1110
use yii\helpers\ArrayHelper;
@@ -61,7 +60,7 @@ public function getResourceRelationships()
6160
if (!is_array($relation)) {
6261
$relation = [$relation];
6362
}
64-
foreach($relation as $item) {
63+
foreach ($relation as $item) {
6564
if ($item instanceof ResourceIdentifierInterface) {
6665
$relationships[$name]['data'] = ['id' => $item->getId(), 'type' => $item->getType()];
6766
}
@@ -135,4 +134,4 @@ protected function resolveFields(array $fields, array $fieldSet = [])
135134

136135
return $result;
137136
}
138-
}
137+
}

src/Serializer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,4 @@ protected function getRequestedFields()
7979
$relationships
8080
];
8181
}
82-
83-
}
82+
}

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ protected function destroyApplication()
5656
{
5757
\Yii::$app = null;
5858
}
59-
}
59+
}

tests/data/ResourceModel.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
<?php
22
/**
3-
* Created by PhpStorm.
4-
* User: admin
5-
* Date: 3/22/16
6-
* Time: 10:39 AM
3+
* @author Anton Tuyakhov <atuyakhov@gmail.com>
74
*/
85

96
namespace tuyakhov\jsonapi\tests\data;
107

11-
128
use tuyakhov\jsonapi\ResourceIdentifierInterface;
139
use tuyakhov\jsonapi\ResourceTrait;
1410
use yii\base\Model;
@@ -28,4 +24,4 @@ public function extraFields()
2824
{
2925
return ['testRelation'];
3026
}
31-
}
27+
}

0 commit comments

Comments
 (0)