Code Duplication    Length = 15-15 lines in 2 locations

src/Serializers/EcSerializer.php 1 location

@@ 64-78 (lines=15) @@
61
  /**
62
   * Handles inclusion of ec_profiles.
63
   */
64
  protected function ec_profile() {
65
    return function ($ec, $include, $included) {
66
      $serializer = new EcProfileSerializer($included);
67
68
      if (!$ec->ec_profile_id) {
69
        return NULL;
70
      }
71
72
      $ec_profile = $serializer->resource($include ? $ec->ec_profile : $ec->ec_profile_id);
73
74
      $link = new Link($ec_profile);
75
76
      return $link;
77
    };
78
  }
79
80
  /**
81
   * Handles inclusion of most_recent_ec_state_ratings.

src/Serializers/SchoolSerializer.php 1 location

@@ 86-100 (lines=15) @@
83
  /**
84
   * Handles inclusion of school_profiles.
85
   */
86
  protected function school_profile() {
87
    return function ($school, $include, $included) {
88
      $serializer = new SchoolProfileSerializer($included);
89
90
      if (!$school->school_profile_id) {
91
        return NULL;
92
      }
93
94
      $school_profile = $serializer->resource($include ? $school->school_profile : $school->school_profile_id);
95
96
      $link = new Link($school_profile);
97
98
      return $link;
99
    };
100
  }
101
102
  /**
103
   * Dynamically construct methods for data tables with bcodes.