@@ -103,6 +103,6 @@ |
||
| 103 | 103 | $time = new \DateTime('now', $timeZone); |
| 104 | 104 | $timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTime::ATOM)); |
| 105 | 105 | |
| 106 | - return $timestampInfo . ' ' . $this->formatter->format($message); |
|
| 106 | + return $timestampInfo.' '.$this->formatter->format($message); |
|
| 107 | 107 | } |
| 108 | 108 | } |
@@ -28,84 +28,84 @@ |
||
| 28 | 28 | use Symfony\Component\Console\Formatter\OutputFormatterStyleInterface; |
| 29 | 29 | |
| 30 | 30 | class TimestampFormatter implements OutputFormatterInterface { |
| 31 | - /** @var IConfig */ |
|
| 32 | - protected $config; |
|
| 31 | + /** @var IConfig */ |
|
| 32 | + protected $config; |
|
| 33 | 33 | |
| 34 | - /** @var OutputFormatterInterface */ |
|
| 35 | - protected $formatter; |
|
| 34 | + /** @var OutputFormatterInterface */ |
|
| 35 | + protected $formatter; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * @param IConfig $config |
|
| 39 | - * @param OutputFormatterInterface $formatter |
|
| 40 | - */ |
|
| 41 | - public function __construct(IConfig $config, OutputFormatterInterface $formatter) { |
|
| 42 | - $this->config = $config; |
|
| 43 | - $this->formatter = $formatter; |
|
| 44 | - } |
|
| 37 | + /** |
|
| 38 | + * @param IConfig $config |
|
| 39 | + * @param OutputFormatterInterface $formatter |
|
| 40 | + */ |
|
| 41 | + public function __construct(IConfig $config, OutputFormatterInterface $formatter) { |
|
| 42 | + $this->config = $config; |
|
| 43 | + $this->formatter = $formatter; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Sets the decorated flag. |
|
| 48 | - * |
|
| 49 | - * @param bool $decorated Whether to decorate the messages or not |
|
| 50 | - */ |
|
| 51 | - public function setDecorated($decorated) { |
|
| 52 | - $this->formatter->setDecorated($decorated); |
|
| 53 | - } |
|
| 46 | + /** |
|
| 47 | + * Sets the decorated flag. |
|
| 48 | + * |
|
| 49 | + * @param bool $decorated Whether to decorate the messages or not |
|
| 50 | + */ |
|
| 51 | + public function setDecorated($decorated) { |
|
| 52 | + $this->formatter->setDecorated($decorated); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Gets the decorated flag. |
|
| 57 | - * |
|
| 58 | - * @return bool true if the output will decorate messages, false otherwise |
|
| 59 | - */ |
|
| 60 | - public function isDecorated() { |
|
| 61 | - return $this->formatter->isDecorated(); |
|
| 62 | - } |
|
| 55 | + /** |
|
| 56 | + * Gets the decorated flag. |
|
| 57 | + * |
|
| 58 | + * @return bool true if the output will decorate messages, false otherwise |
|
| 59 | + */ |
|
| 60 | + public function isDecorated() { |
|
| 61 | + return $this->formatter->isDecorated(); |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Sets a new style. |
|
| 66 | - * |
|
| 67 | - * @param string $name The style name |
|
| 68 | - * @param OutputFormatterStyleInterface $style The style instance |
|
| 69 | - */ |
|
| 70 | - public function setStyle($name, OutputFormatterStyleInterface $style) { |
|
| 71 | - $this->formatter->setStyle($name, $style); |
|
| 72 | - } |
|
| 64 | + /** |
|
| 65 | + * Sets a new style. |
|
| 66 | + * |
|
| 67 | + * @param string $name The style name |
|
| 68 | + * @param OutputFormatterStyleInterface $style The style instance |
|
| 69 | + */ |
|
| 70 | + public function setStyle($name, OutputFormatterStyleInterface $style) { |
|
| 71 | + $this->formatter->setStyle($name, $style); |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Checks if output formatter has style with specified name. |
|
| 76 | - * |
|
| 77 | - * @param string $name |
|
| 78 | - * @return bool |
|
| 79 | - */ |
|
| 80 | - public function hasStyle($name) { |
|
| 81 | - return $this->formatter->hasStyle($name); |
|
| 82 | - } |
|
| 74 | + /** |
|
| 75 | + * Checks if output formatter has style with specified name. |
|
| 76 | + * |
|
| 77 | + * @param string $name |
|
| 78 | + * @return bool |
|
| 79 | + */ |
|
| 80 | + public function hasStyle($name) { |
|
| 81 | + return $this->formatter->hasStyle($name); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * Gets style options from style with specified name. |
|
| 86 | - * |
|
| 87 | - * @param string $name |
|
| 88 | - * @return OutputFormatterStyleInterface |
|
| 89 | - * @throws \InvalidArgumentException When style isn't defined |
|
| 90 | - */ |
|
| 91 | - public function getStyle($name) { |
|
| 92 | - return $this->formatter->getStyle($name); |
|
| 93 | - } |
|
| 84 | + /** |
|
| 85 | + * Gets style options from style with specified name. |
|
| 86 | + * |
|
| 87 | + * @param string $name |
|
| 88 | + * @return OutputFormatterStyleInterface |
|
| 89 | + * @throws \InvalidArgumentException When style isn't defined |
|
| 90 | + */ |
|
| 91 | + public function getStyle($name) { |
|
| 92 | + return $this->formatter->getStyle($name); |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * Formats a message according to the given styles. |
|
| 97 | - * |
|
| 98 | - * @param string $message The message to style |
|
| 99 | - * @return string The styled message, prepended with a timestamp using the |
|
| 100 | - * log timezone and dateformat, e.g. "2015-06-23T17:24:37+02:00" |
|
| 101 | - */ |
|
| 102 | - public function format($message) { |
|
| 103 | - $timeZone = $this->config->getSystemValue('logtimezone', 'UTC'); |
|
| 104 | - $timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null; |
|
| 95 | + /** |
|
| 96 | + * Formats a message according to the given styles. |
|
| 97 | + * |
|
| 98 | + * @param string $message The message to style |
|
| 99 | + * @return string The styled message, prepended with a timestamp using the |
|
| 100 | + * log timezone and dateformat, e.g. "2015-06-23T17:24:37+02:00" |
|
| 101 | + */ |
|
| 102 | + public function format($message) { |
|
| 103 | + $timeZone = $this->config->getSystemValue('logtimezone', 'UTC'); |
|
| 104 | + $timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null; |
|
| 105 | 105 | |
| 106 | - $time = new \DateTime('now', $timeZone); |
|
| 107 | - $timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTime::ATOM)); |
|
| 106 | + $time = new \DateTime('now', $timeZone); |
|
| 107 | + $timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTime::ATOM)); |
|
| 108 | 108 | |
| 109 | - return $timestampInfo . ' ' . $this->formatter->format($message); |
|
| 110 | - } |
|
| 109 | + return $timestampInfo . ' ' . $this->formatter->format($message); |
|
| 110 | + } |
|
| 111 | 111 | } |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | */ |
| 55 | 55 | public function getBody() { |
| 56 | 56 | return $this->stream ? |
| 57 | - $this->response->getBody()->detach(): |
|
| 58 | - $this->response->getBody()->getContents(); |
|
| 57 | + $this->response->getBody()->detach() : $this->response->getBody()->getContents(); |
|
| 59 | 58 | } |
| 60 | 59 | |
| 61 | 60 | /** |
@@ -33,57 +33,57 @@ |
||
| 33 | 33 | * @package OC\Http |
| 34 | 34 | */ |
| 35 | 35 | class Response implements IResponse { |
| 36 | - /** @var ResponseInterface */ |
|
| 37 | - private $response; |
|
| 36 | + /** @var ResponseInterface */ |
|
| 37 | + private $response; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @var bool |
|
| 41 | - */ |
|
| 42 | - private $stream; |
|
| 39 | + /** |
|
| 40 | + * @var bool |
|
| 41 | + */ |
|
| 42 | + private $stream; |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @param ResponseInterface $response |
|
| 46 | - * @param bool $stream |
|
| 47 | - */ |
|
| 48 | - public function __construct(ResponseInterface $response, $stream = false) { |
|
| 49 | - $this->response = $response; |
|
| 50 | - $this->stream = $stream; |
|
| 51 | - } |
|
| 44 | + /** |
|
| 45 | + * @param ResponseInterface $response |
|
| 46 | + * @param bool $stream |
|
| 47 | + */ |
|
| 48 | + public function __construct(ResponseInterface $response, $stream = false) { |
|
| 49 | + $this->response = $response; |
|
| 50 | + $this->stream = $stream; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * @return string|resource |
|
| 55 | - */ |
|
| 56 | - public function getBody() { |
|
| 57 | - return $this->stream ? |
|
| 58 | - $this->response->getBody()->detach(): |
|
| 59 | - $this->response->getBody()->getContents(); |
|
| 60 | - } |
|
| 53 | + /** |
|
| 54 | + * @return string|resource |
|
| 55 | + */ |
|
| 56 | + public function getBody() { |
|
| 57 | + return $this->stream ? |
|
| 58 | + $this->response->getBody()->detach(): |
|
| 59 | + $this->response->getBody()->getContents(); |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * @return int |
|
| 64 | - */ |
|
| 65 | - public function getStatusCode(): int { |
|
| 66 | - return $this->response->getStatusCode(); |
|
| 67 | - } |
|
| 62 | + /** |
|
| 63 | + * @return int |
|
| 64 | + */ |
|
| 65 | + public function getStatusCode(): int { |
|
| 66 | + return $this->response->getStatusCode(); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * @param string $key |
|
| 71 | - * @return string |
|
| 72 | - */ |
|
| 73 | - public function getHeader(string $key): string { |
|
| 74 | - $headers = $this->response->getHeader($key); |
|
| 69 | + /** |
|
| 70 | + * @param string $key |
|
| 71 | + * @return string |
|
| 72 | + */ |
|
| 73 | + public function getHeader(string $key): string { |
|
| 74 | + $headers = $this->response->getHeader($key); |
|
| 75 | 75 | |
| 76 | - if (count($headers) === 0) { |
|
| 77 | - return ''; |
|
| 78 | - } |
|
| 76 | + if (count($headers) === 0) { |
|
| 77 | + return ''; |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - return $headers[0]; |
|
| 81 | - } |
|
| 80 | + return $headers[0]; |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * @return array |
|
| 85 | - */ |
|
| 86 | - public function getHeaders(): array { |
|
| 87 | - return $this->response->getHeaders(); |
|
| 88 | - } |
|
| 83 | + /** |
|
| 84 | + * @return array |
|
| 85 | + */ |
|
| 86 | + public function getHeaders(): array { |
|
| 87 | + return $this->response->getHeaders(); |
|
| 88 | + } |
|
| 89 | 89 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | * @return string |
| 62 | 62 | */ |
| 63 | 63 | public function __toString() { |
| 64 | - return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n"; |
|
| 64 | + return __CLASS__.": [{$this->code}]: {$this->message} ({$this->hint})\n"; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -34,46 +34,46 @@ |
||
| 34 | 34 | * @package OC |
| 35 | 35 | */ |
| 36 | 36 | class HintException extends \Exception { |
| 37 | - private $hint; |
|
| 37 | + private $hint; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * HintException constructor. |
|
| 41 | - * |
|
| 42 | - * @param string $message The error message. It will be not revealed to the |
|
| 43 | - * the user (unless the hint is empty) and thus |
|
| 44 | - * should be not translated. |
|
| 45 | - * @param string $hint A useful message that is presented to the end |
|
| 46 | - * user. It should be translated, but must not |
|
| 47 | - * contain sensitive data. |
|
| 48 | - * @param int $code |
|
| 49 | - * @param \Exception|null $previous |
|
| 50 | - */ |
|
| 51 | - public function __construct($message, $hint = '', $code = 0, \Exception $previous = null) { |
|
| 52 | - $this->hint = $hint; |
|
| 53 | - parent::__construct($message, $code, $previous); |
|
| 54 | - } |
|
| 39 | + /** |
|
| 40 | + * HintException constructor. |
|
| 41 | + * |
|
| 42 | + * @param string $message The error message. It will be not revealed to the |
|
| 43 | + * the user (unless the hint is empty) and thus |
|
| 44 | + * should be not translated. |
|
| 45 | + * @param string $hint A useful message that is presented to the end |
|
| 46 | + * user. It should be translated, but must not |
|
| 47 | + * contain sensitive data. |
|
| 48 | + * @param int $code |
|
| 49 | + * @param \Exception|null $previous |
|
| 50 | + */ |
|
| 51 | + public function __construct($message, $hint = '', $code = 0, \Exception $previous = null) { |
|
| 52 | + $this->hint = $hint; |
|
| 53 | + parent::__construct($message, $code, $previous); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Returns a string representation of this Exception that includes the error |
|
| 58 | - * code, the message and the hint. |
|
| 59 | - * |
|
| 60 | - * @return string |
|
| 61 | - */ |
|
| 62 | - public function __toString() { |
|
| 63 | - return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n"; |
|
| 64 | - } |
|
| 56 | + /** |
|
| 57 | + * Returns a string representation of this Exception that includes the error |
|
| 58 | + * code, the message and the hint. |
|
| 59 | + * |
|
| 60 | + * @return string |
|
| 61 | + */ |
|
| 62 | + public function __toString() { |
|
| 63 | + return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n"; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Returns the hint with the intention to be presented to the end user. If |
|
| 68 | - * an empty hint was specified upon instatiation, the message is returned |
|
| 69 | - * instead. |
|
| 70 | - * |
|
| 71 | - * @return string |
|
| 72 | - */ |
|
| 73 | - public function getHint() { |
|
| 74 | - if (empty($this->hint)) { |
|
| 75 | - return $this->message; |
|
| 76 | - } |
|
| 77 | - return $this->hint; |
|
| 78 | - } |
|
| 66 | + /** |
|
| 67 | + * Returns the hint with the intention to be presented to the end user. If |
|
| 68 | + * an empty hint was specified upon instatiation, the message is returned |
|
| 69 | + * instead. |
|
| 70 | + * |
|
| 71 | + * @return string |
|
| 72 | + */ |
|
| 73 | + public function getHint() { |
|
| 74 | + if (empty($this->hint)) { |
|
| 75 | + return $this->message; |
|
| 76 | + } |
|
| 77 | + return $this->hint; |
|
| 78 | + } |
|
| 79 | 79 | } |
@@ -26,79 +26,79 @@ |
||
| 26 | 26 | use OCP\Diagnostics\IEvent; |
| 27 | 27 | |
| 28 | 28 | class Event implements IEvent { |
| 29 | - /** |
|
| 30 | - * @var string |
|
| 31 | - */ |
|
| 32 | - protected $id; |
|
| 29 | + /** |
|
| 30 | + * @var string |
|
| 31 | + */ |
|
| 32 | + protected $id; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @var float |
|
| 36 | - */ |
|
| 37 | - protected $start; |
|
| 34 | + /** |
|
| 35 | + * @var float |
|
| 36 | + */ |
|
| 37 | + protected $start; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @var float |
|
| 41 | - */ |
|
| 42 | - protected $end; |
|
| 39 | + /** |
|
| 40 | + * @var float |
|
| 41 | + */ |
|
| 42 | + protected $end; |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @var string |
|
| 46 | - */ |
|
| 47 | - protected $description; |
|
| 44 | + /** |
|
| 45 | + * @var string |
|
| 46 | + */ |
|
| 47 | + protected $description; |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @param string $id |
|
| 51 | - * @param string $description |
|
| 52 | - * @param float $start |
|
| 53 | - */ |
|
| 54 | - public function __construct($id, $description, $start) { |
|
| 55 | - $this->id = $id; |
|
| 56 | - $this->description = $description; |
|
| 57 | - $this->start = $start; |
|
| 58 | - } |
|
| 49 | + /** |
|
| 50 | + * @param string $id |
|
| 51 | + * @param string $description |
|
| 52 | + * @param float $start |
|
| 53 | + */ |
|
| 54 | + public function __construct($id, $description, $start) { |
|
| 55 | + $this->id = $id; |
|
| 56 | + $this->description = $description; |
|
| 57 | + $this->start = $start; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * @param float $time |
|
| 62 | - */ |
|
| 63 | - public function end($time) { |
|
| 64 | - $this->end = $time; |
|
| 65 | - } |
|
| 60 | + /** |
|
| 61 | + * @param float $time |
|
| 62 | + */ |
|
| 63 | + public function end($time) { |
|
| 64 | + $this->end = $time; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * @return float |
|
| 69 | - */ |
|
| 70 | - public function getStart() { |
|
| 71 | - return $this->start; |
|
| 72 | - } |
|
| 67 | + /** |
|
| 68 | + * @return float |
|
| 69 | + */ |
|
| 70 | + public function getStart() { |
|
| 71 | + return $this->start; |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * @return string |
|
| 76 | - */ |
|
| 77 | - public function getId() { |
|
| 78 | - return $this->id; |
|
| 79 | - } |
|
| 74 | + /** |
|
| 75 | + * @return string |
|
| 76 | + */ |
|
| 77 | + public function getId() { |
|
| 78 | + return $this->id; |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * @return string |
|
| 83 | - */ |
|
| 84 | - public function getDescription() { |
|
| 85 | - return $this->description; |
|
| 86 | - } |
|
| 81 | + /** |
|
| 82 | + * @return string |
|
| 83 | + */ |
|
| 84 | + public function getDescription() { |
|
| 85 | + return $this->description; |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - /** |
|
| 89 | - * @return float |
|
| 90 | - */ |
|
| 91 | - public function getEnd() { |
|
| 92 | - return $this->end; |
|
| 93 | - } |
|
| 88 | + /** |
|
| 89 | + * @return float |
|
| 90 | + */ |
|
| 91 | + public function getEnd() { |
|
| 92 | + return $this->end; |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * @return float |
|
| 97 | - */ |
|
| 98 | - public function getDuration() { |
|
| 99 | - if (!$this->end) { |
|
| 100 | - $this->end = microtime(true); |
|
| 101 | - } |
|
| 102 | - return $this->end - $this->start; |
|
| 103 | - } |
|
| 95 | + /** |
|
| 96 | + * @return float |
|
| 97 | + */ |
|
| 98 | + public function getDuration() { |
|
| 99 | + if (!$this->end) { |
|
| 100 | + $this->end = microtime(true); |
|
| 101 | + } |
|
| 102 | + return $this->end - $this->start; |
|
| 103 | + } |
|
| 104 | 104 | } |
@@ -25,14 +25,14 @@ |
||
| 25 | 25 | namespace OC; |
| 26 | 26 | |
| 27 | 27 | class NaturalSort_DefaultCollator { |
| 28 | - public function compare($a, $b) { |
|
| 29 | - $result = strcasecmp($a, $b); |
|
| 30 | - if ($result === 0) { |
|
| 31 | - if ($a === $b) { |
|
| 32 | - return 0; |
|
| 33 | - } |
|
| 34 | - return ($a > $b) ? -1 : 1; |
|
| 35 | - } |
|
| 36 | - return ($result < 0) ? -1 : 1; |
|
| 37 | - } |
|
| 28 | + public function compare($a, $b) { |
|
| 29 | + $result = strcasecmp($a, $b); |
|
| 30 | + if ($result === 0) { |
|
| 31 | + if ($a === $b) { |
|
| 32 | + return 0; |
|
| 33 | + } |
|
| 34 | + return ($a > $b) ? -1 : 1; |
|
| 35 | + } |
|
| 36 | + return ($result < 0) ? -1 : 1; |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -25,12 +25,12 @@ |
||
| 25 | 25 | use OC\BackgroundJob\QueuedJob; |
| 26 | 26 | |
| 27 | 27 | class CallableJob extends QueuedJob { |
| 28 | - protected function run($serializedCallable) { |
|
| 29 | - $callable = unserialize($serializedCallable); |
|
| 30 | - if (is_callable($callable)) { |
|
| 31 | - $callable(); |
|
| 32 | - } else { |
|
| 33 | - throw new \InvalidArgumentException('Invalid serialized callable'); |
|
| 34 | - } |
|
| 35 | - } |
|
| 28 | + protected function run($serializedCallable) { |
|
| 29 | + $callable = unserialize($serializedCallable); |
|
| 30 | + if (is_callable($callable)) { |
|
| 31 | + $callable(); |
|
| 32 | + } else { |
|
| 33 | + throw new \InvalidArgumentException('Invalid serialized callable'); |
|
| 34 | + } |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -26,13 +26,13 @@ |
||
| 26 | 26 | use SuperClosure\Serializer; |
| 27 | 27 | |
| 28 | 28 | class ClosureJob extends QueuedJob { |
| 29 | - protected function run($serializedCallable) { |
|
| 30 | - $serializer = new Serializer(); |
|
| 31 | - $callable = $serializer->unserialize($serializedCallable); |
|
| 32 | - if (is_callable($callable)) { |
|
| 33 | - $callable(); |
|
| 34 | - } else { |
|
| 35 | - throw new \InvalidArgumentException('Invalid serialized callable'); |
|
| 36 | - } |
|
| 37 | - } |
|
| 29 | + protected function run($serializedCallable) { |
|
| 30 | + $serializer = new Serializer(); |
|
| 31 | + $callable = $serializer->unserialize($serializedCallable); |
|
| 32 | + if (is_callable($callable)) { |
|
| 33 | + $callable(); |
|
| 34 | + } else { |
|
| 35 | + throw new \InvalidArgumentException('Invalid serialized callable'); |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -29,12 +29,12 @@ |
||
| 29 | 29 | * Wrap a command in the background job interface |
| 30 | 30 | */ |
| 31 | 31 | class CommandJob extends QueuedJob { |
| 32 | - protected function run($serializedCommand) { |
|
| 33 | - $command = unserialize($serializedCommand); |
|
| 34 | - if ($command instanceof ICommand) { |
|
| 35 | - $command->handle(); |
|
| 36 | - } else { |
|
| 37 | - throw new \InvalidArgumentException('Invalid serialized command'); |
|
| 38 | - } |
|
| 39 | - } |
|
| 32 | + protected function run($serializedCommand) { |
|
| 33 | + $command = unserialize($serializedCommand); |
|
| 34 | + if ($command instanceof ICommand) { |
|
| 35 | + $command->handle(); |
|
| 36 | + } else { |
|
| 37 | + throw new \InvalidArgumentException('Invalid serialized command'); |
|
| 38 | + } |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -24,23 +24,23 @@ |
||
| 24 | 24 | namespace OC\Template; |
| 25 | 25 | |
| 26 | 26 | class ResourceNotFoundException extends \LogicException { |
| 27 | - protected $resource; |
|
| 28 | - protected $webPath; |
|
| 27 | + protected $resource; |
|
| 28 | + protected $webPath; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @param string $resource |
|
| 32 | - * @param string $webPath |
|
| 33 | - */ |
|
| 34 | - public function __construct($resource, $webPath) { |
|
| 35 | - parent::__construct('Resource not found'); |
|
| 36 | - $this->resource = $resource; |
|
| 37 | - $this->webPath = $webPath; |
|
| 38 | - } |
|
| 30 | + /** |
|
| 31 | + * @param string $resource |
|
| 32 | + * @param string $webPath |
|
| 33 | + */ |
|
| 34 | + public function __construct($resource, $webPath) { |
|
| 35 | + parent::__construct('Resource not found'); |
|
| 36 | + $this->resource = $resource; |
|
| 37 | + $this->webPath = $webPath; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @return string |
|
| 42 | - */ |
|
| 43 | - public function getResourcePath() { |
|
| 44 | - return $this->webPath . '/' . $this->resource; |
|
| 45 | - } |
|
| 40 | + /** |
|
| 41 | + * @return string |
|
| 42 | + */ |
|
| 43 | + public function getResourcePath() { |
|
| 44 | + return $this->webPath . '/' . $this->resource; |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -41,6 +41,6 @@ |
||
| 41 | 41 | * @return string |
| 42 | 42 | */ |
| 43 | 43 | public function getResourcePath() { |
| 44 | - return $this->webPath . '/' . $this->resource; |
|
| 44 | + return $this->webPath.'/'.$this->resource; |
|
| 45 | 45 | } |
| 46 | 46 | } |