Skip to content

Commit c37e837

Browse files
committed
Resolve coding standard issues
1 parent 2d3172b commit c37e837

File tree

7 files changed

+36
-0
lines changed

7 files changed

+36
-0
lines changed

src/Marshaller.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function one(array $data, array $options = [])
7979
if (!isset($options['fieldList'])) {
8080
$entity->set($properties);
8181
$entity->errors($errors);
82+
8283
return $entity;
8384
}
8485

@@ -89,6 +90,7 @@ public function one(array $data, array $options = [])
8990
}
9091

9192
$entity->errors($errors);
93+
9294
return $entity;
9395
}
9496

@@ -167,6 +169,7 @@ public function many(array $data, array $options = [])
167169
}
168170
$output[] = $this->one($record, $options);
169171
}
172+
170173
return $output;
171174
}
172175

@@ -231,6 +234,7 @@ public function merge(EntityInterface $entity, array $data, array $options = [])
231234
}
232235

233236
$entity->errors($errors);
237+
234238
return $entity;
235239
}
236240

@@ -264,6 +268,7 @@ public function mergeMany($entities, array $data, array $options = [])
264268
foreach ($primary as $key) {
265269
$keys[] = isset($el[$key]) ? $el[$key] : '';
266270
}
271+
267272
return implode(';', $keys);
268273
})
269274
->map(function ($element, $key) {

src/Model/Endpoint.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ public function endpoint($endpoint = null)
219219
}
220220
$this->_endpoint = Inflector::underscore($endpoint);
221221
}
222+
222223
return $this->_endpoint;
223224
}
224225

@@ -264,6 +265,7 @@ public function registryAlias($registryAlias = null)
264265
if ($this->_registryAlias === null) {
265266
$this->_registryAlias = $this->alias();
266267
}
268+
267269
return $this->_registryAlias;
268270
}
269271

@@ -305,11 +307,13 @@ public function schema($schema = null)
305307
->describe($this->endpoint())
306308
);
307309
}
310+
308311
return $this->_schema;
309312
}
310313
if (is_array($schema)) {
311314
$schema = new Schema($this->table(), $schema);
312315
}
316+
313317
return $this->_schema = $schema;
314318
}
315319

@@ -352,6 +356,7 @@ protected function _initializeSchema(Schema $schema)
352356
public function hasField($field)
353357
{
354358
$schema = $this->schema();
359+
355360
return $schema->column($field) !== null;
356361
}
357362

@@ -377,6 +382,7 @@ public function primaryKey($key = null)
377382
}
378383
$this->_primaryKey = $key;
379384
}
385+
380386
return $this->_primaryKey;
381387
}
382388

@@ -406,6 +412,7 @@ public function displayField($key = null)
406412
$this->_displayField = 'name';
407413
}
408414
}
415+
409416
return $this->_displayField;
410417
}
411418

@@ -495,6 +502,7 @@ public function webservice($webservice = null)
495502
public function find($type = 'all', $options = [])
496503
{
497504
$query = $this->query()->read();
505+
498506
return $this->callFinder($type, $query, $options);
499507
}
500508

@@ -623,6 +631,7 @@ protected function _setFieldMatchers($options, $keys)
623631
foreach ($fields as $field) {
624632
$matches[] = $row[$field];
625633
}
634+
626635
return implode(';', $matches);
627636
};
628637
}
@@ -724,6 +733,7 @@ public function findOrCreate($search, callable $callback = null)
724733
if ($callback) {
725734
$callback($entity);
726735
}
736+
727737
return $this->save($entity) ?: $entity;
728738
}
729739

@@ -855,6 +865,7 @@ public function save(EntityInterface $resource, $options = [])
855865
}
856866

857867
$className = get_class($resource);
868+
858869
return new $className($resource->toArray(), [
859870
'markNew' => false,
860871
'markClean' => true
@@ -949,6 +960,7 @@ protected function _dynamicFinder($method, $args)
949960
foreach ($fields as $field) {
950961
$conditions[$this->aliasField($field)] = array_shift($args);
951962
}
963+
952964
return $conditions;
953965
};
954966

@@ -1019,9 +1031,11 @@ public function newEntity($data = null, array $options = [])
10191031
if ($data === null) {
10201032
$class = $this->resourceClass();
10211033
$entity = new $class([], ['source' => $this->registryAlias()]);
1034+
10221035
return $entity;
10231036
}
10241037
$marshaller = $this->marshaller();
1038+
10251039
return $marshaller->one($data, $options);
10261040
}
10271041

@@ -1031,6 +1045,7 @@ public function newEntity($data = null, array $options = [])
10311045
public function newEntities(array $data, array $options = [])
10321046
{
10331047
$marshaller = $this->marshaller();
1048+
10341049
return $marshaller->many($data, $options);
10351050
}
10361051

@@ -1055,6 +1070,7 @@ public function newEntities(array $data, array $options = [])
10551070
public function patchEntity(EntityInterface $entity, array $data, array $options = [])
10561071
{
10571072
$marshaller = $this->marshaller();
1073+
10581074
return $marshaller->merge($entity, $data, $options);
10591075
}
10601076

@@ -1080,6 +1096,7 @@ public function patchEntity(EntityInterface $entity, array $data, array $options
10801096
public function patchEntities($entities, array $data, array $options = [])
10811097
{
10821098
$marshaller = $this->marshaller();
1099+
10831100
return $marshaller->mergeMany($entities, $data, $options);
10841101
}
10851102

@@ -1129,6 +1146,7 @@ public function implementedEvents()
11291146
}
11301147
$events[$event] = $method;
11311148
}
1149+
11321150
return $events;
11331151
}
11341152

@@ -1151,6 +1169,7 @@ public function buildRules(RulesChecker $rules)
11511169
public function __debugInfo()
11521170
{
11531171
$conn = $this->connection();
1172+
11541173
return [
11551174
'registryAlias' => $this->registryAlias(),
11561175
'alias' => $this->alias(),

src/Model/EndpointRegistry.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public static function get($alias, array $options = [])
4040
$alias
4141
));
4242
}
43+
4344
return self::$_instances[$alias];
4445
}
4546

src/Model/Resource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function __construct(array $properties = [], array $options = [])
5050

5151
if (!empty($properties) && $options['markClean'] && !$options['useSetters']) {
5252
$this->_properties = $properties;
53+
5354
return;
5455
}
5556

src/Query.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,10 @@ protected function _execute()
491491
$this->triggerBeforeFind();
492492
if ($this->__resultSet) {
493493
$decorator = $this->_decoratorClass();
494+
494495
return new $decorator($this->__resultSet);
495496
}
497+
496498
return $this->__resultSet = $this->_webservice->execute($this);
497499
}
498500

src/ResultSet.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function serialize()
6969
while ($this->valid()) {
7070
$this->next();
7171
}
72+
7273
return serialize($this->_results);
7374
}
7475

src/Schema.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public function addColumn($name, $attrs)
168168
$attrs = array_intersect_key($attrs, $valid);
169169
$this->_columns[$name] = $attrs + $valid;
170170
$this->_typeMap[$name] = $this->_columns[$name]['type'];
171+
171172
return $this;
172173
}
173174

@@ -194,6 +195,7 @@ public function column($name)
194195
}
195196
$column = $this->_columns[$name];
196197
unset($column['baseType']);
198+
197199
return $column;
198200
}
199201

@@ -214,6 +216,7 @@ public function columnType($name, $type = null)
214216
$this->_columns[$name]['type'] = $type;
215217
$this->_typeMap[$name] = $type;
216218
}
219+
217220
return $this->_columns[$name]['type'];
218221
}
219222

@@ -240,6 +243,7 @@ public function baseColumnType($column)
240243
if (Type::map($type)) {
241244
$type = Type::build($type)->getBaseType();
242245
}
246+
243247
return $this->_columns[$column]['baseType'] = $type;
244248
}
245249

@@ -267,6 +271,7 @@ public function isNullable($name)
267271
if (!isset($this->_columns[$name])) {
268272
return true;
269273
}
274+
270275
return ($this->_columns[$name]['null'] === true);
271276
}
272277

@@ -287,6 +292,7 @@ public function defaultValues()
287292
}
288293
$defaults[$name] = $data['default'];
289294
}
295+
290296
return $defaults;
291297
}
292298

@@ -324,6 +330,7 @@ public function options($options = null)
324330
return $this->_options;
325331
}
326332
$this->_options = array_merge($this->_options, $options);
333+
327334
return $this;
328335
}
329336
}

0 commit comments

Comments
 (0)