@@ -92,8 +92,8 @@ |
||
92 | 92 | } |
93 | 93 | } |
94 | 94 | $this->stats[$cat]['count']++; |
95 | - $this->stats[$cat]['duration'] += (float)$timing['duration'] * 1000; |
|
96 | - $this->stats[$cat]['memory'] += (int)$timing['memoryDiff']; |
|
95 | + $this->stats[$cat]['duration'] += (float) $timing['duration'] * 1000; |
|
96 | + $this->stats[$cat]['memory'] += (int) $timing['memoryDiff']; |
|
97 | 97 | } |
98 | 98 | $this->stats['memory'] = memory_get_peak_usage(true); |
99 | 99 | if ($final) { |
@@ -107,7 +107,7 @@ |
||
107 | 107 | if (!empty($pageUrl)) { |
108 | 108 | $query->andWhere(['url' => $pageUrl]); |
109 | 109 | } |
110 | - if ((int)$siteId !== 0) { |
|
110 | + if ((int) $siteId !== 0) { |
|
111 | 111 | $query->andWhere(['siteId' => $siteId]); |
112 | 112 | } |
113 | 113 | $stats = $query->all(); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | // See if there are too many database queries |
38 | 38 | if ($this->sample->craftTotalMs >= self::MAX_TOTAL_TIME) { |
39 | - $displayCraftTotalMs = ($this->sample->craftTotalMs / 1000) . 's'; |
|
39 | + $displayCraftTotalMs = ($this->sample->craftTotalMs / 1000).'s'; |
|
40 | 40 | $this->hasRecommendation = true; |
41 | 41 | $this->summary = Craft::t( |
42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | // See if there are too many database queries |
38 | 38 | if ($this->sample->craftTwigMs >= self::MAX_TWIG_TIME) { |
39 | - $displayCraftTwigMs = ($this->sample->craftTwigMs / 1000) . 's'; |
|
39 | + $displayCraftTwigMs = ($this->sample->craftTwigMs / 1000).'s'; |
|
40 | 40 | $this->hasRecommendation = true; |
41 | 41 | $this->summary = Craft::t( |
42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | // See if there are too many database queries |
38 | 38 | if ($this->sample->craftDbMs >= self::MAX_QUERY_TIME) { |
39 | - $displayCraftDbMs = ($this->sample->craftDbMs / 1000) . 's'; |
|
39 | + $displayCraftDbMs = ($this->sample->craftDbMs / 1000).'s'; |
|
40 | 40 | $this->hasRecommendation = true; |
41 | 41 | $this->summary = Craft::t( |
42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | // See if there are too many database queries |
38 | 38 | if ($this->sample->domInteractive >= self::MAX_DOM_INTERACTIVE_TIME) { |
39 | - $displayDomInteractive = ($this->sample->domInteractive / 1000) . 's'; |
|
39 | + $displayDomInteractive = ($this->sample->domInteractive / 1000).'s'; |
|
40 | 40 | $this->hasRecommendation = true; |
41 | 41 | $this->summary = Craft::t( |
42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | // See if there are too many database queries |
38 | 38 | if ($this->sample->firstByte >= self::MAX_TOTAL_TIME) { |
39 | - $displayFirstByte = ($this->sample->firstByte / 1000) . 's'; |
|
39 | + $displayFirstByte = ($this->sample->firstByte / 1000).'s'; |
|
40 | 40 | $this->hasRecommendation = true; |
41 | 41 | $this->summary = Craft::t( |
42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | // See if there are too many database queries |
38 | 38 | if ($this->sample->firstContentfulPaint >= self::MAX_FIRST_CONTENTFUL_PAINT_TIME) { |
39 | - $displayFirstContentfulPaint = ($this->sample->firstContentfulPaint / 1000) . 's'; |
|
39 | + $displayFirstContentfulPaint = ($this->sample->firstContentfulPaint / 1000).'s'; |
|
40 | 40 | $this->hasRecommendation = true; |
41 | 41 | $this->summary = Craft::t( |
42 | 42 | 'webperf', |
@@ -38,10 +38,10 @@ |
||
38 | 38 | $phpMemoryLimit = $this->memoryLimit(); |
39 | 39 | if ($phpMemoryLimit && $this->sample->craftTotalMemory) { |
40 | 40 | $ratio = $phpMemoryLimit / $this->sample->craftTotalMemory; |
41 | - $displayCraftTotalMemory = (($this->sample->craftTotalMemory / 1024) / 1024) . 'M'; |
|
42 | - $displayPhpMemoryLimit = (($phpMemoryLimit / 1024) / 1024) . 'M'; |
|
43 | - $displayCraftMinMemory = ((self::MIN_CRAFT_MEMORY / 1024) / 1024) . 'M'; |
|
44 | - $displayCraftMaxMemory = ((self::MAX_CRAFT_MEMORY / 1024) / 1024) . 'M'; |
|
41 | + $displayCraftTotalMemory = (($this->sample->craftTotalMemory / 1024) / 1024).'M'; |
|
42 | + $displayPhpMemoryLimit = (($phpMemoryLimit / 1024) / 1024).'M'; |
|
43 | + $displayCraftMinMemory = ((self::MIN_CRAFT_MEMORY / 1024) / 1024).'M'; |
|
44 | + $displayCraftMaxMemory = ((self::MAX_CRAFT_MEMORY / 1024) / 1024).'M'; |
|
45 | 45 | $this->summary = Craft::t( |
46 | 46 | 'webperf', |
47 | 47 | 'Check the `memory_limit` setting in your `php.ini` file', |