Completed
Pull Request — develop (#86)
by Igor
03:56
created

AuthSavePermissionsException::setAuthObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php namespace Magestead\Exceptions;
2
3
/**
4
 * Class AuthSavePermissionsException
5
 * @package Magestead\Exceptions
6
 */
7
class AuthSavePermissionsException extends \RuntimeException
8
{
9
    const TPL = "\n\nFile auth.json is not writable. Please add the following content manually: \n%s\n";
10
11
    /**
12
     * @param array $auth
13
     * @return self
14
     */
15
    public function setAuthObject(array $auth)
16
    {
17
        $this->message = sprintf(static::TPL, json_encode($auth, JSON_PRETTY_PRINT));
18
        return $this;
19
    }
20
}
21