diff --git a/UPDATE.md b/UPDATE.md index 83eb929aec..8bc77eead4 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -9,6 +9,8 @@ timeline closely anyway. PR12 to beta1 ------------- +* The `File::getWebPath()` and `File::rename()` methods have been removed. + * The `session` configuration has been refactored: * The `class` option has been removed (use the `session.class` parameter diff --git a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php index 8c5926d3ff..dbf8285ef1 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -33,7 +33,7 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface /** * Returns whether Doctrine 2 metadata exists for that class * - * @return boolean + * @return Boolean */ protected function isMappedClass($class) { diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 7e8ad2e59e..d9e39a3909 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -39,7 +39,6 @@ class Configuration implements ConfigurationInterface ->children() ->scalarNode('cache_warmer')->defaultValue(!$this->debug)->end() ->scalarNode('charset')->end() - ->scalarNode('document_root')->end() ->scalarNode('error_handler')->end() ->scalarNode('exception_controller')->defaultValue('Symfony\\Bundle\\FrameworkBundle\\Controller\\ExceptionController::showAction')->end() ->scalarNode('ide')->defaultNull()->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index c3cd5899b7..a95bf273aa 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -65,10 +65,6 @@ class FrameworkExtension extends Extension $container->setParameter('kernel.charset', $config['charset']); } - if (isset($config['document_root'])) { - $container->setParameter('document_root', $config['document_root']); - } - if (isset($config['error_handler'])) { if (false === $config['error_handler']) { $container->getDefinition('error_handler')->setMethodCalls(array()); diff --git a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php index 9abbb5ec0f..9a06ff198e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php +++ b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php @@ -56,10 +56,6 @@ class FrameworkBundle extends Bundle $this->container->get('error_handler'); } - if ($this->container->hasParameter('document_root')) { - File::setDocumentRoot($this->container->getParameter('document_root')); - } - if (file_exists($this->container->getParameter('kernel.cache_dir').'/autoload.php')) { $classloader = new MapFileClassLoader($this->container->getParameter('kernel.cache_dir').'/autoload.php'); $classloader->register(true); diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php b/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php index 8eeb010fb3..08d32c86cf 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php @@ -105,6 +105,6 @@ class GlobalVariables */ public function getDebug() { - return (bool) $this->container->getParameter('kernel.debug'); + return (Boolean) $this->container->getParameter('kernel.debug'); } } diff --git a/src/Symfony/Component/BrowserKit/Cookie.php b/src/Symfony/Component/BrowserKit/Cookie.php index 82bbb30470..ebb5a2d334 100644 --- a/src/Symfony/Component/BrowserKit/Cookie.php +++ b/src/Symfony/Component/BrowserKit/Cookie.php @@ -38,8 +38,8 @@ class Cookie * @param string $expires The time the cookie expires * @param string $path The path on the server in which the cookie will be available on * @param string $domain The domain that the cookie is available - * @param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client - * @param bool $httponly The cookie httponly flag + * @param Boolean $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client + * @param Boolean $httponly The cookie httponly flag * * @api */ diff --git a/src/Symfony/Component/Config/Definition/ArrayNode.php b/src/Symfony/Component/Config/Definition/ArrayNode.php index cac0e685ba..67d76d5e0f 100644 --- a/src/Symfony/Component/Config/Definition/ArrayNode.php +++ b/src/Symfony/Component/Config/Definition/ArrayNode.php @@ -126,7 +126,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface /** * Checks if the node has a default value. * - * @return boolean + * @return Boolean */ public function hasDefaultValue() { diff --git a/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php b/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php index 5b187cfe70..ff68c092b5 100644 --- a/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php +++ b/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php @@ -97,7 +97,7 @@ class PrototypedArrayNode extends ArrayNode /** * Checks if the node has a default value. * - * @return boolean + * @return Boolean */ public function hasDefaultValue() { diff --git a/src/Symfony/Component/Console/Formatter/OutputFormatter.php b/src/Symfony/Component/Console/Formatter/OutputFormatter.php index 59f247d03a..14613700e7 100644 --- a/src/Symfony/Component/Console/Formatter/OutputFormatter.php +++ b/src/Symfony/Component/Console/Formatter/OutputFormatter.php @@ -26,7 +26,7 @@ class OutputFormatter implements OutputFormatterInterface /** * Initializes console output formatter. * - * @param boolean $decorated Whether this formatter should actually decorate strings + * @param Boolean $decorated Whether this formatter should actually decorate strings * @param array $styles Array of "name => FormatterStyle" instance * * @api @@ -87,7 +87,7 @@ class OutputFormatter implements OutputFormatterInterface * * @param string $name * - * @return boolean + * @return Boolean * * @api */ @@ -217,7 +217,7 @@ class OutputFormatter implements OutputFormatterInterface * * @param string $string * - * @return Symfony\Component\Console\Format\FormatterStyle|boolean false if string is not format string + * @return Symfony\Component\Console\Format\FormatterStyle|Boolean false if string is not format string */ private function createStyleFromString($string) { diff --git a/src/Symfony/Component/Console/Formatter/OutputFormatterInterface.php b/src/Symfony/Component/Console/Formatter/OutputFormatterInterface.php index b83e050062..fd205a4eba 100644 --- a/src/Symfony/Component/Console/Formatter/OutputFormatterInterface.php +++ b/src/Symfony/Component/Console/Formatter/OutputFormatterInterface.php @@ -53,7 +53,7 @@ interface OutputFormatterInterface * * @param string $name * - * @return boolean + * @return Boolean * * @api */ diff --git a/src/Symfony/Component/Console/Input/InputInterface.php b/src/Symfony/Component/Console/Input/InputInterface.php index b9d427a31e..d5023eb073 100644 --- a/src/Symfony/Component/Console/Input/InputInterface.php +++ b/src/Symfony/Component/Console/Input/InputInterface.php @@ -97,7 +97,7 @@ interface InputInterface /** * Is this input means interactive? * - * @return bool + * @return Boolean */ function isInteractive(); } diff --git a/src/Symfony/Component/DependencyInjection/Alias.php b/src/Symfony/Component/DependencyInjection/Alias.php index c6aa80c069..4658c80718 100644 --- a/src/Symfony/Component/DependencyInjection/Alias.php +++ b/src/Symfony/Component/DependencyInjection/Alias.php @@ -20,7 +20,7 @@ class Alias * Constructor. * * @param string $id Alias identifier - * @param boolean $public If this alias is public + * @param Boolean $public If this alias is public */ public function __construct($id, $public = true) { @@ -31,7 +31,7 @@ class Alias /** * Checks if this DI Alias should be public or not. * - * @return boolean + * @return Boolean */ public function isPublic() { @@ -41,7 +41,7 @@ class Alias /** * Sets if this Alias is public. * - * @param boolean $boolean If this Alias should be public + * @param Boolean $boolean If this Alias should be public */ public function setPublic($boolean) { diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php index 791bdfe6d8..2399f6ca12 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php @@ -36,7 +36,7 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface /** * Constructor. * - * @param boolean $onlyConstructorArguments Sets this Service Reference pass to ignore method calls + * @param Boolean $onlyConstructorArguments Sets this Service Reference pass to ignore method calls */ public function __construct($onlyConstructorArguments = false) { diff --git a/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php index dd15cfe7d5..9cee8b8577 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php @@ -106,7 +106,7 @@ class InlineServiceDefinitionsPass implements RepeatablePassInterface * @param ContainerBuilder $container * @param string $id * @param Definition $definition - * @return boolean If the definition is inlineable + * @return Boolean If the definition is inlineable */ private function isInlinableDefinition(ContainerBuilder $container, $id, Definition $definition) { diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php index 15a2d888b9..1ed10058c9 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php @@ -69,7 +69,7 @@ class ResolveInvalidReferencesPass implements CompilerPassInterface * Processes arguments to determine invalid references. * * @param array $arguments An array of Reference objects - * @param boolean $inMethodCall + * @param Boolean $inMethodCall */ private function processArguments(array $arguments, $inMethodCall = false) { diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php b/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php index 6c71683d5f..89add2819b 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php @@ -65,7 +65,7 @@ class ServiceReferenceGraphNode /** * Checks if the value of this node is an Alias. * - * @return boolean True if the value is an Alias instance + * @return Boolean True if the value is an Alias instance */ public function isAlias() { @@ -75,7 +75,7 @@ class ServiceReferenceGraphNode /** * Checks if the value of this node is a Definition. * - * @return boolean True if the value is a Definition instance + * @return Boolean True if the value is a Definition instance */ public function isDefinition() { diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index a6c317313b..7f78212e6a 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -83,7 +83,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface * Checks if we have an extension. * * @param string $name The name of the extension - * @return boolean If the extension exists + * @return Boolean If the extension exists */ public function hasExtension($name) { diff --git a/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php index 331c8ef29c..8ed43509b6 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php @@ -123,7 +123,7 @@ class GraphvizDumper extends Dumper * * @param string $id The service id used to find edges * @param array $arguments An array of arguments - * @param boolean $required + * @param Boolean $required * @param string $name * @return array An array of edges */ diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index c3270404da..69d4195eff 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -330,7 +330,7 @@ class PhpDumper extends Dumper * * @param string $id * @param Definition $definition - * @return boolean + * @return Boolean */ private function isSimpleInstance($id, $definition) { @@ -913,7 +913,7 @@ EOF; * * @param string $id * @param array $arguments - * @return boolean + * @return Boolean */ private function hasReference($id, array $arguments) { @@ -936,7 +936,7 @@ EOF; * Dumps values. * * @param array $value - * @param boolean $interpolate + * @param Boolean $interpolate * @return string */ private function dumpValue($value, $interpolate = true) diff --git a/src/Symfony/Component/DependencyInjection/Reference.php b/src/Symfony/Component/DependencyInjection/Reference.php index 09d12bd773..8e21972e1e 100644 --- a/src/Symfony/Component/DependencyInjection/Reference.php +++ b/src/Symfony/Component/DependencyInjection/Reference.php @@ -61,7 +61,7 @@ class Reference /** * Returns true when this Reference is strict * - * @return boolean + * @return Boolean */ public function isStrict() { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php index 5300c2b729..384c05f454 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php @@ -16,7 +16,7 @@ use Symfony\Component\Form\Exception\TransformationFailedException; use Symfony\Component\Form\Exception\UnexpectedTypeException; /** - * Transforms between a boolean and a string. + * Transforms between a Boolean and a string. * * @author Bernhard Schussek * @author Florian Eckerstorfer diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php index 4e284f083d..3c2f1fffe3 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -37,7 +37,7 @@ class ResizeFormListener implements EventSubscriberInterface private $type; /** - * @var bool + * @var Boolean */ private $resizeOnBind; diff --git a/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php b/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php index c9bac56660..beb9f98e5a 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php @@ -28,7 +28,7 @@ class CheckboxType extends AbstractType public function buildView(FormView $view, FormInterface $form) { $view->set('value', $form->getAttribute('value')); - $view->set('checked', (bool)$form->getData()); + $view->set('checked', (Boolean) $form->getData()); } public function getDefaultOptions(array $options) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/RadioType.php b/src/Symfony/Component/Form/Extension/Core/Type/RadioType.php index 8a2c3b67a4..baecb688b2 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/RadioType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/RadioType.php @@ -28,7 +28,7 @@ class RadioType extends AbstractType public function buildView(FormView $view, FormInterface $form) { $view->set('value', $form->getAttribute('value')); - $view->set('checked', (bool)$form->getData()); + $view->set('checked', (Boolean) $form->getData()); if ($view->hasParent()) { $view->set('name', $view->getParent()->get('name')); diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php index 3e610e46a9..19e7ba2e3d 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php @@ -44,7 +44,7 @@ interface CsrfProviderInterface * * @param string $pageId The page ID used when generating the CSRF token * @param string $token The token supplied by the browser - * @return boolean Whether the token supplied by the browser is + * @return Boolean Whether the token supplied by the browser is * correct */ public function isCsrfTokenValid($pageId, $token); diff --git a/src/Symfony/Component/Form/FormInterface.php b/src/Symfony/Component/Form/FormInterface.php index 5c336ce3f4..01cf4cf5d1 100644 --- a/src/Symfony/Component/Form/FormInterface.php +++ b/src/Symfony/Component/Form/FormInterface.php @@ -104,7 +104,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable /** * Returns whether the form is empty * - * @return boolean + * @return Boolean */ function isEmpty(); diff --git a/src/Symfony/Component/HttpFoundation/File/File.php b/src/Symfony/Component/HttpFoundation/File/File.php index bda63e9a6b..09497a00f1 100644 --- a/src/Symfony/Component/HttpFoundation/File/File.php +++ b/src/Symfony/Component/HttpFoundation/File/File.php @@ -440,13 +440,6 @@ class File 'x-world/x-vrml' => 'wrl', ); - /** - * Stores the absolute path to the document root directory. - * - * @var string - */ - static protected $documentRoot; - /** * The absolute path to the file without dots. * @@ -454,30 +447,6 @@ class File */ protected $path; - /** - * Sets the path to the document root directory. - * - * @param string $documentRoot - */ - static public function setDocumentRoot($documentRoot) - { - if (!is_dir($documentRoot)) { - throw new \LogicException($documentRoot . ' is not a directory.'); - } - - self::$documentRoot = realpath($documentRoot); - } - - /** - * Returns the path to the document root directory. - * - * @return string - */ - static public function getDocumentRoot() - { - return self::$documentRoot; - } - /** * Constructs a new file from the given path. * @@ -491,7 +460,7 @@ class File throw new FileNotFoundException($path); } - $this->path = $path; + $this->path = realpath($path); } /** @@ -501,7 +470,7 @@ class File */ public function __toString() { - return null === $this->path ? '' : $this->path; + return (string) $this->path; } /** @@ -522,7 +491,7 @@ class File public function getExtension() { if ($ext = pathinfo($this->getName(), PATHINFO_EXTENSION)) { - return '.' . $ext; + return '.'.$ext; } return ''; @@ -531,19 +500,19 @@ class File /** * Returns the extension based on the mime type (with dot). * - * If the mime type is unknown, the actual extension is returned instead. + * If the mime type is unknown, returns null. * - * @return string + * @return string|null The guessed extension or null if it cannot be guessed */ - public function getDefaultExtension() + public function guessExtension() { $type = $this->getMimeType(); if (isset(self::$defaultExtensions[$type])) { - return '.' . self::$defaultExtensions[$type]; + return '.'.self::$defaultExtensions[$type]; } - return $this->getExtension(); + return null; } /** @@ -566,26 +535,6 @@ class File return $this->path; } - /** - * Returns the path relative to the document root. - * - * You can set the document root using the static method setDocumentRoot(). - * If the file is outside of the document root, this method returns an - * empty string. - * - * @return string The relative file path - */ - public function getWebPath() - { - $root = self::$documentRoot; - - if (false === strpos($this->path, $root)) { - return ''; - } - - return str_replace(array($root, DIRECTORY_SEPARATOR), array('', '/'), $this->path); - } - /** * Returns the mime type of the file. * @@ -618,16 +567,14 @@ class File } /** - * Moves the file to a new directory and gives it a new filename + * Moves the file to a new location. * - * @param string $directory The new directory - * @param string $filename The new file name - * - * @throws FileException When the file could not be moved + * @param string $directory The destination folder + * @param string $name The new file name */ - protected function doMove($directory, $filename) + public function move($directory, $name = null) { - $newPath = $directory . DIRECTORY_SEPARATOR . $filename; + $newPath = $directory.DIRECTORY_SEPARATOR.(null === $name ? $this->getName() : $name); if (!@rename($this->getPath(), $newPath)) { $error = error_get_last(); @@ -636,29 +583,4 @@ class File $this->path = realpath($newPath); } - - /** - * Moves the file to a new location. - * - * @param string $directory The destination folder - * @param string $name The new file name - */ - public function move($directory, $name = null) - { - $this->doMove($directory, $this->getName()); - - if (null !== $name) { - $this->rename($name); - } - } - - /** - * Renames the file. - * - * @param string $name The new file name - */ - public function rename($name) - { - $this->doMove($this->getDirectory(), $name); - } } diff --git a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php index c45cf8dbf9..80fa9aee8a 100644 --- a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php +++ b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -19,6 +19,7 @@ use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; * * @author Bernhard Schussek * @author Florian Eckerstorfer + * @author Fabien Potencier */ class UploadedFile extends File { @@ -105,13 +106,33 @@ class UploadedFile extends File } /** - * Returns the absolute file name without dots. - * - * @return string The file path + * @inheritDoc */ - public function getName() + public function getExtension() { - return $this->moved ? parent::getName() : $this->originalName; + if ($this->moved) { + return parent::getExtension(); + } + + if ($ext = pathinfo($this->getOriginalName(), PATHINFO_EXTENSION)) { + return '.'.$ext; + } + + return ''; + } + + /** + * Gets the original uploaded name. + * + * Warning: This name is not safe as it can have been manipulated by the end-user. + * Moreover, it can contain characters that are not allowed in file names. + * Never use it in a path. + * + * @return string + */ + public function getOriginalName() + { + return $this->originalName; } /** @@ -137,70 +158,23 @@ class UploadedFile extends File return $this->error === UPLOAD_ERR_OK; } - /** - * Returns true if the size of the uploaded file exceeds the - * upload_max_filesize directive in php.ini - * - * @return Boolean - */ - protected function isIniSizeExceeded() - { - return $this->error === UPLOAD_ERR_INI_SIZE; - } - - /** - * Returns true if the size of the uploaded file exceeds the - * MAX_FILE_SIZE directive specified in the HTML form - * - * @return Boolean - */ - protected function isFormSizeExceeded() - { - return $this->error === UPLOAD_ERR_FORM_SIZE; - } - - /** - * Returns true if the file was completely uploaded - * - * @return Boolean - */ - protected function isUploadComplete() - { - return $this->error !== UPLOAD_ERR_PARTIAL; - } - - /** - * @inheritDoc - */ - protected function doMove($directory, $filename) - { - if ($this->moved) { - return parent::doMove($directory, $filename); - } - - $newPath = $directory . DIRECTORY_SEPARATOR . $filename; - - if (!move_uploaded_file($this->getPath(), $newPath)) { - throw new FileException(sprintf('Could not move file %s to %s', $this->getPath(), $newPath)); - } - - $this->moved = true; - $this->path = realpath($newPath); - } - /** * @inheritDoc */ public function move($directory, $name = null) { if ($this->moved) { - return parent::move($directory, $name); + return parent::doMove($directory, $name); } - $this->doMove($directory, $this->originalName); + $newPath = $directory.DIRECTORY_SEPARATOR.(null === $name ? $this->getName() : $name); - if (null !== $name) { - $this->rename($name); + if (!@move_uploaded_file($this->getPath(), $newPath)) { + $error = error_get_last(); + throw new FileException(sprintf('Could not move file %s to %s (%s)', $this->getPath(), $newPath, strip_tags($error['message']))); } + + $this->moved = true; + $this->path = realpath($newPath); } } diff --git a/src/Symfony/Component/HttpFoundation/FileBag.php b/src/Symfony/Component/HttpFoundation/FileBag.php index 4cd4d02dcf..3b9c578d79 100644 --- a/src/Symfony/Component/HttpFoundation/FileBag.php +++ b/src/Symfony/Component/HttpFoundation/FileBag.php @@ -133,7 +133,8 @@ class FileBag extends ParameterBag foreach (array_keys($data['name']) as $key) { $files[$key] = $this->fixPhpFilesArray(array( 'error' => $data['error'][$key], - 'name' => $data['name'][$key], 'type' => $data['type'][$key], + 'name' => $data['name'][$key], + 'type' => $data['type'][$key], 'tmp_name' => $data['tmp_name'][$key], 'size' => $data['size'][$key] )); diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 2cae8b17f9..3c9c3ed5ea 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpFoundation; use Symfony\Component\HttpFoundation\SessionStorage\NativeSessionStorage; -use Symfony\Component\HttpFoundation\File\UploadedFile; /** * Request represents an HTTP request. diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php index 33814787e7..735bb7207f 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php @@ -188,7 +188,7 @@ class FullTransformer * Check if the first char of a string is a single quote * * @param string $quoteMatch The string to check - * @return bool true if matches, false otherwise + * @return Boolean true if matches, false otherwise */ public function isQuoteMatch($quoteMatch) { @@ -257,7 +257,7 @@ class FullTransformer * * @param DateTime $dateTime The DateTime object to be used to calculate the timestamp * @param array $options An array with the matched values to be used to calculate the timestamp - * @return bool|int The calculated timestamp or false if matched date is invalid + * @return Boolean|int The calculated timestamp or false if matched date is invalid */ protected function calculateUnixTimestamp(\DateTime $dateTime, array $options) { diff --git a/src/Symfony/Component/Locale/Stub/StubCollator.php b/src/Symfony/Component/Locale/Stub/StubCollator.php index b59a7a6899..2b973dbdce 100644 --- a/src/Symfony/Component/Locale/Stub/StubCollator.php +++ b/src/Symfony/Component/Locale/Stub/StubCollator.php @@ -98,7 +98,7 @@ class StubCollator * StubCollator::SORT_REGULAR - compare items normally (don't change types) * StubCollator::SORT_NUMERIC - compare items numerically * StubCollator::SORT_STRING - compare items as strings - * @return bool True on success or false on failure + * @return Boolean True on success or false on failure */ public function asort(&$array, $sortFlag = self::SORT_REGULAR) { @@ -118,7 +118,7 @@ class StubCollator * * @param string $str1 The first string to compare * @param string $str2 The second string to compare - * @return bool|int Return the comparison result or false on failure: + * @return Boolean|int Return the comparison result or false on failure: * 1 if $str1 is greater than $str2 * 0 if $str1 is equal than $str2 * -1 if $str1 is less than $str2 @@ -134,7 +134,7 @@ class StubCollator * Get a value of an integer collator attribute * * @param int $attr An attribute specifier, one of the attribute constants - * @return bool|int The attribute value on success or false on error + * @return Boolean|int The attribute value on success or false on error * @see http://www.php.net/manual/en/collator.getattribute.php * @throws MethodNotImplementedException */ @@ -190,7 +190,7 @@ class StubCollator /** * Get current collator's strenght * - * @return bool|int The current collator's strenght or false on failure + * @return Boolean|int The current collator's strenght or false on failure * @see http://www.php.net/manual/en/collator.getstrength.php * @throws MethodNotImplementedException */ @@ -204,7 +204,7 @@ class StubCollator * * @param int $attr An attribute specifier, one of the attribute constants * @param int $val The attribute value, one of the attribute value constants - * @return bool True on success or false on failure + * @return Boolean True on success or false on failure * @see http://www.php.net/manual/en/collator.setattribute.php * @throws MethodNotImplementedException */ @@ -223,7 +223,7 @@ class StubCollator * StubCollator::QUATERNARY * StubCollator::IDENTICAL * StubCollator::DEFAULT - * @return bool True on success or false on failure + * @return Boolean True on success or false on failure * @see http://www.php.net/manual/en/collator.setstrength.php * @throws MethodNotImplementedException */ @@ -236,7 +236,7 @@ class StubCollator * Sort array using specified collator and sort keys * * @param array &$arr Array of strings to sort - * @return bool True on success or false on failure + * @return Boolean True on success or false on failure * @see http://www.php.net/manual/en/collator.sortwithsortkeys.php * @throws MethodNotImplementedException */ @@ -253,7 +253,7 @@ class StubCollator * StubCollator::SORT_REGULAR * StubCollator::SORT_NUMERIC * StubCollator::SORT_STRING - * @return bool True on success or false on failure + * @return Boolean True on success or false on failure * @see http://www.php.net/manual/en/collator.sort.php * @throws MethodNotImplementedException */ diff --git a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php index 01582b23b3..d86aa0ac6a 100644 --- a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php +++ b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php @@ -90,7 +90,7 @@ class StubIntlDateFormatter private $dateTimeZone; /** - * @var bool + * @var Boolean */ private $unitializedTimeZoneId = false; @@ -320,7 +320,7 @@ class StubIntlDateFormatter * Set the formatter's calendar * * @param string $calendar The calendar to use. Default is IntlDateFormatter::GREGORIAN. - * @return bool true on success or false on failure + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/intldateformatter.setcalendar.php * @throws MethodNotImplementedException */ @@ -337,8 +337,8 @@ class StubIntlDateFormatter * patterns, parsing as much as possible to obtain a value. Extra space, unrecognized tokens, or * invalid values ("February 30th") are not accepted. * - * @param bool $lenient Sets whether the parser is lenient or not, default is false (strict) - * @return bool true on success or false on failure + * @param Boolean $lenient Sets whether the parser is lenient or not, default is false (strict) + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/intldateformatter.setlenient.php * @throws MethodNotImplementedException */ @@ -351,7 +351,7 @@ class StubIntlDateFormatter * Set the formatter's pattern * * @param string $pattern A pattern string in conformance with the ICU IntlDateFormatter documentation - * @return bool true on success or false on failure + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/intldateformatter.setpattern.php * @see http://userguide.icu-project.org/formatparse/datetime */ @@ -370,7 +370,7 @@ class StubIntlDateFormatter * @param string $timeZoneId The time zone ID string of the time zone to use. * If NULL or the empty string, the default time zone for the * runtime is used. - * @return bool true on success or false on failure + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/intldateformatter.settimezoneid.php */ public function setTimeZoneId($timeZoneId) diff --git a/src/Symfony/Component/Locale/Stub/StubLocale.php b/src/Symfony/Component/Locale/Stub/StubLocale.php index c8bef57bfd..ceeb15c5b2 100644 --- a/src/Symfony/Component/Locale/Stub/StubLocale.php +++ b/src/Symfony/Component/Locale/Stub/StubLocale.php @@ -369,7 +369,7 @@ class StubLocale * * @param array $langtag A list of the language tags to compare to locale * @param string $locale The locale to use as the language range when matching - * @param bool $canonicalize If true, the arguments will be converted to canonical form before matching + * @param Boolean $canonicalize If true, the arguments will be converted to canonical form before matching * @param string $default The locale to use if no match is found * @see http://www.php.net/manual/en/locale.lookup.php * @throws RuntimeException When the intl extension is not loaded @@ -396,7 +396,7 @@ class StubLocale * Sets the default runtime locale * * @param string $locale The locale code - * @return bool true on success or false on failure + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/locale.parselocale.php * @throws MethodNotImplementedException */ diff --git a/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php b/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php index 6ef99f3d0e..ef669c22f8 100644 --- a/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php +++ b/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php @@ -292,7 +292,7 @@ class StubNumberFormatter * * @param number $value The value to format * @param int $type Type of the formatting, one of the format type constants - * @return bool|string The formatted value or false on error + * @return Boolean|string The formatted value or false on error * @see http://www.php.net/manual/en/numberformatter.format.php * @throws RuntimeException If the method is called with the class $style 'CURRENCY' * @throws MethodArgumentNotImplementedException If the $type is different than TYPE_DEFAULT @@ -327,7 +327,7 @@ class StubNumberFormatter * Returns an attribute value * * @param int $attr An attribute specifier, one of the numeric attribute constants - * @return bool|int The attribute value on success or false on error + * @return Boolean|int The attribute value on success or false on error * @see http://www.php.net/manual/en/numberformatter.getattribute.php */ public function getAttribute($attr) @@ -372,7 +372,7 @@ class StubNumberFormatter /** * Returns the formatter's pattern * - * @return bool|string The pattern string used by the formatter or false on error + * @return Boolean|string The pattern string used by the formatter or false on error * @see http://www.php.net/manual/en/numberformatter.getpattern.php * @throws MethodNotImplementedException */ @@ -385,7 +385,7 @@ class StubNumberFormatter * Returns a formatter symbol value * * @param int $attr A symbol specifier, one of the format symbol constants - * @return bool|string The symbol value or false on error + * @return Boolean|string The symbol value or false on error * @see http://www.php.net/manual/en/numberformatter.getsymbol.php * @throws MethodNotImplementedException */ @@ -398,7 +398,7 @@ class StubNumberFormatter * Returns a formatter text attribute value * * @param int $attr An attribute specifier, one of the text attribute constants - * @return bool|string The attribute value or false on error + * @return Boolean|string The attribute value or false on error * @see http://www.php.net/manual/en/numberformatter.gettextattribute.php * @throws MethodNotImplementedException */ @@ -413,7 +413,7 @@ class StubNumberFormatter * @param string $value The value to parse * @param string $currency Parameter to receive the currency name (reference) * @param int $position Offset to begin the parsing on return this value will hold the offset at which the parsing ended - * @return bool|string The parsed numeric value of false on error + * @return Boolean|string The parsed numeric value of false on error * @see http://www.php.net/manual/en/numberformatter.parsecurrency.php * @throws MethodNotImplementedException */ @@ -428,7 +428,7 @@ class StubNumberFormatter * @param string $value The value to parse * @param string $type Type of the formatting, one of the format type constants. NumberFormatter::TYPE_DOUBLE by default * @param int $position Offset to begin the parsing on return this value will hold the offset at which the parsing ended - * @return bool|string The parsed value of false on error + * @return Boolean|string The parsed value of false on error * @see http://www.php.net/manual/en/numberformatter.parse.php * @throws MethodArgumentValueNotImplementedException When $type equals to TYPE_INT64, behavior not implemented * @throws MethodArgumentNotImplementedException When $position different than null, behavior not implemented @@ -468,7 +468,7 @@ class StubNumberFormatter * * @param int $attr An attribute specifier, one of the numeric attribute constants * @param int $value The attribute value - * @return bool true on success or false on failure + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/numberformatter.setattribute.php * @throws MethodArgumentValueNotImplementedException When the $attr is not supported * @throws MethodArgumentValueNotImplementedException When the $value is not supported @@ -510,7 +510,7 @@ class StubNumberFormatter * Set the formatter's pattern * * @param string $pattern A pattern string in conformance with the ICU DecimalFormat documentation - * @return bool true on success or false on failure + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/numberformatter.setpattern.php * @see http://www.icu-project.org/apiref/icu4c/classDecimalFormat.html#_details * @throws MethodNotImplementedException @@ -525,7 +525,7 @@ class StubNumberFormatter * * @param int $attr A symbol specifier, one of the format symbol constants * @param string $value The value for the symbol - * @return bool true on success or false on failure + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/numberformatter.setsymbol.php * @throws MethodNotImplementedException */ @@ -539,7 +539,7 @@ class StubNumberFormatter * * @param int $attr An attribute specifier, one of the text attribute constants * @param int $value The attribute value - * @return bool true on success or false on failure + * @return Boolean true on success or false on failure * @see http://www.php.net/manual/en/numberformatter.settextattribute.php * @throws MethodNotImplementedException */ @@ -674,7 +674,7 @@ class StubNumberFormatter * Check if the attribute is initialized (value set by client code). * * @param string $attr The attribute name - * @return bool true if the value was set by cliente, false otherwise + * @return Boolean true if the value was set by cliente, false otherwise */ private function isInitializedAttribute($attr) { @@ -719,7 +719,7 @@ class StubNumberFormatter * Check if the rounding mode is invalid. * * @param int $value The rounding mode value to check - * @return bool true if the rounding mode is invalid, false otherwise + * @return Boolean true if the rounding mode is invalid, false otherwise */ private function isInvalidRoundingMode($value) { @@ -732,13 +732,13 @@ class StubNumberFormatter /** * Returns the normalized value for the GROUPING_USED attribute. Any value that can be converted to int will be - * cast to boolean and then to int again. This way, negative values are converted to 1 and string values to 0. + * cast to Boolean and then to int again. This way, negative values are converted to 1 and string values to 0. * * @param mixed $value The value to be normalized * @return int The normalized value for the attribute (0 or 1) */ private function normalizeGroupingUsedValue($value) { - return (int) (bool) (int) $value; + return (int) (Boolean) (int) $value; } /** diff --git a/src/Symfony/Component/Security/Core/SecurityContext.php b/src/Symfony/Component/Security/Core/SecurityContext.php index c88f54fee7..575f94bccb 100644 --- a/src/Symfony/Component/Security/Core/SecurityContext.php +++ b/src/Symfony/Component/Security/Core/SecurityContext.php @@ -53,7 +53,7 @@ class SecurityContext implements SecurityContextInterface * @throws AuthenticationCredentialsNotFoundException when the security context has no authentication token. * @param mixed $attributes * @param mixed|null $object - * @return boolean + * @return Boolean */ public final function isGranted($attributes, $object = null) { diff --git a/src/Symfony/Component/Security/Core/SecurityContextInterface.php b/src/Symfony/Component/Security/Core/SecurityContextInterface.php index c54ca0e3c9..41815fbd18 100644 --- a/src/Symfony/Component/Security/Core/SecurityContextInterface.php +++ b/src/Symfony/Component/Security/Core/SecurityContextInterface.php @@ -35,7 +35,7 @@ interface SecurityContextInterface * * @param array $attributes * @param mixed $object - * @return boolean + * @return Boolean */ function isGranted($attributes, $object = null); } \ No newline at end of file diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index 0a0ea5d84b..e6f5ff9b0e 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -201,7 +201,7 @@ class XmlEncoder extends AbstractEncoder implements DecoderInterface * * @param DOMNode $parentNode * @param array|object $data data - * @return bool + * @return Boolean */ private function buildXml($parentNode, $data) { diff --git a/src/Symfony/Component/Validator/ValidatorFactory.php b/src/Symfony/Component/Validator/ValidatorFactory.php index 0683d718a8..83d5c4dd59 100644 --- a/src/Symfony/Component/Validator/ValidatorFactory.php +++ b/src/Symfony/Component/Validator/ValidatorFactory.php @@ -87,7 +87,7 @@ class ValidatorFactory implements ValidatorContextInterface * @param array $mappingFiles A list of XML or YAML file names * where mapping information can be * found. Can be empty. - * @param boolean $annotations Whether to use annotations for + * @param Boolean $annotations Whether to use annotations for * retrieving mapping information * @param array $annotationNamespaces The annotation namespaces used * for finding the annotation classes. diff --git a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/ChoiceTypeTest.php b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/ChoiceTypeTest.php index adc7de5c27..2fd1355c97 100644 --- a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/ChoiceTypeTest.php +++ b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/ChoiceTypeTest.php @@ -227,7 +227,7 @@ class ChoiceTypeTest extends TypeTestCase } /* - * We need this functionality to create choice fields for boolean types, + * We need this functionality to create choice fields for Boolean types, * e.g. false => 'No', true => 'Yes' */ public function testSetDataSingleNonExpandedAcceptsBoolean() diff --git a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/FormTypeTest.php b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/FormTypeTest.php index a1aab6693b..60e33b94c1 100644 --- a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/FormTypeTest.php +++ b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/FormTypeTest.php @@ -23,7 +23,6 @@ use Symfony\Component\Form\HiddenField; use Symfony\Component\Form\Util\PropertyPath; use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\ExecutionView; diff --git a/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php b/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php index 6f7c936a0a..0ccb19fbcd 100644 --- a/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php +++ b/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php @@ -33,28 +33,6 @@ class FileTest extends \PHPUnit_Framework_TestCase $this->assertEquals(__DIR__.'/Fixtures/test.gif', (string) $this->file); } - public function testGetWebPathReturnsPathRelativeToDocumentRoot() - { - File::setDocumentRoot(__DIR__); - - $this->assertEquals(__DIR__, File::getDocumentRoot()); - $this->assertEquals('/Fixtures/test.gif', $this->file->getWebPath()); - } - - public function testGetWebPathReturnsEmptyPathIfOutsideDocumentRoot() - { - File::setDocumentRoot(__DIR__.'/Fixtures/directory'); - - $this->assertEquals('', $this->file->getWebPath()); - } - - public function testSetDocumentRootThrowsLogicExceptionWhenNotExists() - { - $this->setExpectedException('LogicException'); - - File::setDocumentRoot(__DIR__.'/Fixtures/not_here'); - } - public function testGetNameReturnsNameWithExtension() { $this->assertEquals('test.gif', $this->file->getName()); @@ -85,21 +63,21 @@ class FileTest extends \PHPUnit_Framework_TestCase $this->assertEquals('image/gif', $this->file->getMimeType()); } - public function testGetDefaultExtensionWithoutGuesser() + public function testGuessExtensionWithoutGuesser() { $file = new File(__DIR__.'/Fixtures/directory/.empty'); - $this->assertEquals('.empty', $file->getDefaultExtension()); + $this->assertEquals(null, $file->guessExtension()); } - public function testGetDefaultExtensionIsBasedOnMimeType() + public function testGuessExtensionIsBasedOnMimeType() { $file = new File(__DIR__.'/Fixtures/test'); $guesser = $this->createMockGuesser($file->getPath(), 'image/gif'); MimeTypeGuesser::getInstance()->register($guesser); - $this->assertEquals('.gif', $file->getDefaultExtension()); + $this->assertEquals('.gif', $file->guessExtension()); } public function testConstructWhenFileNotExists() @@ -189,25 +167,6 @@ class FileTest extends \PHPUnit_Framework_TestCase @unlink($targetPath); } - public function testRename() - { - $path = __DIR__.'/Fixtures/test.copy.gif'; - $targetPath = realpath(__DIR__.'/Fixtures').DIRECTORY_SEPARATOR.'test.target.gif'; - @unlink($path); - @unlink($targetPath); - copy(realpath(__DIR__.'/Fixtures/test.gif'), $path); - - $file = new File($path); - $file->rename('test.target.gif'); - - $this->assertTrue(file_exists($targetPath)); - $this->assertFalse(file_exists($path)); - $this->assertEquals($targetPath, $file->getPath()); - - @unlink($path); - @unlink($targetPath); - } - protected function createMockGuesser($path, $mimeType) { $guesser = $this->getMock('Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface'); diff --git a/tests/Symfony/Tests/Component/HttpFoundation/File/UploadedFileTest.php b/tests/Symfony/Tests/Component/HttpFoundation/File/UploadedFileTest.php index c1d468adbf..8c1821cf0c 100644 --- a/tests/Symfony/Tests/Component/HttpFoundation/File/UploadedFileTest.php +++ b/tests/Symfony/Tests/Component/HttpFoundation/File/UploadedFileTest.php @@ -77,6 +77,6 @@ class UploadedFileTest extends \PHPUnit_Framework_TestCase null ); - $this->assertEquals('original.gif', $file->getName()); + $this->assertEquals('test.gif', $file->getName()); } } diff --git a/tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php b/tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php index 30f51c0033..88a01bb3ed 100644 --- a/tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php +++ b/tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php @@ -12,7 +12,6 @@ namespace Symfony\Tests\Component\HttpFoundation; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\File\UploadedFile; class RequestTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Symfony/Tests/Component/HttpKernel/KernelTest.php b/tests/Symfony/Tests/Component/HttpKernel/KernelTest.php index 7de5362cd0..c2e07c1cde 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/KernelTest.php +++ b/tests/Symfony/Tests/Component/HttpKernel/KernelTest.php @@ -737,7 +737,7 @@ class KernelForTest extends Kernel public function setIsBooted($value) { - $this->booted = (bool) $value; + $this->booted = (Boolean) $value; } } diff --git a/tests/Symfony/Tests/Component/Yaml/Fixtures/YtsTypeTransfers.yml b/tests/Symfony/Tests/Component/Yaml/Fixtures/YtsTypeTransfers.yml index 398fa0eb89..baba0057ee 100644 --- a/tests/Symfony/Tests/Component/Yaml/Fixtures/YtsTypeTransfers.yml +++ b/tests/Symfony/Tests/Component/Yaml/Fixtures/YtsTypeTransfers.yml @@ -157,7 +157,7 @@ php: | --- test: Boolean brief: > - You can use 'true' and 'false' for boolean values. + You can use 'true' and 'false' for Boolean values. yaml: | Is Gus a Liar?: true Do I rely on Gus for Sustenance?: false