@@ -2395,7 +2395,6 @@ |
||
| 2395 | 2395 | } |
| 2396 | 2396 | |
| 2397 | 2397 | /** |
| 2398 | - * @param mixed $value, ... |
|
| 2399 | 2398 | * |
| 2400 | 2399 | * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls |
| 2401 | 2400 | * |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | * @param string $description Additional information about the test |
| 102 | 102 | * @param bool $returnResult Whether to return a result or throw an exception |
| 103 | 103 | * |
| 104 | - * @return mixed |
|
| 104 | + * @return boolean |
|
| 105 | 105 | * |
| 106 | 106 | * @throws PHPUnit_Framework_ExpectationFailedException |
| 107 | 107 | */ |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | throw new PHPUnit_Framework_ExpectationFailedException( |
| 138 | - trim($description . "\n" . $f->getMessage()), |
|
| 138 | + trim($description."\n".$f->getMessage()), |
|
| 139 | 139 | $f |
| 140 | 140 | ); |
| 141 | 141 | } |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
| 470 | - * @param mixed $exceptionName |
|
| 470 | + * @param string $exceptionName |
|
| 471 | 471 | * @param string $exceptionMessageRegExp |
| 472 | 472 | * @param int $exceptionCode |
| 473 | 473 | * |
@@ -1028,6 +1028,7 @@ discard block |
||
| 1028 | 1028 | * Sets the name of a TestCase. |
| 1029 | 1029 | * |
| 1030 | 1030 | * @param string |
| 1031 | + * @param string $name |
|
| 1031 | 1032 | */ |
| 1032 | 1033 | public function setName($name) |
| 1033 | 1034 | { |
@@ -1262,8 +1263,6 @@ discard block |
||
| 1262 | 1263 | * This method is a wrapper for the setlocale() function that automatically |
| 1263 | 1264 | * resets the locale to its original value after the test is run. |
| 1264 | 1265 | * |
| 1265 | - * @param int $category |
|
| 1266 | - * @param string $locale |
|
| 1267 | 1266 | * |
| 1268 | 1267 | * @throws PHPUnit_Framework_Exception |
| 1269 | 1268 | * |
@@ -1774,7 +1773,6 @@ discard block |
||
| 1774 | 1773 | } |
| 1775 | 1774 | |
| 1776 | 1775 | /** |
| 1777 | - * @param mixed $value, ... |
|
| 1778 | 1776 | * |
| 1779 | 1777 | * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls |
| 1780 | 1778 | * |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $this->getName(false) |
| 297 | 297 | ); |
| 298 | 298 | |
| 299 | - return $buffer . $this->getDataSetAsString(); |
|
| 299 | + return $buffer.$this->getDataSetAsString(); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | public function getName($withDataSet = true) |
| 335 | 335 | { |
| 336 | 336 | if ($withDataSet) { |
| 337 | - return $this->name . $this->getDataSetAsString(false); |
|
| 337 | + return $this->name.$this->getDataSetAsString(false); |
|
| 338 | 338 | } else { |
| 339 | 339 | return $this->name; |
| 340 | 340 | } |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | $class = new ReflectionClass($this); |
| 634 | 634 | |
| 635 | 635 | $template = new Text_Template( |
| 636 | - __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl' |
|
| 636 | + __DIR__.'/../Util/PHP/Template/TestCaseMethod.tpl' |
|
| 637 | 637 | ); |
| 638 | 638 | |
| 639 | 639 | if ($this->preserveGlobalState) { |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | } else { |
| 645 | 645 | $constants = ''; |
| 646 | 646 | if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { |
| 647 | - $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export($GLOBALS['__PHPUNIT_BOOTSTRAP'], true) . ";\n"; |
|
| 647 | + $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = '.var_export($GLOBALS['__PHPUNIT_BOOTSTRAP'], true).";\n"; |
|
| 648 | 648 | } else { |
| 649 | 649 | $globals = ''; |
| 650 | 650 | } |
@@ -652,11 +652,11 @@ discard block |
||
| 652 | 652 | $iniSettings = ''; |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | - $coverage = $result->getCollectCodeCoverageInformation() ? 'true' : 'false'; |
|
| 655 | + $coverage = $result->getCollectCodeCoverageInformation() ? 'true' : 'false'; |
|
| 656 | 656 | $isStrictAboutTestsThatDoNotTestAnything = $result->isStrictAboutTestsThatDoNotTestAnything() ? 'true' : 'false'; |
| 657 | - $isStrictAboutOutputDuringTests = $result->isStrictAboutOutputDuringTests() ? 'true' : 'false'; |
|
| 658 | - $isStrictAboutTestSize = $result->isStrictAboutTestSize() ? 'true' : 'false'; |
|
| 659 | - $isStrictAboutTodoAnnotatedTests = $result->isStrictAboutTodoAnnotatedTests() ? 'true' : 'false'; |
|
| 657 | + $isStrictAboutOutputDuringTests = $result->isStrictAboutOutputDuringTests() ? 'true' : 'false'; |
|
| 658 | + $isStrictAboutTestSize = $result->isStrictAboutTestSize() ? 'true' : 'false'; |
|
| 659 | + $isStrictAboutTodoAnnotatedTests = $result->isStrictAboutTodoAnnotatedTests() ? 'true' : 'false'; |
|
| 660 | 660 | |
| 661 | 661 | if (defined('PHPUNIT_COMPOSER_INSTALL')) { |
| 662 | 662 | $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, true); |
@@ -683,11 +683,11 @@ discard block |
||
| 683 | 683 | $codeCoverageFilter = var_export(serialize($codeCoverageFilter), true); |
| 684 | 684 | // must do these fixes because TestCaseMethod.tpl has unserialize('{data}') in it, and we can't break BC |
| 685 | 685 | // the lines above used to use addcslashes() rather than var_export(), which breaks null byte escape sequences |
| 686 | - $data = "'." . $data . ".'"; |
|
| 687 | - $dataName = "'.(" . $dataName . ").'"; |
|
| 688 | - $dependencyInput = "'." . $dependencyInput . ".'"; |
|
| 689 | - $includePath = "'." . $includePath . ".'"; |
|
| 690 | - $codeCoverageFilter = "'." . $codeCoverageFilter . ".'"; |
|
| 686 | + $data = "'.".$data.".'"; |
|
| 687 | + $dataName = "'.(".$dataName.").'"; |
|
| 688 | + $dependencyInput = "'.".$dependencyInput.".'"; |
|
| 689 | + $includePath = "'.".$includePath.".'"; |
|
| 690 | + $codeCoverageFilter = "'.".$codeCoverageFilter.".'"; |
|
| 691 | 691 | |
| 692 | 692 | $configurationFilePath = (isset($GLOBALS['__PHPUNIT_CONFIGURATION_FILE']) ? $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] : ''); |
| 693 | 693 | |
@@ -1302,8 +1302,8 @@ discard block |
||
| 1302 | 1302 | |
| 1303 | 1303 | if ($result === false) { |
| 1304 | 1304 | throw new PHPUnit_Framework_Exception( |
| 1305 | - 'The locale functionality is not implemented on your platform, ' . |
|
| 1306 | - 'the specified locale does not exist or the category name is ' . |
|
| 1305 | + 'The locale functionality is not implemented on your platform, '. |
|
| 1306 | + 'the specified locale does not exist or the category name is '. |
|
| 1307 | 1307 | 'invalid.' |
| 1308 | 1308 | ); |
| 1309 | 1309 | } |
@@ -1850,7 +1850,7 @@ discard block |
||
| 1850 | 1850 | |
| 1851 | 1851 | foreach ($this->dependencies as $dependency) { |
| 1852 | 1852 | if (strpos($dependency, '::') === false) { |
| 1853 | - $dependency = $className . '::' . $dependency; |
|
| 1853 | + $dependency = $className.'::'.$dependency; |
|
| 1854 | 1854 | } |
| 1855 | 1855 | |
| 1856 | 1856 | if (!isset($passedKeys[$dependency])) { |
@@ -1004,6 +1004,7 @@ |
||
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | /** |
| 1007 | + * @param string $message |
|
| 1007 | 1008 | */ |
| 1008 | 1009 | private function showError($message) |
| 1009 | 1010 | { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | try { |
| 149 | 149 | $result = $runner->doRun($suite, $this->arguments); |
| 150 | 150 | } catch (PHPUnit_Framework_Exception $e) { |
| 151 | - print $e->getMessage() . "\n"; |
|
| 151 | + print $e->getMessage()."\n"; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | $ret = PHPUnit_TextUI_TestRunner::FAILURE_EXIT; |
@@ -502,8 +502,8 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | if (isset($this->longOptions[$optionName])) { |
| 504 | 504 | $handler = $this->longOptions[$optionName]; |
| 505 | - } elseif (isset($this->longOptions[$optionName . '='])) { |
|
| 506 | - $handler = $this->longOptions[$optionName . '=']; |
|
| 505 | + } elseif (isset($this->longOptions[$optionName.'='])) { |
|
| 506 | + $handler = $this->longOptions[$optionName.'=']; |
|
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | if (isset($handler) && is_callable(array($this, $handler))) { |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | if (isset($includePath)) { |
| 541 | 541 | ini_set( |
| 542 | 542 | 'include_path', |
| 543 | - $includePath . PATH_SEPARATOR . ini_get('include_path') |
|
| 543 | + $includePath.PATH_SEPARATOR.ini_get('include_path') |
|
| 544 | 544 | ); |
| 545 | 545 | } |
| 546 | 546 | |
@@ -550,15 +550,15 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | if (isset($this->arguments['configuration']) && |
| 552 | 552 | is_dir($this->arguments['configuration'])) { |
| 553 | - $configurationFile = $this->arguments['configuration'] . '/phpunit.xml'; |
|
| 553 | + $configurationFile = $this->arguments['configuration'].'/phpunit.xml'; |
|
| 554 | 554 | |
| 555 | 555 | if (file_exists($configurationFile)) { |
| 556 | 556 | $this->arguments['configuration'] = realpath( |
| 557 | 557 | $configurationFile |
| 558 | 558 | ); |
| 559 | - } elseif (file_exists($configurationFile . '.dist')) { |
|
| 559 | + } elseif (file_exists($configurationFile.'.dist')) { |
|
| 560 | 560 | $this->arguments['configuration'] = realpath( |
| 561 | - $configurationFile . '.dist' |
|
| 561 | + $configurationFile.'.dist' |
|
| 562 | 562 | ); |
| 563 | 563 | } |
| 564 | 564 | } elseif (!isset($this->arguments['configuration']) && |
@@ -578,10 +578,10 @@ discard block |
||
| 578 | 578 | $this->arguments['configuration'] |
| 579 | 579 | ); |
| 580 | 580 | } catch (Throwable $e) { |
| 581 | - print $e->getMessage() . "\n"; |
|
| 581 | + print $e->getMessage()."\n"; |
|
| 582 | 582 | exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT); |
| 583 | 583 | } catch (Exception $e) { |
| 584 | - print $e->getMessage() . "\n"; |
|
| 584 | + print $e->getMessage()."\n"; |
|
| 585 | 585 | exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT); |
| 586 | 586 | } |
| 587 | 587 | |
@@ -601,11 +601,11 @@ discard block |
||
| 601 | 601 | /* |
| 602 | 602 | * Issue #657 |
| 603 | 603 | */ |
| 604 | - if (isset($phpunit['stderr']) && ! isset($this->arguments['stderr'])) { |
|
| 604 | + if (isset($phpunit['stderr']) && !isset($this->arguments['stderr'])) { |
|
| 605 | 605 | $this->arguments['stderr'] = $phpunit['stderr']; |
| 606 | 606 | } |
| 607 | 607 | |
| 608 | - if (isset($phpunit['columns']) && ! isset($this->arguments['columns'])) { |
|
| 608 | + if (isset($phpunit['columns']) && !isset($this->arguments['columns'])) { |
|
| 609 | 609 | $this->arguments['columns'] = $phpunit['columns']; |
| 610 | 610 | } |
| 611 | 611 | |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | $localFilename = realpath($_SERVER['argv'][0]); |
| 793 | 793 | |
| 794 | 794 | if (!is_writable($localFilename)) { |
| 795 | - print 'No write permission to update ' . $localFilename . "\n"; |
|
| 795 | + print 'No write permission to update '.$localFilename."\n"; |
|
| 796 | 796 | exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); |
| 797 | 797 | } |
| 798 | 798 | |
@@ -818,11 +818,11 @@ discard block |
||
| 818 | 818 | ); |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | - $tempFilename = tempnam(sys_get_temp_dir(), 'phpunit') . '.phar'; |
|
| 821 | + $tempFilename = tempnam(sys_get_temp_dir(), 'phpunit').'.phar'; |
|
| 822 | 822 | |
| 823 | 823 | // Workaround for https://bugs.php.net/bug.php?id=65538 |
| 824 | - $caFile = dirname($tempFilename) . '/ca.pem'; |
|
| 825 | - copy(__PHPUNIT_PHAR_ROOT__ . '/ca.pem', $caFile); |
|
| 824 | + $caFile = dirname($tempFilename).'/ca.pem'; |
|
| 825 | + copy(__PHPUNIT_PHAR_ROOT__.'/ca.pem', $caFile); |
|
| 826 | 826 | |
| 827 | 827 | print 'Updating the PHPUnit PHAR ... '; |
| 828 | 828 | |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | if (isset($e)) { |
| 865 | 865 | unlink($caFile); |
| 866 | 866 | unlink($tempFilename); |
| 867 | - print " done\n\n" . $e->getMessage() . "\n"; |
|
| 867 | + print " done\n\n".$e->getMessage()."\n"; |
|
| 868 | 868 | exit(2); |
| 869 | 869 | } |
| 870 | 870 | |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | |
| 885 | 885 | if ($isOutdated) { |
| 886 | 886 | print "You are not using the latest version of PHPUnit.\n"; |
| 887 | - print 'Use "phpunit --self-upgrade" to install PHPUnit ' . $latestVersion . "\n"; |
|
| 887 | + print 'Use "phpunit --self-upgrade" to install PHPUnit '.$latestVersion."\n"; |
|
| 888 | 888 | } else { |
| 889 | 889 | print "You are using the latest version of PHPUnit.\n"; |
| 890 | 890 | } |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | return; |
| 999 | 999 | } |
| 1000 | 1000 | |
| 1001 | - print PHPUnit_Runner_Version::getVersionString() . "\n\n"; |
|
| 1001 | + print PHPUnit_Runner_Version::getVersionString()."\n\n"; |
|
| 1002 | 1002 | |
| 1003 | 1003 | $this->versionStringPrinted = true; |
| 1004 | 1004 | } |
@@ -1009,7 +1009,7 @@ discard block |
||
| 1009 | 1009 | { |
| 1010 | 1010 | $this->printVersionString(); |
| 1011 | 1011 | |
| 1012 | - print $message . "\n"; |
|
| 1012 | + print $message."\n"; |
|
| 1013 | 1013 | |
| 1014 | 1014 | exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT); |
| 1015 | 1015 | } |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | * @param bool $verbose |
| 113 | 113 | * @param string $colors |
| 114 | 114 | * @param bool $debug |
| 115 | - * @param int|string $numberOfColumns |
|
| 115 | + * @param integer $numberOfColumns |
|
| 116 | 116 | * |
| 117 | 117 | * @throws PHPUnit_Framework_Exception |
| 118 | 118 | * |
@@ -31,23 +31,23 @@ |
||
| 31 | 31 | * @var array |
| 32 | 32 | */ |
| 33 | 33 | private static $ansiCodes = array( |
| 34 | - 'bold' => 1, |
|
| 35 | - 'fg-black' => 30, |
|
| 36 | - 'fg-red' => 31, |
|
| 37 | - 'fg-green' => 32, |
|
| 38 | - 'fg-yellow' => 33, |
|
| 39 | - 'fg-blue' => 34, |
|
| 40 | - 'fg-magenta' => 35, |
|
| 41 | - 'fg-cyan' => 36, |
|
| 42 | - 'fg-white' => 37, |
|
| 43 | - 'bg-black' => 40, |
|
| 44 | - 'bg-red' => 41, |
|
| 45 | - 'bg-green' => 42, |
|
| 46 | - 'bg-yellow' => 43, |
|
| 47 | - 'bg-blue' => 44, |
|
| 48 | - 'bg-magenta' => 45, |
|
| 49 | - 'bg-cyan' => 46, |
|
| 50 | - 'bg-white' => 47 |
|
| 34 | + 'bold' => 1, |
|
| 35 | + 'fg-black' => 30, |
|
| 36 | + 'fg-red' => 31, |
|
| 37 | + 'fg-green' => 32, |
|
| 38 | + 'fg-yellow' => 33, |
|
| 39 | + 'fg-blue' => 34, |
|
| 40 | + 'fg-magenta' => 35, |
|
| 41 | + 'fg-cyan' => 36, |
|
| 42 | + 'fg-white' => 37, |
|
| 43 | + 'bg-black' => 40, |
|
| 44 | + 'bg-red' => 41, |
|
| 45 | + 'bg-green' => 42, |
|
| 46 | + 'bg-yellow' => 43, |
|
| 47 | + 'bg-blue' => 44, |
|
| 48 | + 'bg-magenta' => 45, |
|
| 49 | + 'bg-cyan' => 46, |
|
| 50 | + 'bg-white' => 47 |
|
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $this->write((string) $e); |
| 271 | 271 | |
| 272 | 272 | while ($e = $e->getPrevious()) { |
| 273 | - $this->write("\nCaused by\n" . $e); |
|
| 273 | + $this->write("\nCaused by\n".$e); |
|
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | protected function printHeader() |
| 322 | 322 | { |
| 323 | - $this->write("\n\n" . PHP_Timer::resourceUsage() . "\n\n"); |
|
| 323 | + $this->write("\n\n".PHP_Timer::resourceUsage()."\n\n"); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -536,8 +536,8 @@ discard block |
||
| 536 | 536 | if ($this->column == $this->maxColumn) { |
| 537 | 537 | $this->write( |
| 538 | 538 | sprintf( |
| 539 | - ' %' . $this->numTestsWidth . 'd / %' . |
|
| 540 | - $this->numTestsWidth . 'd (%3s%%)', |
|
| 539 | + ' %'.$this->numTestsWidth.'d / %'. |
|
| 540 | + $this->numTestsWidth.'d (%3s%%)', |
|
| 541 | 541 | $this->numTestsRun, |
| 542 | 542 | $this->numTests, |
| 543 | 543 | floor(($this->numTestsRun / $this->numTests) * 100) |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | $styledLines = array(); |
| 586 | 586 | |
| 587 | 587 | foreach ($lines as $line) { |
| 588 | - $styledLines[] = $style . str_pad($line, $padding) . "\x1b[0m"; |
|
| 588 | + $styledLines[] = $style.str_pad($line, $padding)."\x1b[0m"; |
|
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | return implode("\n", $styledLines); |
@@ -1019,7 +1019,7 @@ |
||
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | /** |
| 1022 | - * @param $extension |
|
| 1022 | + * @param string $extension |
|
| 1023 | 1023 | * @param string $message |
| 1024 | 1024 | * |
| 1025 | 1025 | * @since Method available since Release 4.7.3 |
@@ -233,11 +233,11 @@ |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | $this->printer = new $printerClass( |
| 236 | - isset($arguments['stderr']) ? 'php://stderr' : null, |
|
| 237 | - $arguments['verbose'], |
|
| 238 | - $arguments['colors'], |
|
| 239 | - $arguments['debug'], |
|
| 240 | - $arguments['columns'] |
|
| 236 | + isset($arguments['stderr']) ? 'php://stderr' : null, |
|
| 237 | + $arguments['verbose'], |
|
| 238 | + $arguments['colors'], |
|
| 239 | + $arguments['debug'], |
|
| 240 | + $arguments['columns'] |
|
| 241 | 241 | ); |
| 242 | 242 | } |
| 243 | 243 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | if (!$this->printer instanceof PHPUnit_Util_Log_TAP) { |
| 246 | 246 | $this->printer->write( |
| 247 | - PHPUnit_Runner_Version::getVersionString() . "\n" |
|
| 247 | + PHPUnit_Runner_Version::getVersionString()."\n" |
|
| 248 | 248 | ); |
| 249 | 249 | |
| 250 | 250 | self::$versionStringPrinted = true; |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | unset($writer); |
| 461 | 461 | } catch (PHP_CodeCoverage_Exception $e) { |
| 462 | 462 | $this->printer->write( |
| 463 | - " failed\n" . $e->getMessage() . "\n" |
|
| 463 | + " failed\n".$e->getMessage()."\n" |
|
| 464 | 464 | ); |
| 465 | 465 | } |
| 466 | 466 | } |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | unset($writer); |
| 479 | 479 | } catch (PHP_CodeCoverage_Exception $e) { |
| 480 | 480 | $this->printer->write( |
| 481 | - " failed\n" . $e->getMessage() . "\n" |
|
| 481 | + " failed\n".$e->getMessage()."\n" |
|
| 482 | 482 | ); |
| 483 | 483 | } |
| 484 | 484 | } |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | unset($writer); |
| 505 | 505 | } catch (PHP_CodeCoverage_Exception $e) { |
| 506 | 506 | $this->printer->write( |
| 507 | - " failed\n" . $e->getMessage() . "\n" |
|
| 507 | + " failed\n".$e->getMessage()."\n" |
|
| 508 | 508 | ); |
| 509 | 509 | } |
| 510 | 510 | } |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | unset($writer); |
| 523 | 523 | } catch (PHP_CodeCoverage_Exception $e) { |
| 524 | 524 | $this->printer->write( |
| 525 | - " failed\n" . $e->getMessage() . "\n" |
|
| 525 | + " failed\n".$e->getMessage()."\n" |
|
| 526 | 526 | ); |
| 527 | 527 | } |
| 528 | 528 | } |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | unset($writer); |
| 562 | 562 | } catch (PHP_CodeCoverage_Exception $e) { |
| 563 | 563 | $this->printer->write( |
| 564 | - " failed\n" . $e->getMessage() . "\n" |
|
| 564 | + " failed\n".$e->getMessage()."\n" |
|
| 565 | 565 | ); |
| 566 | 566 | } |
| 567 | 567 | } |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | */ |
| 587 | 587 | protected function runFailed($message) |
| 588 | 588 | { |
| 589 | - $this->write($message . PHP_EOL); |
|
| 589 | + $this->write($message.PHP_EOL); |
|
| 590 | 590 | exit(self::FAILURE_EXIT); |
| 591 | 591 | } |
| 592 | 592 | |
@@ -638,8 +638,8 @@ discard block |
||
| 638 | 638 | ); |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | - $arguments['debug'] = isset($arguments['debug']) ? $arguments['debug'] : false; |
|
| 642 | - $arguments['filter'] = isset($arguments['filter']) ? $arguments['filter'] : false; |
|
| 641 | + $arguments['debug'] = isset($arguments['debug']) ? $arguments['debug'] : false; |
|
| 642 | + $arguments['filter'] = isset($arguments['filter']) ? $arguments['filter'] : false; |
|
| 643 | 643 | $arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array(); |
| 644 | 644 | |
| 645 | 645 | if (isset($arguments['configuration'])) { |
@@ -983,39 +983,39 @@ discard block |
||
| 983 | 983 | } |
| 984 | 984 | } |
| 985 | 985 | |
| 986 | - $arguments['addUncoveredFilesFromWhitelist'] = isset($arguments['addUncoveredFilesFromWhitelist']) ? $arguments['addUncoveredFilesFromWhitelist'] : true; |
|
| 986 | + $arguments['addUncoveredFilesFromWhitelist'] = isset($arguments['addUncoveredFilesFromWhitelist']) ? $arguments['addUncoveredFilesFromWhitelist'] : true; |
|
| 987 | 987 | $arguments['processUncoveredFilesFromWhitelist'] = isset($arguments['processUncoveredFilesFromWhitelist']) ? $arguments['processUncoveredFilesFromWhitelist'] : false; |
| 988 | - $arguments['backupGlobals'] = isset($arguments['backupGlobals']) ? $arguments['backupGlobals'] : null; |
|
| 989 | - $arguments['backupStaticAttributes'] = isset($arguments['backupStaticAttributes']) ? $arguments['backupStaticAttributes'] : null; |
|
| 990 | - $arguments['disallowChangesToGlobalState'] = isset($arguments['disallowChangesToGlobalState']) ? $arguments['disallowChangesToGlobalState'] : null; |
|
| 991 | - $arguments['cacheTokens'] = isset($arguments['cacheTokens']) ? $arguments['cacheTokens'] : false; |
|
| 992 | - $arguments['columns'] = isset($arguments['columns']) ? $arguments['columns'] : 80; |
|
| 993 | - $arguments['colors'] = isset($arguments['colors']) ? $arguments['colors'] : PHPUnit_TextUI_ResultPrinter::COLOR_DEFAULT; |
|
| 994 | - $arguments['convertErrorsToExceptions'] = isset($arguments['convertErrorsToExceptions']) ? $arguments['convertErrorsToExceptions'] : true; |
|
| 995 | - $arguments['convertNoticesToExceptions'] = isset($arguments['convertNoticesToExceptions']) ? $arguments['convertNoticesToExceptions'] : true; |
|
| 996 | - $arguments['convertWarningsToExceptions'] = isset($arguments['convertWarningsToExceptions']) ? $arguments['convertWarningsToExceptions'] : true; |
|
| 997 | - $arguments['excludeGroups'] = isset($arguments['excludeGroups']) ? $arguments['excludeGroups'] : array(); |
|
| 998 | - $arguments['groups'] = isset($arguments['groups']) ? $arguments['groups'] : array(); |
|
| 999 | - $arguments['logIncompleteSkipped'] = isset($arguments['logIncompleteSkipped']) ? $arguments['logIncompleteSkipped'] : false; |
|
| 1000 | - $arguments['processIsolation'] = isset($arguments['processIsolation']) ? $arguments['processIsolation'] : false; |
|
| 1001 | - $arguments['repeat'] = isset($arguments['repeat']) ? $arguments['repeat'] : false; |
|
| 1002 | - $arguments['reportHighLowerBound'] = isset($arguments['reportHighLowerBound']) ? $arguments['reportHighLowerBound'] : 90; |
|
| 1003 | - $arguments['reportLowUpperBound'] = isset($arguments['reportLowUpperBound']) ? $arguments['reportLowUpperBound'] : 50; |
|
| 1004 | - $arguments['crap4jThreshold'] = isset($arguments['crap4jThreshold']) ? $arguments['crap4jThreshold'] : 30; |
|
| 1005 | - $arguments['stopOnError'] = isset($arguments['stopOnError']) ? $arguments['stopOnError'] : false; |
|
| 1006 | - $arguments['stopOnFailure'] = isset($arguments['stopOnFailure']) ? $arguments['stopOnFailure'] : false; |
|
| 1007 | - $arguments['stopOnIncomplete'] = isset($arguments['stopOnIncomplete']) ? $arguments['stopOnIncomplete'] : false; |
|
| 1008 | - $arguments['stopOnRisky'] = isset($arguments['stopOnRisky']) ? $arguments['stopOnRisky'] : false; |
|
| 1009 | - $arguments['stopOnSkipped'] = isset($arguments['stopOnSkipped']) ? $arguments['stopOnSkipped'] : false; |
|
| 1010 | - $arguments['timeoutForSmallTests'] = isset($arguments['timeoutForSmallTests']) ? $arguments['timeoutForSmallTests'] : 1; |
|
| 1011 | - $arguments['timeoutForMediumTests'] = isset($arguments['timeoutForMediumTests']) ? $arguments['timeoutForMediumTests'] : 10; |
|
| 1012 | - $arguments['timeoutForLargeTests'] = isset($arguments['timeoutForLargeTests']) ? $arguments['timeoutForLargeTests'] : 60; |
|
| 1013 | - $arguments['reportUselessTests'] = isset($arguments['reportUselessTests']) ? $arguments['reportUselessTests'] : false; |
|
| 1014 | - $arguments['strictCoverage'] = isset($arguments['strictCoverage']) ? $arguments['strictCoverage'] : false; |
|
| 1015 | - $arguments['disallowTestOutput'] = isset($arguments['disallowTestOutput']) ? $arguments['disallowTestOutput'] : false; |
|
| 1016 | - $arguments['enforceTimeLimit'] = isset($arguments['enforceTimeLimit']) ? $arguments['enforceTimeLimit'] : false; |
|
| 1017 | - $arguments['disallowTodoAnnotatedTests'] = isset($arguments['disallowTodoAnnotatedTests']) ? $arguments['disallowTodoAnnotatedTests'] : false; |
|
| 1018 | - $arguments['verbose'] = isset($arguments['verbose']) ? $arguments['verbose'] : false; |
|
| 988 | + $arguments['backupGlobals'] = isset($arguments['backupGlobals']) ? $arguments['backupGlobals'] : null; |
|
| 989 | + $arguments['backupStaticAttributes'] = isset($arguments['backupStaticAttributes']) ? $arguments['backupStaticAttributes'] : null; |
|
| 990 | + $arguments['disallowChangesToGlobalState'] = isset($arguments['disallowChangesToGlobalState']) ? $arguments['disallowChangesToGlobalState'] : null; |
|
| 991 | + $arguments['cacheTokens'] = isset($arguments['cacheTokens']) ? $arguments['cacheTokens'] : false; |
|
| 992 | + $arguments['columns'] = isset($arguments['columns']) ? $arguments['columns'] : 80; |
|
| 993 | + $arguments['colors'] = isset($arguments['colors']) ? $arguments['colors'] : PHPUnit_TextUI_ResultPrinter::COLOR_DEFAULT; |
|
| 994 | + $arguments['convertErrorsToExceptions'] = isset($arguments['convertErrorsToExceptions']) ? $arguments['convertErrorsToExceptions'] : true; |
|
| 995 | + $arguments['convertNoticesToExceptions'] = isset($arguments['convertNoticesToExceptions']) ? $arguments['convertNoticesToExceptions'] : true; |
|
| 996 | + $arguments['convertWarningsToExceptions'] = isset($arguments['convertWarningsToExceptions']) ? $arguments['convertWarningsToExceptions'] : true; |
|
| 997 | + $arguments['excludeGroups'] = isset($arguments['excludeGroups']) ? $arguments['excludeGroups'] : array(); |
|
| 998 | + $arguments['groups'] = isset($arguments['groups']) ? $arguments['groups'] : array(); |
|
| 999 | + $arguments['logIncompleteSkipped'] = isset($arguments['logIncompleteSkipped']) ? $arguments['logIncompleteSkipped'] : false; |
|
| 1000 | + $arguments['processIsolation'] = isset($arguments['processIsolation']) ? $arguments['processIsolation'] : false; |
|
| 1001 | + $arguments['repeat'] = isset($arguments['repeat']) ? $arguments['repeat'] : false; |
|
| 1002 | + $arguments['reportHighLowerBound'] = isset($arguments['reportHighLowerBound']) ? $arguments['reportHighLowerBound'] : 90; |
|
| 1003 | + $arguments['reportLowUpperBound'] = isset($arguments['reportLowUpperBound']) ? $arguments['reportLowUpperBound'] : 50; |
|
| 1004 | + $arguments['crap4jThreshold'] = isset($arguments['crap4jThreshold']) ? $arguments['crap4jThreshold'] : 30; |
|
| 1005 | + $arguments['stopOnError'] = isset($arguments['stopOnError']) ? $arguments['stopOnError'] : false; |
|
| 1006 | + $arguments['stopOnFailure'] = isset($arguments['stopOnFailure']) ? $arguments['stopOnFailure'] : false; |
|
| 1007 | + $arguments['stopOnIncomplete'] = isset($arguments['stopOnIncomplete']) ? $arguments['stopOnIncomplete'] : false; |
|
| 1008 | + $arguments['stopOnRisky'] = isset($arguments['stopOnRisky']) ? $arguments['stopOnRisky'] : false; |
|
| 1009 | + $arguments['stopOnSkipped'] = isset($arguments['stopOnSkipped']) ? $arguments['stopOnSkipped'] : false; |
|
| 1010 | + $arguments['timeoutForSmallTests'] = isset($arguments['timeoutForSmallTests']) ? $arguments['timeoutForSmallTests'] : 1; |
|
| 1011 | + $arguments['timeoutForMediumTests'] = isset($arguments['timeoutForMediumTests']) ? $arguments['timeoutForMediumTests'] : 10; |
|
| 1012 | + $arguments['timeoutForLargeTests'] = isset($arguments['timeoutForLargeTests']) ? $arguments['timeoutForLargeTests'] : 60; |
|
| 1013 | + $arguments['reportUselessTests'] = isset($arguments['reportUselessTests']) ? $arguments['reportUselessTests'] : false; |
|
| 1014 | + $arguments['strictCoverage'] = isset($arguments['strictCoverage']) ? $arguments['strictCoverage'] : false; |
|
| 1015 | + $arguments['disallowTestOutput'] = isset($arguments['disallowTestOutput']) ? $arguments['disallowTestOutput'] : false; |
|
| 1016 | + $arguments['enforceTimeLimit'] = isset($arguments['enforceTimeLimit']) ? $arguments['enforceTimeLimit'] : false; |
|
| 1017 | + $arguments['disallowTodoAnnotatedTests'] = isset($arguments['disallowTodoAnnotatedTests']) ? $arguments['disallowTodoAnnotatedTests'] : false; |
|
| 1018 | + $arguments['verbose'] = isset($arguments['verbose']) ? $arguments['verbose'] : false; |
|
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | /** |
@@ -1030,10 +1030,10 @@ discard block |
||
| 1030 | 1030 | return; |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | - $this->write("Warning:\t" . 'The ' . $extension . ' extension is not loaded' . "\n"); |
|
| 1033 | + $this->write("Warning:\t".'The '.$extension.' extension is not loaded'."\n"); |
|
| 1034 | 1034 | |
| 1035 | 1035 | if (!empty($message)) { |
| 1036 | - $this->write("\t\t" . $message . "\n"); |
|
| 1036 | + $this->write("\t\t".$message."\n"); |
|
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | $this->missingExtensions[$extension] = true; |
@@ -484,6 +484,9 @@ discard block |
||
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | + /** |
|
| 488 | + * @param string $docComment |
|
| 489 | + */ |
|
| 487 | 490 | private static function cleanUpMultiLineAnnotation($docComment) |
| 488 | 491 | { |
| 489 | 492 | //removing initial ' * ' for docComment |
@@ -616,7 +619,7 @@ discard block |
||
| 616 | 619 | * @param string $className |
| 617 | 620 | * @param string $methodName |
| 618 | 621 | * |
| 619 | - * @return bool |
|
| 622 | + * @return boolean|null |
|
| 620 | 623 | * |
| 621 | 624 | * @since Method available since Release 3.4.0 |
| 622 | 625 | */ |
@@ -779,7 +782,7 @@ discard block |
||
| 779 | 782 | * @param string $className |
| 780 | 783 | * @param string $methodName |
| 781 | 784 | * |
| 782 | - * @return bool |
|
| 785 | + * @return boolean|null |
|
| 783 | 786 | * |
| 784 | 787 | * @since Method available since Release 3.4.0 |
| 785 | 788 | */ |
@@ -855,7 +858,7 @@ discard block |
||
| 855 | 858 | * @param string $methodName |
| 856 | 859 | * @param string $settingName |
| 857 | 860 | * |
| 858 | - * @return bool |
|
| 861 | + * @return boolean|null |
|
| 859 | 862 | * |
| 860 | 863 | * @since Method available since Release 3.4.0 |
| 861 | 864 | */ |
@@ -1049,7 +1052,7 @@ discard block |
||
| 1049 | 1052 | /** |
| 1050 | 1053 | * @param ReflectionMethod $method |
| 1051 | 1054 | * |
| 1052 | - * @return bool |
|
| 1055 | + * @return integer |
|
| 1053 | 1056 | * |
| 1054 | 1057 | * @since Method available since Release 4.0.8 |
| 1055 | 1058 | */ |
@@ -1073,7 +1076,7 @@ discard block |
||
| 1073 | 1076 | /** |
| 1074 | 1077 | * @param ReflectionMethod $method |
| 1075 | 1078 | * |
| 1076 | - * @return bool |
|
| 1079 | + * @return integer |
|
| 1077 | 1080 | * |
| 1078 | 1081 | * @since Method available since Release 4.0.8 |
| 1079 | 1082 | */ |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } else { |
| 56 | 56 | if ($test instanceof PHPUnit_Framework_TestCase) { |
| 57 | 57 | return array( |
| 58 | - get_class($test), $test->getName() |
|
| 58 | + get_class($test), $test->getName() |
|
| 59 | 59 | ); |
| 60 | 60 | } elseif ($test instanceof PHPUnit_Framework_SelfDescribing) { |
| 61 | 61 | return array('', $test->toString()); |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | return array( |
| 327 | - 'class' => $class, 'code' => $code, 'message' => $message, 'message_regex' => $messageRegExp |
|
| 327 | + 'class' => $class, 'code' => $code, 'message' => $message, 'message_regex' => $messageRegExp |
|
| 328 | 328 | ); |
| 329 | 329 | } |
| 330 | 330 | |
@@ -522,8 +522,8 @@ discard block |
||
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | return array( |
| 525 | - 'class' => self::$annotationCache[$className], |
|
| 526 | - 'method' => !empty($methodName) ? self::$annotationCache[$className . '::' . $methodName] : array() |
|
| 525 | + 'class' => self::$annotationCache[$className], |
|
| 526 | + 'method' => !empty($methodName) ? self::$annotationCache[$className . '::' . $methodName] : array() |
|
| 527 | 527 | ); |
| 528 | 528 | } |
| 529 | 529 | |
@@ -564,16 +564,16 @@ discard block |
||
| 564 | 564 | public static function getBackupSettings($className, $methodName) |
| 565 | 565 | { |
| 566 | 566 | return array( |
| 567 | - 'backupGlobals' => self::getBooleanAnnotationSetting( |
|
| 568 | - $className, |
|
| 569 | - $methodName, |
|
| 570 | - 'backupGlobals' |
|
| 571 | - ), |
|
| 572 | - 'backupStaticAttributes' => self::getBooleanAnnotationSetting( |
|
| 573 | - $className, |
|
| 574 | - $methodName, |
|
| 575 | - 'backupStaticAttributes' |
|
| 576 | - ) |
|
| 567 | + 'backupGlobals' => self::getBooleanAnnotationSetting( |
|
| 568 | + $className, |
|
| 569 | + $methodName, |
|
| 570 | + 'backupGlobals' |
|
| 571 | + ), |
|
| 572 | + 'backupStaticAttributes' => self::getBooleanAnnotationSetting( |
|
| 573 | + $className, |
|
| 574 | + $methodName, |
|
| 575 | + 'backupStaticAttributes' |
|
| 576 | + ) |
|
| 577 | 577 | ); |
| 578 | 578 | } |
| 579 | 579 | |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | $classShortcut = null; |
| 126 | 126 | |
| 127 | - if (!empty($annotations['class'][$mode . 'DefaultClass'])) { |
|
| 128 | - if (count($annotations['class'][$mode . 'DefaultClass']) > 1) { |
|
| 127 | + if (!empty($annotations['class'][$mode.'DefaultClass'])) { |
|
| 128 | + if (count($annotations['class'][$mode.'DefaultClass']) > 1) { |
|
| 129 | 129 | throw new PHPUnit_Framework_CodeCoverageException( |
| 130 | 130 | sprintf( |
| 131 | 131 | 'More than one @%sClass annotation in class or interface "%s".', |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | ); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $classShortcut = $annotations['class'][$mode . 'DefaultClass'][0]; |
|
| 138 | + $classShortcut = $annotations['class'][$mode.'DefaultClass'][0]; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $list = array(); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | foreach (array_unique($list) as $element) { |
| 154 | 154 | if ($classShortcut && strncmp($element, '::', 2) === 0) { |
| 155 | - $element = $classShortcut . $element; |
|
| 155 | + $element = $classShortcut.$element; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | $element = preg_replace('/[\s()]+$/', '', $element); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $reflector = new ReflectionClass($className); |
| 184 | 184 | $docComment = $reflector->getDocComment(); |
| 185 | 185 | $reflector = new ReflectionMethod($className, $methodName); |
| 186 | - $docComment .= "\n" . $reflector->getDocComment(); |
|
| 186 | + $docComment .= "\n".$reflector->getDocComment(); |
|
| 187 | 187 | $requires = array(); |
| 188 | 188 | |
| 189 | 189 | if ($count = preg_match_all(self::REGEX_REQUIRES_OS, $docComment, $matches)) { |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | if ($count = preg_match_all(self::REGEX_REQUIRES, $docComment, $matches)) { |
| 205 | 205 | for ($i = 0; $i < $count; $i++) { |
| 206 | - $name = $matches['name'][$i] . 's'; |
|
| 206 | + $name = $matches['name'][$i].'s'; |
|
| 207 | 207 | if (!isset($requires[$name])) { |
| 208 | 208 | $requires[$name] = array(); |
| 209 | 209 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | throw new PHPUnit_Framework_Exception( |
| 391 | 391 | sprintf( |
| 392 | 392 | 'Data set %s is invalid.', |
| 393 | - is_int($key) ? '#' . $key : '"' . $key . '"' |
|
| 393 | + is_int($key) ? '#'.$key : '"'.$key.'"' |
|
| 394 | 394 | ) |
| 395 | 395 | ); |
| 396 | 396 | } |
@@ -420,13 +420,13 @@ discard block |
||
| 420 | 420 | $dataProviderMethodName = array_pop($leaf); |
| 421 | 421 | |
| 422 | 422 | if (!empty($dataProviderMethodNameNamespace)) { |
| 423 | - $dataProviderMethodNameNamespace = implode('\\', $dataProviderMethodNameNamespace) . '\\'; |
|
| 423 | + $dataProviderMethodNameNamespace = implode('\\', $dataProviderMethodNameNamespace).'\\'; |
|
| 424 | 424 | } else { |
| 425 | 425 | $dataProviderMethodNameNamespace = ''; |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | if (!empty($leaf)) { |
| 429 | - $dataProviderClassName = $dataProviderMethodNameNamespace . array_pop($leaf); |
|
| 429 | + $dataProviderClassName = $dataProviderMethodNameNamespace.array_pop($leaf); |
|
| 430 | 430 | } else { |
| 431 | 431 | $dataProviderClassName = $className; |
| 432 | 432 | } |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | private static function cleanUpMultiLineAnnotation($docComment) |
| 488 | 488 | { |
| 489 | 489 | //removing initial ' * ' for docComment |
| 490 | - $docComment = preg_replace('/' . '\n' . '\s*' . '\*' . '\s?' . '/', "\n", $docComment); |
|
| 490 | + $docComment = preg_replace('/'.'\n'.'\s*'.'\*'.'\s?'.'/', "\n", $docComment); |
|
| 491 | 491 | $docComment = substr($docComment, 0, -1); |
| 492 | 492 | $docComment = rtrim($docComment, "\n"); |
| 493 | 493 | |
@@ -511,19 +511,19 @@ discard block |
||
| 511 | 511 | self::$annotationCache[$className] = self::parseAnnotations($class->getDocComment()); |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | - if (!empty($methodName) && !isset(self::$annotationCache[$className . '::' . $methodName])) { |
|
| 514 | + if (!empty($methodName) && !isset(self::$annotationCache[$className.'::'.$methodName])) { |
|
| 515 | 515 | try { |
| 516 | 516 | $method = new ReflectionMethod($className, $methodName); |
| 517 | 517 | $annotations = self::parseAnnotations($method->getDocComment()); |
| 518 | 518 | } catch (ReflectionException $e) { |
| 519 | 519 | $annotations = array(); |
| 520 | 520 | } |
| 521 | - self::$annotationCache[$className . '::' . $methodName] = $annotations; |
|
| 521 | + self::$annotationCache[$className.'::'.$methodName] = $annotations; |
|
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | return array( |
| 525 | 525 | 'class' => self::$annotationCache[$className], |
| 526 | - 'method' => !empty($methodName) ? self::$annotationCache[$className . '::' . $methodName] : array() |
|
| 526 | + 'method' => !empty($methodName) ? self::$annotationCache[$className.'::'.$methodName] : array() |
|
| 527 | 527 | ); |
| 528 | 528 | } |
| 529 | 529 | |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | !interface_exists($className)) { |
| 914 | 914 | throw new PHPUnit_Framework_InvalidCoversTargetException( |
| 915 | 915 | sprintf( |
| 916 | - 'Trying to @cover or @use not existing class or ' . |
|
| 916 | + 'Trying to @cover or @use not existing class or '. |
|
| 917 | 917 | 'interface "%s".', |
| 918 | 918 | $className |
| 919 | 919 | ) |
@@ -993,7 +993,7 @@ discard block |
||
| 993 | 993 | !trait_exists($className)) { |
| 994 | 994 | throw new PHPUnit_Framework_InvalidCoversTargetException( |
| 995 | 995 | sprintf( |
| 996 | - 'Trying to @cover or @use not existing class or ' . |
|
| 996 | + 'Trying to @cover or @use not existing class or '. |
|
| 997 | 997 | 'interface "%s".', |
| 998 | 998 | $className |
| 999 | 999 | ) |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * Returns the bank account's balance. |
| 31 | 31 | * |
| 32 | - * @return float |
|
| 32 | + * @return integer |
|
| 33 | 33 | */ |
| 34 | 34 | public function getBalance() |
| 35 | 35 | { |
@@ -11,6 +11,9 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | private $_apiBase; |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param string $apiBase |
|
| 16 | + */ |
|
| 14 | 17 | public function __construct($apiKey = null, $apiBase = null) |
| 15 | 18 | { |
| 16 | 19 | $this->_apiKey = $apiKey; |
@@ -140,6 +143,10 @@ discard block |
||
| 140 | 143 | } |
| 141 | 144 | } |
| 142 | 145 | |
| 146 | + /** |
|
| 147 | + * @param string $method |
|
| 148 | + * @param string $url |
|
| 149 | + */ |
|
| 143 | 150 | private function _requestRaw($method, $url, $params, $headers) |
| 144 | 151 | { |
| 145 | 152 | $myApiKey = $this->_apiKey; |
@@ -221,6 +228,9 @@ discard block |
||
| 221 | 228 | return $resp; |
| 222 | 229 | } |
| 223 | 230 | |
| 231 | + /** |
|
| 232 | + * @param string $absUrl |
|
| 233 | + */ |
|
| 224 | 234 | private function _curlRequest($method, $absUrl, $headers, $params) |
| 225 | 235 | { |
| 226 | 236 | $curl = curl_init(); |
@@ -305,7 +315,7 @@ discard block |
||
| 305 | 315 | } |
| 306 | 316 | |
| 307 | 317 | /** |
| 308 | - * @param number $errno |
|
| 318 | + * @param integer $errno |
|
| 309 | 319 | * @param string $message |
| 310 | 320 | * @throws ApiConnectionError |
| 311 | 321 | */ |
@@ -30,8 +30,9 @@ |
||
| 30 | 30 | return 'false'; |
| 31 | 31 | } else if (is_array($d)) { |
| 32 | 32 | $res = array(); |
| 33 | - foreach ($d as $k => $v) |
|
| 34 | - $res[$k] = self::_encodeObjects($v, $is_post); |
|
| 33 | + foreach ($d as $k => $v) { |
|
| 34 | + $res[$k] = self::_encodeObjects($v, $is_post); |
|
| 35 | + } |
|
| 35 | 36 | return $res; |
| 36 | 37 | } else { |
| 37 | 38 | return Util\Util::utf8($d); |
@@ -313,22 +313,22 @@ |
||
| 313 | 313 | { |
| 314 | 314 | $apiBase = Pingpp::$apiBase; |
| 315 | 315 | switch ($errno) { |
| 316 | - case CURLE_COULDNT_CONNECT: |
|
| 317 | - case CURLE_COULDNT_RESOLVE_HOST: |
|
| 318 | - case CURLE_OPERATION_TIMEOUTED: |
|
| 319 | - $msg = "Could not connect to Ping++ ($apiBase). Please check your " |
|
| 320 | - . "internet connection and try again. If this problem persists, " |
|
| 321 | - . "you should check Pingpp's service status at " |
|
| 322 | - . "https://pingxx.com/status."; |
|
| 323 | - break; |
|
| 324 | - case CURLE_SSL_CACERT: |
|
| 325 | - case CURLE_SSL_PEER_CERTIFICATE: |
|
| 326 | - $msg = "Could not verify Ping++'s SSL certificate. Please make sure " |
|
| 327 | - . "that your network is not intercepting certificates. " |
|
| 328 | - . "(Try going to $apiBase in your browser.)"; |
|
| 329 | - break; |
|
| 330 | - default: |
|
| 331 | - $msg = "Unexpected error communicating with Ping++."; |
|
| 316 | + case CURLE_COULDNT_CONNECT: |
|
| 317 | + case CURLE_COULDNT_RESOLVE_HOST: |
|
| 318 | + case CURLE_OPERATION_TIMEOUTED: |
|
| 319 | + $msg = "Could not connect to Ping++ ($apiBase). Please check your " |
|
| 320 | + . "internet connection and try again. If this problem persists, " |
|
| 321 | + . "you should check Pingpp's service status at " |
|
| 322 | + . "https://pingxx.com/status."; |
|
| 323 | + break; |
|
| 324 | + case CURLE_SSL_CACERT: |
|
| 325 | + case CURLE_SSL_PEER_CERTIFICATE: |
|
| 326 | + $msg = "Could not verify Ping++'s SSL certificate. Please make sure " |
|
| 327 | + . "that your network is not intercepting certificates. " |
|
| 328 | + . "(Try going to $apiBase in your browser.)"; |
|
| 329 | + break; |
|
| 330 | + default: |
|
| 331 | + $msg = "Unexpected error communicating with Ping++."; |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | $msg .= "\n\n(Network error [errno $errno]: $message)"; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | throw new Error\Authentication($msg); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - $absUrl = $this->_apiBase . $url; |
|
| 158 | + $absUrl = $this->_apiBase.$url; |
|
| 159 | 159 | $params = self::_encodeObjects($params, $method == 'post'); |
| 160 | 160 | $langVersion = phpversion(); |
| 161 | 161 | $uname = php_uname(); |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | ); |
| 169 | 169 | $defaultHeaders = array( |
| 170 | 170 | 'X-Pingpp-Client-User-Agent' => json_encode($ua), |
| 171 | - 'User-Agent' => 'Pingpp/v1 PhpBindings/' . Pingpp::VERSION, |
|
| 172 | - 'Authorization' => 'Bearer ' . $myApiKey |
|
| 171 | + 'User-Agent' => 'Pingpp/v1 PhpBindings/'.Pingpp::VERSION, |
|
| 172 | + 'Authorization' => 'Bearer '.$myApiKey |
|
| 173 | 173 | ); |
| 174 | 174 | if (Pingpp::$apiVersion) { |
| 175 | 175 | $defaultHeaders['Pingplusplus-Version'] = Pingpp::$apiVersion; |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $rawHeaders = array(); |
| 194 | 194 | |
| 195 | 195 | foreach ($combinedHeaders as $header => $value) { |
| 196 | - $rawHeaders[] = $header . ': ' . $value; |
|
| 196 | + $rawHeaders[] = $header.': '.$value; |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | list($rbody, $rcode) = $this->_curlRequest( |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if ($requestSignature) { |
| 261 | - $headers[] = 'Pingplusplus-Signature: ' . base64_encode($requestSignature); |
|
| 261 | + $headers[] = 'Pingplusplus-Signature: '.base64_encode($requestSignature); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | $absUrl = Util\Util::utf8($absUrl); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | $rbody = curl_exec($curl); |
| 276 | 276 | |
| 277 | 277 | if (!defined('CURLE_SSL_CACERT_BADFILE')) { |
| 278 | - define('CURLE_SSL_CACERT_BADFILE', 77); // constant not defined in PHP |
|
| 278 | + define('CURLE_SSL_CACERT_BADFILE', 77); // constant not defined in PHP |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | $errno = curl_errno($curl); |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | private function caBundle() |
| 339 | 339 | { |
| 340 | - return dirname(__FILE__) . '/../data/ca-certificates.crt'; |
|
| 340 | + return dirname(__FILE__).'/../data/ca-certificates.crt'; |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | private function privateKey() |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | return NULL; |
| 348 | 348 | } |
| 349 | 349 | if (!file_exists(Pingpp::$privateKeyPath)) { |
| 350 | - throw new Error\Api('Private key file not found at: ' . Pingpp::$privateKeyPath); |
|
| 350 | + throw new Error\Api('Private key file not found at: '.Pingpp::$privateKeyPath); |
|
| 351 | 351 | } |
| 352 | 352 | Pingpp::$privateKey = file_get_contents(Pingpp::$privateKeyPath); |
| 353 | 353 | } |