@@ -5,13 +5,13 @@ |
||
5 | 5 | class SwpLogger |
6 | 6 | { |
7 | 7 | |
8 | - public static function log(string $message,bool $echo = false, string $fileName = 'swp.log') |
|
8 | + public static function log(string $message, bool $echo = false, string $fileName = 'swp.log') |
|
9 | 9 | { |
10 | 10 | $trace = debug_backtrace()[1]; |
11 | - $message = '[' . date('Y-m-d H:i:s') . '][' . $trace['class'] . '::' . $trace['function'] . '] ' . $message . PHP_EOL; |
|
11 | + $message = '['.date('Y-m-d H:i:s').']['.$trace['class'].'::'.$trace['function'].'] '.$message.PHP_EOL; |
|
12 | 12 | |
13 | 13 | if (!empty($fileName)) { |
14 | - file_put_contents('/tmp/' . $fileName, $message, FILE_APPEND); |
|
14 | + file_put_contents('/tmp/'.$fileName, $message, FILE_APPEND); |
|
15 | 15 | } |
16 | 16 | if ($echo) { |
17 | 17 | echo $message; |
@@ -137,9 +137,9 @@ |
||
137 | 137 | $article->setPublishedToAppleNews($destination->isPublishedToAppleNews()); |
138 | 138 | $this->eventDispatcher->dispatch(new GenericEvent($article), Events::SWP_VALIDATION); |
139 | 139 | $this->eventDispatcher->dispatch(new ArticleEvent($article, $package, ArticleEvents::PRE_UPDATE, $article->getRoute()), ArticleEvents::PRE_UPDATE); |
140 | - SwpLogger::log('PRE_UPDATE before flush: ' . ($article->isTimestampableCanceled() ? 'Y' : 'N')); |
|
140 | + SwpLogger::log('PRE_UPDATE before flush: '.($article->isTimestampableCanceled() ? 'Y' : 'N')); |
|
141 | 141 | $this->articleRepository->flush(); |
142 | - SwpLogger::log('PRE_UPDATE after flush: ' . ($article->isTimestampableCanceled() ? 'Y' : 'N')); |
|
142 | + SwpLogger::log('PRE_UPDATE after flush: '.($article->isTimestampableCanceled() ? 'Y' : 'N')); |
|
143 | 143 | |
144 | 144 | if ($destination->isPublished()) { |
145 | 145 | $this->eventDispatcher->dispatch(new ArticleEvent($article, $package, ArticleEvents::PUBLISH), ArticleEvents::PUBLISH); |
@@ -34,9 +34,9 @@ |
||
34 | 34 | * @var ?ArticleExtraTextField $dontUpdateDate |
35 | 35 | */ |
36 | 36 | $dontUpdateDate = $article->getExtraByKey('dont_change_updated_at') ?? null; |
37 | - SwpLogger::log('Dont update date is type of: ' . gettype($dontUpdateDate)); |
|
37 | + SwpLogger::log('Dont update date is type of: '.gettype($dontUpdateDate)); |
|
38 | 38 | if ($dontUpdateDate instanceof ArticleExtraTextField && strtolower($dontUpdateDate->getValue()) === 'on') { |
39 | - SwpLogger::log('Dont update date: ' . $dontUpdateDate->getValue()); |
|
39 | + SwpLogger::log('Dont update date: '.$dontUpdateDate->getValue()); |
|
40 | 40 | $article->cancelTimestampable(); |
41 | 41 | } |
42 | 42 | } |