Changeset 32151
- Timestamp:
- 02/27/11 21:15:06 (2 years ago)
- Files:
-
- branches/2.0/src/Symfony/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php (modified) (1 diff)
- branches/2.0/src/Symfony/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Bundle/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php (modified) (1 diff)
- branches/2.0/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/LoadDataFixturesDoctrineODMCommand.php (modified) (1 diff)
- branches/2.0/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php (modified) (1 diff)
- branches/2.0/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/BrowserKit/Response.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Console/Application.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Component/Console/Command/Command.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Console/Helper/DialogHelper.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Console/Input/ArgvInput.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Console/Output/StreamOutput.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/CssSelector/Node/AttribNode.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Component/Form/ChoiceField.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Form/Form.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Form/HybridField.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Component/Form/PropertyPath.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/HttpFoundation/File/File.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Component/HttpFoundation/FileBag.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Component/HttpFoundation/HeaderBag.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/HttpFoundation/Request.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/HttpFoundation/SessionStorage/PdoSessionStorage.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/HttpKernel/HttpCache/Store.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Security/Acl/Domain/PermissionGrantingStrategy.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Security/Acl/Voter/AclVoter.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Security/Core/Encoder/PlaintextPasswordEncoder.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Security/Core/Exception/NonceExpiredException.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Templating/PhpEngine.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Templating/TemplateReference.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Translation/Interval.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Yaml/Parser.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/BrowserKit/ClientTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/Config/Loader/DelegatingLoaderTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/Console/Input/InputArgumentTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/Console/Input/InputDefinitionTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/Console/Input/InputOptionTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/ClosureLoaderTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/PhpFileLoaderTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/XmlFileLoaderTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/YamlFileLoaderTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/Templating/Loader/LoaderTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/Templating/Storage/StorageTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.0/src/Symfony/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php
r31979 r32151 18 18 use Symfony\Component\Console\Output\Output; 19 19 use Symfony\Bundle\FrameworkBundle\Util\Filesystem; 20 use Doctrine\Common\Cli\Configuration;21 use Doctrine\Common\Cli\CliController as DoctrineCliController;22 20 use Doctrine\DBAL\Connection; 23 21 branches/2.0/src/Symfony/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php
r32076 r32151 18 18 use Symfony\Component\Console\Output\Output; 19 19 use Symfony\Bundle\FrameworkBundle\Util\Filesystem; 20 use Doctrine\Common\Cli\Configuration;21 use Doctrine\Common\Cli\CliController as DoctrineCliController;22 20 use Doctrine\DBAL\Connection; 23 21 … … 75 73 } else { 76 74 $output->writeln(sprintf('<info>Would drop the database named <comment>%s</comment>.</info>', $name)); 77 $output->writeln( sprintf('<error>All data will be lost!</error>', $name));75 $output->writeln('<error>All data will be lost!</error>'); 78 76 } 79 77 } branches/2.0/src/Symfony/Bundle/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php
r32076 r32151 20 20 use Symfony\Bundle\FrameworkBundle\Util\Filesystem; 21 21 use Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures\Loader as DataFixturesLoader; 22 use Doctrine\Common\Cli\Configuration;23 use Doctrine\Common\Cli\CliController as DoctrineCliController;24 22 use Doctrine\Common\DataFixtures\Executor\ORMExecutor; 25 23 use Doctrine\Common\DataFixtures\Purger\ORMPurger; branches/2.0/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/LoadDataFixturesDoctrineODMCommand.php
r32076 r32151 20 20 use Symfony\Bundle\FrameworkBundle\Util\Filesystem; 21 21 use Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures\Loader as DataFixturesLoader; 22 use Doctrine\Common\Cli\Configuration;23 use Doctrine\Common\Cli\CliController as DoctrineCliController;24 22 use Doctrine\Common\DataFixtures\Executor\MongoDBExecutor; 25 23 use Doctrine\Common\DataFixtures\Purger\MongoDBPurger; branches/2.0/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
r31885 r32151 160 160 if (is_object($value)) { 161 161 return sprintf('object(%s)', get_class($value)); 162 } else {163 return preg_replace("/\n\s*/s", '', var_export($value, true));164 162 } 163 164 return preg_replace("/\n\s*/s", '', var_export($value, true)); 165 165 } 166 166 } branches/2.0/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php
r31979 r32151 67 67 if (false === $value || null === $value || ('' === $value && 'value' != $name)) { 68 68 return ''; 69 } else {70 return ' '.$this->attribute($name, $value);71 69 } 70 71 return ' '.$this->attribute($name, $value); 72 72 } 73 73 branches/2.0/src/Symfony/Component/BrowserKit/Response.php
r32076 r32151 119 119 if ($first) { 120 120 return is_array($value) ? (count($value) ? $value[0] : '') : $value; 121 } else {122 return is_array($value) ? $value : array($value);123 121 } 122 123 return is_array($value) ? $value : array($value); 124 124 } 125 125 } branches/2.0/src/Symfony/Component/Console/Application.php
r32076 r32151 130 130 exit($statusCode); 131 131 // @codeCoverageIgnoreEnd 132 } else {133 return $statusCode; 134 }132 } 133 134 return $statusCode; 135 135 } 136 136 … … 316 316 if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { 317 317 return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion()); 318 } else {319 return '<info>Console Tool</info>'; 320 }318 } 319 320 return '<info>Console Tool</info>'; 321 321 } 322 322 branches/2.0/src/Symfony/Component/Console/Command/Command.php
r31885 r32151 160 160 if ($this->code) { 161 161 return call_user_func($this->code, $input, $output); 162 } else {163 return $this->execute($input, $output); 164 }162 } 163 164 return $this->execute($input, $output); 165 165 } 166 166 branches/2.0/src/Symfony/Component/Console/Helper/DialogHelper.php
r31885 r32151 62 62 if (false === $default) { 63 63 return $answer && 'y' == strtolower($answer[0]); 64 } else {65 return !$answer || 'y' == strtolower($answer[0]);66 64 } 65 66 return !$answer || 'y' == strtolower($answer[0]); 67 67 // @codeCoverageIgnoreEnd 68 68 } branches/2.0/src/Symfony/Component/Console/Input/ArgvInput.php
r32076 r32151 276 276 if (false !== $pos = strpos($token, '=')) { 277 277 return substr($token, $pos + 1); 278 } else {279 return array_shift($tokens);280 278 } 279 280 return array_shift($tokens); 281 281 } 282 282 } branches/2.0/src/Symfony/Component/Console/Output/StreamOutput.php
r31898 r32151 98 98 if (DIRECTORY_SEPARATOR == '\\') { 99 99 return false !== getenv('ANSICON'); 100 } else {101 return function_exists('posix_isatty') && @posix_isatty($this->stream);102 100 } 101 102 return function_exists('posix_isatty') && @posix_isatty($this->stream); 103 103 // @codeCoverageIgnoreEnd 104 104 } branches/2.0/src/Symfony/Component/CssSelector/Node/AttribNode.php
r32076 r32151 56 56 if ($this->operator == 'exists') { 57 57 return sprintf('%s[%s[%s]]', __CLASS__, $this->selector, $this->formatAttrib()); 58 } else {59 return sprintf('%s[%s[%s %s %s]]', __CLASS__, $this->selector, $this->formatAttrib(), $this->operator, $this->value);60 58 } 59 60 return sprintf('%s[%s[%s %s %s]]', __CLASS__, $this->selector, $this->formatAttrib(), $this->operator, $this->value); 61 61 } 62 62 branches/2.0/src/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php
r32076 r32151 80 80 } else if (is_string($value)) { 81 81 return $this->resolveString($value); 82 } else {83 return $value;84 82 } 83 84 return $value; 85 85 } 86 86 branches/2.0/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
r32076 r32151 467 467 if (is_object($callable[0]) && $callable[0] instanceof Reference) { 468 468 return sprintf(" %s->%s(\$%s);\n", $this->getServiceCall((string) $callable[0]), $callable[1], $variableName); 469 } else {470 return sprintf(" call_user_func(array(%s, '%s'), \$%s);\n", $this->dumpValue($callable[0]), $callable[1], $variableName); 471 }472 } else {473 return sprintf(" %s(\$%s);\n", $callable, $variableName); 474 }469 } 470 471 return sprintf(" call_user_func(array(%s, '%s'), \$%s);\n", $this->dumpValue($callable[0]), $callable[1], $variableName); 472 } 473 474 return sprintf(" %s(\$%s);\n", $callable, $variableName); 475 475 } 476 476 branches/2.0/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
r32076 r32151 207 207 } elseif (is_object($value) || is_resource($value)) { 208 208 throw new \RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); 209 } else {210 return $value; 211 }209 } 210 211 return $value; 212 212 } 213 213 … … 223 223 if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { 224 224 return sprintf('@?%s', $id); 225 } else {226 return sprintf('@%s', $id); 227 }225 } 226 227 return sprintf('@%s', $id); 228 228 } 229 229 branches/2.0/src/Symfony/Component/Form/ChoiceField.php
r32076 r32151 206 206 'value' => $choice, 207 207 )); 208 } else {209 return new RadioField($choice, array( 210 'value' => $choice,211 ));212 }208 } 209 210 return new RadioField($choice, array( 211 'value' => $choice, 212 )); 213 213 } 214 214 branches/2.0/src/Symfony/Component/Form/Form.php
r32076 r32151 837 837 838 838 return $length > $max; 839 } else {840 return false; 841 }839 } 840 841 return false; 842 842 } 843 843 branches/2.0/src/Symfony/Component/Form/HybridField.php
r32076 r32151 96 96 if ($this->mode === self::FORM) { 97 97 return parent::getDisplayedData(); 98 } else {99 return Field::getDisplayedData();100 98 } 99 100 return Field::getDisplayedData(); 101 101 } 102 102 … … 132 132 if ($this->mode === self::FORM) { 133 133 return parent::isEmpty(); 134 } else {135 return Field::isEmpty();136 134 } 135 136 return Field::isEmpty(); 137 137 } 138 138 } branches/2.0/src/Symfony/Component/Form/PropertyPath.php
r31979 r32151 247 247 if ($currentIndex < $this->length) { 248 248 return $this->readPropertyPath($value, $currentIndex); 249 } else {250 return $value; 251 }249 } 250 251 return $value; 252 252 } 253 253 branches/2.0/src/Symfony/Component/HttpFoundation/File/File.php
r32148 r32151 520 520 if ($ext = pathinfo($this->getName(), \PATHINFO_EXTENSION)) { 521 521 return '.' . $ext; 522 } else {523 return ''; 524 }522 } 523 524 return ''; 525 525 } 526 526 … … 538 538 if (isset(self::$defaultExtensions[$type])) { 539 539 return '.' . self::$defaultExtensions[$type]; 540 } else {541 return $this->getExtension(); 542 }540 } 541 542 return $this->getExtension(); 543 543 } 544 544 branches/2.0/src/Symfony/Component/HttpFoundation/FileBag.php
r32076 r32151 87 87 if ($keys != $this->fileKeys) { 88 88 $file = array_map(array($this, 'convertFileInformation'), $file); 89 } else 89 } else { 90 90 if ($file['error'] === UPLOAD_ERR_NO_FILE) { 91 91 $file = null; … … 94 94 $file['type'], $file['size'], $file['error']); 95 95 } 96 } 96 97 } 97 98 return $file; branches/2.0/src/Symfony/Component/HttpFoundation/HeaderBag.php
r32076 r32151 97 97 if (null === $default) { 98 98 return $first ? null : array(); 99 } else {100 return $first ? $default : array($default);101 99 } 100 101 return $first ? $default : array($default); 102 102 } 103 103 104 104 if ($first) { 105 105 return count($this->headers[$key]) ? $this->headers[$key][0] : $default; 106 } else {107 return $this->headers[$key]; 108 }106 } 107 108 return $this->headers[$key]; 109 109 } 110 110 branches/2.0/src/Symfony/Component/HttpFoundation/Request.php
r32076 r32151 437 437 if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) { 438 438 return $name; 439 } else {440 return $name.':'.$port; 441 }439 } 440 441 return $name.':'.$port; 442 442 } 443 443 branches/2.0/src/Symfony/Component/HttpFoundation/SessionStorage/PdoSessionStorage.php
r31979 r32151 172 172 if (count($sessionRows) == 1) { 173 173 return $sessionRows[0][0]; 174 } else {175 // session does not exist, create it176 $sql = 'INSERT INTO '.$db_table.'('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (?, ?, ?)';177 178 $stmt = $this->db->prepare($sql);179 $stmt->bindParam(1, $id, \PDO::PARAM_STR);180 $stmt->bindValue(2, '', \PDO::PARAM_STR);181 $stmt->bindValue(3, time(), \PDO::PARAM_INT);182 $stmt->execute();183 184 return '';185 174 } 175 176 // session does not exist, create it 177 $sql = 'INSERT INTO '.$db_table.'('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (?, ?, ?)'; 178 179 $stmt = $this->db->prepare($sql); 180 $stmt->bindParam(1, $id, \PDO::PARAM_STR); 181 $stmt->bindValue(2, '', \PDO::PARAM_STR); 182 $stmt->bindValue(3, time(), \PDO::PARAM_INT); 183 $stmt->execute(); 184 185 return ''; 186 186 } catch (\PDOException $e) { 187 187 throw new \RuntimeException(sprintf('PDOException was thrown when trying to manipulate session data: %s', $e->getMessage()), 0, $e); branches/2.0/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
r32101 r32151 457 457 // server the stale response while there is a revalidation 458 458 return true; 459 } 460 461 // wait for the lock to be released 462 $wait = 0; 463 while (file_exists($lock) && $wait < 5000000) { 464 usleep($wait += 50000); 465 } 466 467 if ($wait < 2000000) { 468 // replace the current entry with the fresh one 469 $new = $this->lookup($request); 470 $entry->headers = $new->headers; 471 $entry->setContent($new->getContent()); 472 $entry->setStatusCode($new->getStatusCode()); 473 $entry->setProtocolVersion($new->getProtocolVersion()); 474 $entry->setCookies($new->getCookies()); 459 475 } else { 460 // wait for the lock to be released 461 $wait = 0; 462 while (file_exists($lock) && $wait < 5000000) { 463 usleep($wait += 50000); 464 } 465 466 if ($wait < 2000000) { 467 // replace the current entry with the fresh one 468 $new = $this->lookup($request); 469 $entry->headers = $new->headers; 470 $entry->setContent($new->getContent()); 471 $entry->setStatusCode($new->getStatusCode()); 472 $entry->setProtocolVersion($new->getProtocolVersion()); 473 $entry->setCookies($new->getCookies()); 474 475 return true; 476 } else { 477 // backend is slow as hell, send a 503 response (to avoid the dog pile effect) 478 $entry->setStatusCode(503); 479 $entry->setContent('503 Service Unavailable'); 480 $entry->headers->set('Retry-After', 10); 481 482 return true; 483 } 484 } 476 // backend is slow as hell, send a 503 response (to avoid the dog pile effect) 477 $entry->setStatusCode(503); 478 $entry->setContent('503 Service Unavailable'); 479 $entry->headers->set('Retry-After', 10); 480 } 481 482 return true; 485 483 } 486 484 branches/2.0/src/Symfony/Component/HttpKernel/HttpCache/Store.php
r31979 r32151 79 79 80 80 return true; 81 } else {82 return $path; 83 }81 } 82 83 return $path; 84 84 } 85 85 … … 126 126 if (file_exists($body = $this->getPath($headers['x-content-digest'][0]))) { 127 127 return $this->restoreResponse($headers, $body); 128 } else {129 // TODO the metaStore referenced an entity that doesn't exist in 130 // the entityStore. We definitely want to return nil but we should131 // also purge the entry from the meta-store when this is detected.132 return null;133 }128 } 129 130 // TODO the metaStore referenced an entity that doesn't exist in 131 // the entityStore. We definitely want to return nil but we should 132 // also purge the entry from the meta-store when this is detected. 133 return null; 134 134 } 135 135 branches/2.0/src/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php
r32087 r32151 74 74 if (isset($data[0]['data'])) { 75 75 return array($data[0]['data'], $data[0]['ip'], $data[0]['url'], $data[0]['time']); 76 } else {77 return false; 78 }76 } 77 78 return false; 79 79 } 80 80 branches/2.0/src/Symfony/Component/Security/Acl/Domain/PermissionGrantingStrategy.php
r32076 r32151 221 221 } else if (self::EQUAL === $strategy) { 222 222 return $requiredMask === $ace->getMask(); 223 } else {224 throw new \RuntimeException(sprintf('The strategy "%s" is not supported.', $strategy)); 225 }223 } 224 225 throw new \RuntimeException(sprintf('The strategy "%s" is not supported.', $strategy)); 226 226 } 227 227 } branches/2.0/src/Symfony/Component/Security/Acl/Voter/AclVoter.php
r31979 r32151 112 112 113 113 return self::ACCESS_GRANTED; 114 } else { 115 if (null !== $this->logger) { 116 $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.'); 117 } 114 } 118 115 119 return self::ACCESS_DENIED; 116 if (null !== $this->logger) { 117 $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.'); 120 118 } 119 120 return self::ACCESS_DENIED; 121 121 } catch (NoAceFoundException $noAce) { 122 122 if (null !== $this->logger) { branches/2.0/src/Symfony/Component/Security/Core/Encoder/PlaintextPasswordEncoder.php
r31979 r32151 43 43 if (!$this->ignorePasswordCase) { 44 44 return $this->comparePasswords($encoded, $pass2); 45 } else {46 return $this->comparePasswords(strtolower($encoded), strtolower($pass2));47 45 } 46 47 return $this->comparePasswords(strtolower($encoded), strtolower($pass2)); 48 48 } 49 49 } branches/2.0/src/Symfony/Component/Security/Core/Exception/NonceExpiredException.php
r31979 r32151 10 10 */ 11 11 12 namespace Symfony\Component\ HttpKernel\Security\EntryPoint;12 namespace Symfony\Component\Security\Core\Exception; 13 13 14 14 use Symfony\Component\Security\Core\Exception\AuthenticationException; branches/2.0/src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php
r32091 r32151 199 199 200 200 return $event->getSubject()->handle($subRequest, HttpKernelInterface::SUB_REQUEST); 201 } else {202 if (null !== $this->logger) { 203 $this->logger->debug(sprintf('Redirecting to %s', $this->options['failure_path']));204 }205 206 $request->getSession()->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed); 207 208 return new RedirectResponse(0 !== strpos($this->options['failure_path'], 'http') ? $request->getUriForPath($this->options['failure_path']) : $this->options['failure_path'], 302); 209 }201 } 202 203 if (null !== $this->logger) { 204 $this->logger->debug(sprintf('Redirecting to %s', $this->options['failure_path'])); 205 } 206 207 $request->getSession()->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed); 208 209 return new RedirectResponse(0 !== strpos($this->options['failure_path'], 'http') ? $request->getUriForPath($this->options['failure_path']) : $this->options['failure_path'], 302); 210 210 } 211 211 branches/2.0/src/Symfony/Component/Templating/PhpEngine.php
r32076 r32151 461 461 } elseif (function_exists('mb_convert_encoding')) { 462 462 return mb_convert_encoding($string, $to, $from); 463 } else {464 throw new \RuntimeException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).'); 465 }463 } 464 465 throw new \RuntimeException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).'); 466 466 } 467 467 branches/2.0/src/Symfony/Component/Templating/TemplateReference.php
r32094 r32151 63 63 if (array_key_exists($name, $this->parameters)) { 64 64 return $this->parameters[$name]; 65 } else {66 throw new \InvalidArgumentException(sprintf('The template does not support the "%s" parameter.', $name));67 65 } 66 67 throw new \InvalidArgumentException(sprintf('The template does not support the "%s" parameter.', $name)); 68 68 } 69 69 branches/2.0/src/Symfony/Component/Translation/Interval.php
r31885 r32151 97 97 } elseif ('+Inf' === $number || 'Inf' === $number) { 98 98 return -log(0); 99 } else {100 return (int) $number;101 99 } 100 101 return (int) $number; 102 102 } 103 103 } branches/2.0/src/Symfony/Component/Yaml/Parser.php
r32087 r32151 344 344 345 345 return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), intval(abs($modifiers))); 346 } else {347 return Inline::load($value); 348 }346 } 347 348 return Inline::load($value); 349 349 } 350 350 branches/2.0/tests/Symfony/Tests/Component/BrowserKit/ClientTest.php
r32076 r32151 37 37 if (null === $this->nextResponse) { 38 38 return new Response(); 39 } else {40 $response = $this->nextResponse;41 $this->nextResponse = null;42 43 return $response;44 39 } 40 41 $response = $this->nextResponse; 42 $this->nextResponse = null; 43 44 return $response; 45 45 } 46 46 branches/2.0/tests/Symfony/Tests/Component/Config/Loader/DelegatingLoaderTest.php
r32076 r32151 14 14 use Symfony\Component\Config\Loader\LoaderResolver; 15 15 use Symfony\Component\Config\Loader\DelegatingLoader; 16 use Symfony\Component\ Config\Loader\XmlFileLoader;17 use Symfony\Component\ Config\Loader\ClosureLoader;18 use Symfony\Component\ Config\RouteCollection;19 use Symfony\Component\ Config\Route;16 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; 17 use Symfony\Component\DependencyInjection\Loader\ClosureLoader; 18 use Symfony\Component\Routing\RouteCollection; 19 use Symfony\Component\Routing\Route; 20 20 21 21 class DelegatingLoaderTest extends \PHPUnit_Framework_TestCase branches/2.0/tests/Symfony/Tests/Component/Console/Input/InputArgumentTest.php
r31885 r32151 13 13 14 14 use Symfony\Component\Console\Input\InputArgument; 15 use Symfony\Component\Console\Exception;16 15 17 16 class InputArgumentTest extends \PHPUnit_Framework_TestCase branches/2.0/tests/Symfony/Tests/Component/Console/Input/InputDefinitionTest.php
r31885 r32151 15 15 use Symfony\Component\Console\Input\InputArgument; 16 16 use Symfony\Component\Console\Input\InputOption; 17 use Symfony\Component\Console\Exception;18 17 19 18 class InputDefinitionTest extends \PHPUnit_Framework_TestCase branches/2.0/tests/Symfony/Tests/Component/Console/Input/InputOptionTest.php
r31885 r32151 13 13 14 14 use Symfony\Component\Console\Input\InputOption; 15 use Symfony\Component\Console\Exception;16 15 17 16 class InputOptionTest extends \PHPUnit_Framework_TestCase branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/ClosureLoaderTest.php
r31885 r32151 13 13 14 14 use Symfony\Component\DependencyInjection\ContainerBuilder; 15 use Symfony\Component\ DependencyInjection\Loader\LoaderResolver;15 use Symfony\Component\Config\Loader\LoaderResolver; 16 16 use Symfony\Component\DependencyInjection\Loader\ClosureLoader; 17 17 branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/PhpFileLoaderTest.php
r32076 r32151 15 15 use Symfony\Component\DependencyInjection\Reference; 16 16 use Symfony\Component\DependencyInjection\Definition; 17 use Symfony\Component\ DependencyInjection\Loader\Loader;17 use Symfony\Component\Config\Loader\Loader; 18 18 use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; 19 19 use Symfony\Component\Config\Loader\LoaderResolver; branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/XmlFileLoaderTest.php
r32076 r32151 17 17 use Symfony\Component\DependencyInjection\Reference; 18 18 use Symfony\Component\DependencyInjection\Definition; 19 use Symfony\Component\ DependencyInjection\Loader\Loader;19 use Symfony\Component\Config\Loader\Loader; 20 20 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; 21 21 use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/YamlFileLoaderTest.php
r32076 r32151 15 15 use Symfony\Component\DependencyInjection\Reference; 16 16 use Symfony\Component\DependencyInjection\Definition; 17 use Symfony\Component\ DependencyInjection\Loader\Loader;17 use Symfony\Component\Config\Loader\Loader; 18 18 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; 19 19 use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; branches/2.0/tests/Symfony/Tests/Component/Templating/Loader/LoaderTest.php
r32076 r32151 15 15 16 16 use Symfony\Component\Templating\Loader\Loader; 17 use Symfony\Component\Templating\ Loader\TemplateNameParser;17 use Symfony\Component\Templating\TemplateNameParser; 18 18 use Symfony\Component\Templating\TemplateReferenceInterface; 19 19 branches/2.0/tests/Symfony/Tests/Component/Templating/Storage/StorageTest.php
r31836 r32151 13 13 14 14 use Symfony\Component\Templating\Storage\Storage; 15 use Symfony\Component\Templating\Renderer\PhpRenderer;16 15 17 16 class StorageTest extends \PHPUnit_Framework_TestCase