@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct(StringUtility $stringUtility) |
| 24 | 24 | { |
| 25 | - $this->stringUtility = $stringUtility; |
|
| 25 | + $this->stringUtility = $stringUtility; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public function parse($line) |
| 34 | 34 | { |
| 35 | 35 | //begin of dependencies |
| 36 | - $stringUtility = $this->stringUtility; |
|
| 36 | + $stringUtility = $this->stringUtility; |
|
| 37 | 37 | //end of dependencies |
| 38 | 38 | |
| 39 | 39 | //begin of business logic |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | '', |
| 73 | 73 | (isset($lineAsArray[19]) ? $lineAsArray[19] : $lineAsArray[18]) |
| 74 | 74 | ); |
| 75 | - $uriPathWithQuery = ( |
|
| 75 | + $uriPathWithQuery = ( |
|
| 76 | 76 | $stringUtility->endsWith($lineAsArray[17], '}') |
| 77 | 77 | ? substr($lineAsArray[17], 0, -1) |
| 78 | 78 | : $lineAsArray[17] |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | StringUtility $stringUtility |
| 20 | 20 | ) |
| 21 | 21 | { |
| 22 | - $this->stringUtility = $stringUtility; |
|
| 22 | + $this->stringUtility = $stringUtility; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -32,21 +32,21 @@ discard block |
||
| 32 | 32 | public function parse(array $listOfLine) |
| 33 | 33 | { |
| 34 | 34 | //begin of dependencies |
| 35 | - $stringUtility = $this->stringUtility; |
|
| 35 | + $stringUtility = $this->stringUtility; |
|
| 36 | 36 | //end of dependencies |
| 37 | 37 | |
| 38 | 38 | //begin of business logic |
| 39 | 39 | $listOfLineHasMinimalSize = (count($listOfLine) > 3); |
| 40 | 40 | |
| 41 | 41 | if ($listOfLineHasMinimalSize) { |
| 42 | - $listOfMandatoryPropertyNameToStartsWithPrefix = [ |
|
| 42 | + $listOfMandatoryPropertyNameToStartsWithPrefix = [ |
|
| 43 | 43 | 'date_of_built' => 'Server Built: ', |
| 44 | 44 | 'identifier' => 'Apache Server Status for ', |
| 45 | 45 | 'mode_of_mpm' => 'Server MPM: ', |
| 46 | 46 | 'version' => 'Server Version: ' |
| 47 | 47 | ]; |
| 48 | 48 | |
| 49 | - $listOMandatoryProperties = [ |
|
| 49 | + $listOMandatoryProperties = [ |
|
| 50 | 50 | 'date_of_built' => null, |
| 51 | 51 | 'identifier' => null, |
| 52 | 52 | 'mode_of_mpm' => null, |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | //stop repeating yourself, us the $listOfMandatoryPropertyNameToStartsWithPrefix |
| 58 | 58 | //take a look to the StatisticListOfLineParser |
| 59 | 59 | if ($stringUtility->startsWith($line, 'Apache Server Status for ')) { |
| 60 | - $listOMandatoryProperties['identifier'] = substr($line, 25); //always use numbers if you are dealing with static strings |
|
| 60 | + $listOMandatoryProperties['identifier'] = substr($line, 25); //always use numbers if you are dealing with static strings |
|
| 61 | 61 | } else if ($stringUtility->startsWith($line, 'Server Version: ')) { |
| 62 | 62 | $listOMandatoryProperties['version'] = substr($line, 16); |
| 63 | 63 | } else if ($stringUtility->startsWith($line, 'Server MPM: ')) { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $parserBuilderFactory = new \Net\Bazzline\Component\ApacheServerStatusParser\Service\Builder\ParserBuilderFactory(); |
| 55 | 55 | $storageBuilder = new \Net\Bazzline\Component\ApacheServerStatusParser\Service\Builder\LocalStorageBuilder(); |
| 56 | 56 | |
| 57 | -$parserBuilder = $parserBuilderFactory->create(); |
|
| 57 | +$parserBuilder = $parserBuilderFactory->create(); |
|
| 58 | 58 | //end of dependencies |
| 59 | 59 | |
| 60 | 60 | //begin of business logic |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $storageBuilder->selectParseModeDetailOnlyUpfront(); |
| 65 | 65 | $storageBuilder->build(); |
| 66 | 66 | |
| 67 | -$listOfNameToElapsedTime['fetching'] = PHP_Timer::secondsToTimeString( |
|
| 67 | +$listOfNameToElapsedTime['fetching'] = PHP_Timer::secondsToTimeString( |
|
| 68 | 68 | PHP_Timer::stop() |
| 69 | 69 | ); |
| 70 | 70 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $parserBuilderFactory = new \Net\Bazzline\Component\ApacheServerStatusParser\Service\Builder\ParserBuilderFactory(); |
| 55 | 55 | $storageBuilder = new \Net\Bazzline\Component\ApacheServerStatusParser\Service\Builder\LocalStorageBuilder(); |
| 56 | 56 | |
| 57 | -$parserBuilder = $parserBuilderFactory->create(); |
|
| 57 | +$parserBuilder = $parserBuilderFactory->create(); |
|
| 58 | 58 | //end of dependencies |
| 59 | 59 | |
| 60 | 60 | //begin of business logic |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $storageBuilder->selectParseModeAllUpfront(); |
| 65 | 65 | $storageBuilder->build(); |
| 66 | 66 | |
| 67 | -$listOfNameToElapsedTime['fetching'] = PHP_Timer::secondsToTimeString( |
|
| 67 | +$listOfNameToElapsedTime['fetching'] = PHP_Timer::secondsToTimeString( |
|
| 68 | 68 | PHP_Timer::stop() |
| 69 | 69 | ); |
| 70 | 70 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | : 'http://testdata.bazzline.net/apache_server_status/index.html' |
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | -$parserBuilder = $parserBuilderFactory->create(); |
|
| 57 | +$parserBuilder = $parserBuilderFactory->create(); |
|
| 58 | 58 | //end of dependencies |
| 59 | 59 | |
| 60 | 60 | //begin of business logic |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | $storageBuilder->selectParseModeDetailOnlyUpfront(); |
| 65 | 65 | $storageBuilder->build(); |
| 66 | 66 | |
| 67 | -$listOfNameToElapsedTime['fetching'] = PHP_Timer::secondsToTimeString( |
|
| 67 | +$listOfNameToElapsedTime['fetching'] = PHP_Timer::secondsToTimeString( |
|
| 68 | 68 | PHP_Timer::stop() |
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | -$storage = $storageBuilder->andGetStorageAfterTheBuild(); |
|
| 71 | +$storage = $storageBuilder->andGetStorageAfterTheBuild(); |
|
| 72 | 72 | |
| 73 | 73 | dumpSectionIfThereIsSomeContent($storage->getListOfDetail(), 'Detail'); |
| 74 | 74 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | : 'http://testdata.bazzline.net/apache_server_status/index.html' |
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | -$parserBuilder = $parserBuilderFactory->create(); |
|
| 57 | +$parserBuilder = $parserBuilderFactory->create(); |
|
| 58 | 58 | //end of dependencies |
| 59 | 59 | |
| 60 | 60 | //begin of business logic |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | $storageBuilder->selectParseModeAllUpfront(); |
| 65 | 65 | $storageBuilder->build(); |
| 66 | 66 | |
| 67 | -$listOfNameToElapsedTime['fetching'] = PHP_Timer::secondsToTimeString( |
|
| 67 | +$listOfNameToElapsedTime['fetching'] = PHP_Timer::secondsToTimeString( |
|
| 68 | 68 | PHP_Timer::stop() |
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | -$storage = $storageBuilder->andGetStorageAfterTheBuild(); |
|
| 71 | +$storage = $storageBuilder->andGetStorageAfterTheBuild(); |
|
| 72 | 72 | |
| 73 | 73 | dumpSectionIfThereIsSomeContent($storage->getListOfInformation(), 'Information'); |
| 74 | 74 | dumpSectionIfThereIsSomeContent($storage->getListOfDetail(), 'Detail'); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $parserBuilder->setStorageUpfront($storage); |
| 81 | 81 | $parserBuilder->build(); |
| 82 | 82 | |
| 83 | -$listOfNameToElapsedTime['parsing'] = PHP_Timer::secondsToTimeString( |
|
| 83 | +$listOfNameToElapsedTime['parsing'] = PHP_Timer::secondsToTimeString( |
|
| 84 | 84 | PHP_Timer::stop() |
| 85 | 85 | ); |
| 86 | 86 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function setUrl($url) |
| 54 | 54 | { |
| 55 | - $this->url = $url; |
|
| 55 | + $this->url = $url; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | self::STATUS_CODE_HIGHER_THAN_ALLOWED_EXCEPTION_MESSAGE, |
| 83 | 83 | $response->statusCode(), |
| 84 | 84 | $highestAllowedStatusCode, |
| 85 | - implode(', ' , $response->convertIntoAnArray()) |
|
| 85 | + implode(', ', $response->convertIntoAnArray()) |
|
| 86 | 86 | ) |
| 87 | 87 | ); |
| 88 | 88 | } |