3 namespace Drupal\webprofiler\DataCollector;
6 * Class DrupalDataCollectorTrait
8 trait DrupalDataCollectorTrait {
13 public function getPanelSummary() {
20 public function hasPanel() {
27 public function getLibraries() {
34 public function getDrupalSettings() {
41 public function getData() {
51 * @throws \ReflectionException
53 public function getMethodData($class, $method) {
54 $class = is_object($class) ? get_class($class) : $class;
58 $reflectedMethod = new \ReflectionMethod($class, $method);
63 'file' => $reflectedMethod->getFilename(),
64 'line' => $reflectedMethod->getStartLine(),
66 } catch (\ReflectionException $re) {
67 // TODO: handle the exception.
78 private function convertToBytes($value) {
79 if ('-1' === $value) {
83 $value = strtolower($value);
84 $max = strtolower(ltrim($value, '+'));
85 if (0 === strpos($max, '0x')) {
86 $max = intval($max, 16);
88 elseif (0 === strpos($max, '0')) {
89 $max = intval($max, 8);
95 switch (substr($value, -1)) {