SchoolProfileSerializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A attributes() 0 3 1
A id() 0 3 1
A getId() 0 3 1
1
<?php
2
3
/**
4
 * @file
5
 * Contains Drupal\esdportal_api\Serializers\SchoolProfileSerializer.
6
 */
7
8
namespace Drupal\esdportal_api\Serializers;
9
10
use Tobscure\JsonApi\SerializerAbstract;
11
/**
12
 * Serializes school profiles.
13
 */
14
class SchoolProfileSerializer extends SerializerAbstract {
15
  protected $type = 'school_profiles';
16
17
  /**
18
   * Nothing special here, yet.
19
   */
20
  protected function attributes($school_profile) {
21
    return $school_profile;
22
  }
23
24
  /**
25
   * Provides node id as id.
26
   */
27
  protected function id($school_profile) {
28
    return $school_profile->nid;
29
  }
30
31
  /**
32
   * Backwards-compatible with bnchdrff/json-api version.
33
   */
34
  protected function getId($school_profile) {
35
    return $school_profile->nid;
36
  }
37
38
}
39