aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2014-09-17 18:54:29 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2014-09-17 18:54:29 +0200
commit779109706418e6e8db499506a86e57a79cdc9ed4 (patch)
tree341e66c8d61a594560b4086dbde43c614ba7a28e
parent6775f986a757b29e598925846cb862c59cffdc62 (diff)
downloadMime-779109706418e6e8db499506a86e57a79cdc9ed4.zip
Mime-779109706418e6e8db499506a86e57a79cdc9ed4.tar.gz
Mime-779109706418e6e8db499506a86e57a79cdc9ed4.tar.bz2
Use short-array syntax.
-rw-r--r--Mime.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/Mime.php b/Mime.php
index 13efd7c..71a0f15 100644
--- a/Mime.php
+++ b/Mime.php
@@ -145,14 +145,14 @@ class Mime implements Core\Parameter\Parameterizable {
* @throw \Hoa\Mime\Exception
*/
public function __construct ( Stream $stream,
- Array $parameters = array() ) {
+ Array $parameters = [] ) {
$this->_parameters = new Core\Parameter(
$this,
- array(),
- array(
+ [],
+ [
'magic' => null
- )
+ ]
);
$this->_parameters->setParameters($parameters);
$magic = $this->_parameters->getParameter('magic');
@@ -202,10 +202,10 @@ class Mime implements Core\Parameter\Parameterizable {
throw new Exception(
'Magic file %s does not exist.', 0, $magic);
- static::$_computed = array(
- self::STRUCTURE_MEDIA_TYPE => array(),
- self::STRUCTURE_EXTENSION => array()
- );
+ static::$_computed = [
+ self::STRUCTURE_MEDIA_TYPE => [],
+ self::STRUCTURE_EXTENSION => []
+ ];
$s_media_type = &static::$_computed[self::STRUCTURE_MEDIA_TYPE];
$s_extension = &static::$_computed[self::STRUCTURE_EXTENSION];
$splashed = file($magic);
@@ -254,11 +254,11 @@ class Mime implements Core\Parameter\Parameterizable {
'Magic file %s seems to be corrupted (at line %d). ' .
'You should take a look at this piece of code:' .
$message,
- 1, array($magic, $i), $exception);
+ 1, [$magic, $i], $exception);
}
if(!isset($s_media_type[$media]))
- $s_media_type[$media] = array();
+ $s_media_type[$media] = [];
if(null == $extensions) {
@@ -401,7 +401,7 @@ class Mime implements Core\Parameter\Parameterizable {
*/
public function getOtherExtensions ( ) {
- $out = array();
+ $out = [];
$current = $this->getExtension();
$others = self::$_computed[self::STRUCTURE_MEDIA_TYPE]
[$this->getMedia()]