Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 141 deletions.
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
"suggest": {
"zendframework/zend-filter": "Zend\\Filter component",
"zendframework/zend-i18n": "Zend\\I18n component",
"zendframework/zend-validator": "Zend\\Validator component",
"zendframework/zend-loader": "Zend\\Loader component"
"zendframework/zend-validator": "Zend\\Validator component"
},
"extra": {
"branch-alias": {
"dev-master": "2.4-dev",
"dev-develop": "2.5-dev"
"dev-master": "2.2-dev",
"dev-develop": "2.3-dev"
}
},
"autoload-dev": {
Expand Down
6 changes: 1 addition & 5 deletions src/ClassFileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File
*/

namespace Zend\File;
Expand All @@ -19,9 +18,6 @@

/**
* Locate files containing PHP classes, interfaces, abstracts or traits
*
* @category Zend
* @package Zend_File
*/
class ClassFileLocator extends FilterIterator
{
Expand Down
7 changes: 1 addition & 6 deletions src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File
*/

namespace Zend\File\Exception;

/**
* @category Zend
* @package Zend_File_Transfer
*/
class BadMethodCallException extends \BadMethodCallException implements
ExceptionInterface
{}
6 changes: 1 addition & 5 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File
*/

namespace Zend\File\Exception;

/**
* Marker interface for exceptions found in this component
*
* @package Zend_File
* @subpackage Exception
*/
interface ExceptionInterface
{
Expand Down
5 changes: 1 addition & 4 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File
*/

namespace Zend\File\Exception;

/**
* Exception class raised when invalid arguments are discovered
*
* @package Zend_File
*/
class InvalidArgumentException
extends \InvalidArgumentException
Expand Down
7 changes: 1 addition & 6 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File
*/

namespace Zend\File\Exception;

/**
* @category Zend
* @package Zend_File_Transfer
*/
class RuntimeException
extends \RuntimeException
implements ExceptionInterface
Expand Down
6 changes: 1 addition & 5 deletions src/PhpClassFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File
*/

namespace Zend\File;
Expand All @@ -14,9 +13,6 @@

/**
* Locate files containing PHP classes, interfaces, abstracts or traits
*
* @category Zend
* @package Zend_File
*/
class PhpClassFile extends SplFileInfo
{
Expand Down
28 changes: 12 additions & 16 deletions src/Transfer/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File
*/

namespace Zend\File\Transfer\Adapter;
Expand All @@ -30,8 +29,6 @@
* and filter chains instead.
*
* @todo Rewrite
* @category Zend
* @package Zend_File_Transfer
*/
abstract class AbstractAdapter implements TranslatorAwareInterface
{
Expand Down Expand Up @@ -278,7 +275,7 @@ public function getValidatorManager()
* Adds a new validator for this class
*
* @param string|Validator\ValidatorInterface $validator Type of validator to add
* @param boolean $breakChainOnFailure If the validation chain should stop an failure
* @param bool $breakChainOnFailure If the validation chain should stop an failure
* @param string|array $options Options to set for the validator
* @param string|array $files Files to limit this validator to
* @return AbstractAdapter
Expand Down Expand Up @@ -533,7 +530,7 @@ public function setOptions($options = array(), $files = null)
case 'ignoreNoFile' :
case 'useByteString' :
case 'detectInfos' :
$this->files[$key]['options'][$name] = (boolean) $value;
$this->files[$key]['options'][$name] = (bool) $value;
break;

default:
Expand Down Expand Up @@ -571,7 +568,7 @@ public function getOptions($files = null)
* Checks if the files are valid
*
* @param string|array $files (Optional) Files to check
* @return boolean True if all checks are valid
* @return bool True if all checks are valid
*/
public function isValid($files = null)
{
Expand Down Expand Up @@ -690,7 +687,7 @@ public function getErrors()
/**
* Are there errors registered?
*
* @return boolean
* @return bool
*/
public function hasErrors()
{
Expand Down Expand Up @@ -886,7 +883,7 @@ public function clearFilters()
* Retrieves the filename of transferred files.
*
* @param string $file (Optional) Element to return the filename for
* @param boolean $path (Optional) Should the path also be returned ?
* @param bool $path (Optional) Should the path also be returned ?
* @return string|array
*/
public function getFileName($file = null, $path = true)
Expand Down Expand Up @@ -1227,16 +1224,15 @@ protected function detectMimeType($value)
}

if (class_exists('finfo', false)) {
$const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
if (!empty($value['options']['magicFile'])) {
ErrorHandler::start();
$mime = finfo_open($const, $value['options']['magicFile']);
$mime = finfo_open(FILEINFO_MIME_TYPE, $value['options']['magicFile']);
ErrorHandler::stop();
}

if (empty($mime)) {
ErrorHandler::start();
$mime = finfo_open($const);
$mime = finfo_open(FILEINFO_MIME_TYPE);
ErrorHandler::stop();
}

Expand All @@ -1262,7 +1258,7 @@ protected function detectMimeType($value)
/**
* Returns the formatted size
*
* @param integer $size
* @param int $size
* @return string
*/
protected static function toByteString($size)
Expand All @@ -1279,7 +1275,7 @@ protected static function toByteString($size)
* Internal function to filter all given files
*
* @param string|array $files (Optional) Files to check
* @return boolean False on error
* @return bool False on error
*/
protected function filter($files = null)
{
Expand Down Expand Up @@ -1394,8 +1390,8 @@ protected function isPathWriteable($path)
* Returns found files based on internal file array and given files
*
* @param string|array $files (Optional) Files to return
* @param boolean $names (Optional) Returns only names on true, else complete info
* @param boolean $noexception (Optional) Allows throwing an exception, otherwise returns an empty array
* @param bool $names (Optional) Returns only names on true, else complete info
* @param bool $noexception (Optional) Allows throwing an exception, otherwise returns an empty array
* @return array Found files
* @throws Exception\RuntimeException On false filename
*/
Expand Down
15 changes: 6 additions & 9 deletions src/Transfer/Adapter/FilterPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File_Transfer
*/

namespace Zend\File\Transfer\Adapter;
Expand All @@ -18,8 +17,6 @@
* Enforces that filters retrieved are instances of
* FilterInterface. Additionally, it registers a number of default filters.
*
* @category Zend
* @package Zend_File_Transfer
*/
class FilterPluginManager extends BaseManager
{
Expand All @@ -29,10 +26,10 @@ class FilterPluginManager extends BaseManager
* @var array
*/
protected $aliases = array(
'decrypt' =>'filedecrypt',
'encrypt' =>'fileencrypt',
'lowercase' =>'filelowercase',
'rename' =>'filerename',
'uppercase' =>'fileuppercase',
'decrypt' => 'filedecrypt',
'encrypt' => 'fileencrypt',
'lowercase' => 'filelowercase',
'rename' => 'filerename',
'uppercase' => 'fileuppercase',
);
}
21 changes: 9 additions & 12 deletions src/Transfer/Adapter/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_File
*/

namespace Zend\File\Transfer\Adapter;
Expand All @@ -18,8 +17,6 @@
/**
* File transfer adapter class for the HTTP protocol
*
* @category Zend
* @package Zend_File_Transfer
*/
class Http extends AbstractAdapter
{
Expand Down Expand Up @@ -100,7 +97,7 @@ public function send($options = null)
* Checks if the files are valid
*
* @param string|array $files (Optional) Files to check
* @return boolean True if all checks are valid
* @return bool True if all checks are valid
*/
public function isValid($files = null)
{
Expand Down Expand Up @@ -136,7 +133,7 @@ public function isValid($files = null)
* Receive the file from the client (Upload)
*
* @param string|array $files (Optional) Files to receive
* @return boolean
* @return bool
*/
public function receive($files = null)
{
Expand Down Expand Up @@ -207,7 +204,7 @@ public function receive($files = null)
* Checks if the file was already sent
*
* @param string|array $files Files to check
* @return boolean
* @return bool
* @throws Exception\BadMethodCallException Not implemented
*/
public function isSent($files = null)
Expand All @@ -219,7 +216,7 @@ public function isSent($files = null)
* Checks if the file was already received
*
* @param string|array $files (Optional) Files to check
* @return boolean
* @return bool
*/
public function isReceived($files = null)
{
Expand All @@ -241,7 +238,7 @@ public function isReceived($files = null)
* Checks if the file was already filtered
*
* @param string|array $files (Optional) Files to check
* @return boolean
* @return bool
*/
public function isFiltered($files = null)
{
Expand All @@ -263,7 +260,7 @@ public function isFiltered($files = null)
* Has a file been uploaded ?
*
* @param array|string|null $files
* @return boolean
* @return bool
*/
public function isUploaded($files = null)
{
Expand Down Expand Up @@ -391,7 +388,7 @@ public static function getProgress($id = null)
/**
* Checks the APC extension for progress information
*
* @return boolean
* @return bool
*/
public static function isApcAvailable()
{
Expand All @@ -401,7 +398,7 @@ public static function isApcAvailable()
/**
* Checks the UploadProgress extension for progress information
*
* @return boolean
* @return bool
*/
public static function isUploadProgressAvailable()
{
Expand Down
Loading

0 comments on commit 297bb66

Please sign in to comment.