Browse Source

Приведение к Kohana-codestyle

Rustem Alimov 7 years ago
parent
commit
dd36c447c2

+ 3 - 2
modules/encrypt/classes/Kohana/Encrypt.php

@@ -10,7 +10,7 @@ class Kohana_Encrypt {
 	/**
 	 * @var  array  Encrypt class instances
 	 */
-	public static $instances = array();
+	public static $instances = [];
 
 	/**
 	 * @var  engine  Encryption engine
@@ -46,7 +46,7 @@ class Kohana_Encrypt {
 			{
 				// No default encryption key is provided!
 				throw new Kohana_Exception('No encryption key is defined in the encryption configuration group: :group',
-					array(':group' => $name));
+					[':group' => $name]);
 			}
 
 			// Create a new instance
@@ -128,4 +128,5 @@ class Kohana_Encrypt {
 	{
 		return $this->_engine->create_iv();
 	}
+
 }

+ 3 - 2
modules/encrypt/classes/Kohana/Encrypt/Engine.php

@@ -61,8 +61,8 @@ abstract class Kohana_Encrypt_Engine {
 		else if (is_string($key_config))
 		{
 			// Store the key, mode, and cipher
-			$this->_key    = $key_config;
-			$this->_mode   = $mode;
+			$this->_key = $key_config;
+			$this->_mode = $mode;
 			$this->_cipher = $cipher;
 		}
 		else
@@ -74,4 +74,5 @@ abstract class Kohana_Encrypt_Engine {
 
 	abstract public function encrypt($data, $iv);
 	abstract public function decrypt($data);
+
 }

+ 3 - 2
modules/encrypt/classes/Kohana/Encrypt/Engine/Openssl.php

@@ -149,7 +149,7 @@ class Kohana_Encrypt_Engine_Openssl extends Kohana_Encrypt_Engine {
 
 		if ($decrypted === FALSE)
 		{
-				return FALSE;
+			return FALSE;
 		}
 
 		return $decrypted;
@@ -216,4 +216,5 @@ class Kohana_Encrypt_Engine_Openssl extends Kohana_Encrypt_Engine {
 
 		throw new Kohana_Exception('Could not create initialization vector.');
 	}
-}
+
+}

+ 6 - 6
modules/encrypt/config/encrypt.php

@@ -1,9 +1,9 @@
 <?php
 
-return array(
+return [
 
-	'default' => array(
-		'type'       => 'mcrypt',
+	'default' => [
+		'type' => 'mcrypt',
 		/**
 		 * The following options must be set:
 		 *
@@ -12,7 +12,7 @@ return array(
 		 * integer  cipher  encryption cipher, one of the Mcrpyt cipher constants
 		 */
 		'cipher' => MCRYPT_RIJNDAEL_128,
-		'mode'   => MCRYPT_MODE_NOFB,
-	),
+		'mode' => MCRYPT_MODE_NOFB,
+	],
 
-);
+];