Completed
Pull Request — 8.x-3.x (#525)
by Philipp
02:08
created

DescribablePluginTrait::buildDescription()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\graphql\Plugin\GraphQL\Traits;
4
5
trait DescribablePluginTrait {
6
7
  /**
8
   * @param $definition
9
   *
10
   * @return null|string
11
   */
12
  protected function buildDescription($definition) {
13
    if (!empty($definition['description'])) {
14
      return (string) $definition['description'];
15
    }
16
17
    return NULL;
18
  }
19
20
}
21