Skip to content

Commit f7d2ad7

Browse files
committed
formatting
1 parent 9e02941 commit f7d2ad7

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/PhpWord/Metadata/Protection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
namespace PhpOffice\PhpWord\Metadata;
1919

20-
use PhpOffice\PhpWord\SimpleType\DocProtect;
2120
use PhpOffice\PhpWord\Shared\Microsoft\PasswordEncoder;
21+
use PhpOffice\PhpWord\SimpleType\DocProtect;
2222

2323
/**
2424
* Document protection class

src/PhpWord/Shared/Microsoft/PasswordEncoder.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PasswordEncoder
3232
const ALGORITHM_RIPEMD = 'RIPEMD';
3333
const ALGORITHM_RIPEMD_160 = 'RIPEMD-160';
3434
const ALGORITHM_MAC = 'MAC';
35-
const ALGORITHM_HMAC= 'HMAC';
35+
const ALGORITHM_HMAC = 'HMAC';
3636

3737
/**
3838
* Mapping between algorithm name and algorithm ID
@@ -41,17 +41,17 @@ class PasswordEncoder
4141
* @see https://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.writeprotection.cryptographicalgorithmsid(v=office.14).aspx
4242
*/
4343
private static $algorithmMapping = array(
44-
self::ALGORITHM_MD2 => array(1, 'md2'),
45-
self::ALGORITHM_MD4 => array(2, 'md4'),
46-
self::ALGORITHM_MD5 => array(3, 'md5'),
47-
self::ALGORITHM_SHA_1 => array(4, 'sha1'),
48-
self::ALGORITHM_MAC => array(5, ''), // 'mac' -> not possible with hash()
49-
self::ALGORITHM_RIPEMD => array(6, 'ripemd'),
44+
self::ALGORITHM_MD2 => array(1, 'md2'),
45+
self::ALGORITHM_MD4 => array(2, 'md4'),
46+
self::ALGORITHM_MD5 => array(3, 'md5'),
47+
self::ALGORITHM_SHA_1 => array(4, 'sha1'),
48+
self::ALGORITHM_MAC => array(5, ''), // 'mac' -> not possible with hash()
49+
self::ALGORITHM_RIPEMD => array(6, 'ripemd'),
5050
self::ALGORITHM_RIPEMD_160 => array(7, 'ripemd160'),
51-
self::ALGORITHM_HMAC => array(9, ''), //'hmac' -> not possible with hash()
52-
self::ALGORITHM_SHA_256 => array(12, 'sha256'),
53-
self::ALGORITHM_SHA_384 => array(13, 'sha384'),
54-
self::ALGORITHM_SHA_512 => array(14, 'sha512'),
51+
self::ALGORITHM_HMAC => array(9, ''), //'hmac' -> not possible with hash()
52+
self::ALGORITHM_SHA_256 => array(12, 'sha256'),
53+
self::ALGORITHM_SHA_384 => array(13, 'sha384'),
54+
self::ALGORITHM_SHA_512 => array(14, 'sha512'),
5555
);
5656

5757
private static $initialCodeArray = array(
@@ -99,10 +99,10 @@ class PasswordEncoder
9999
* @param string $password
100100
* @param string $algorithmName
101101
* @param string $salt
102-
* @param integer $spinCount
102+
* @param int $spinCount
103103
* @return string
104104
*/
105-
public static function hashPassword($password, $algorithmName = PasswordEncoder::ALGORITHM_SHA_1, $salt = null, $spinCount = 10000)
105+
public static function hashPassword($password, $algorithmName = self::ALGORITHM_SHA_1, $salt = null, $spinCount = 10000)
106106
{
107107
$origEncoding = mb_internal_encoding();
108108
mb_internal_encoding('UTF-8');

0 commit comments

Comments
 (0)