Skip to content

Commit 24ddefb

Browse files
committed
Remove exception logging in getAttachmentAltText by @peyman-mohamadpour
1 parent ffbde5b commit 24ddefb

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

Resources/config/services.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ services:
2525
class: Kayue\WordpressBundle\Wordpress\Helper\AttachmentHelper
2626
arguments:
2727
- '@kayue_wordpress'
28-
- '@logger'
2928

3029
kayue_wordpress.manager.configuration:
3130
class: '%kayue_wordpress.manager.configuration.class%'

Wordpress/Helper/AttachmentHelper.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Kayue\WordpressBundle\Entity\Post;
66
use Kayue\WordpressBundle\Wordpress\ManagerRegistry;
7-
use Psr\Log\LoggerInterface;
87

98
class AttachmentHelper
109
{
@@ -13,21 +12,14 @@ class AttachmentHelper
1312
*/
1413
protected $managerRegistry;
1514

16-
/**
17-
* @var LoggerInterface
18-
*/
19-
protected $logger;
20-
2115
/**
2216
* AttachmentHelper constructor.
2317
*
2418
* @param ManagerRegistry $managerRegistry
25-
* @param LoggerInterface $logger
2619
*/
27-
public function __construct(ManagerRegistry $managerRegistry, LoggerInterface $logger = null)
20+
public function __construct(ManagerRegistry $managerRegistry)
2821
{
2922
$this->managerRegistry = $managerRegistry;
30-
$this->logger = $logger;
3123
}
3224

3325
protected function getManager()
@@ -109,11 +101,6 @@ public function getAttachmentAltText(Post $post)
109101

110102
} catch (\Exception $exception) {
111103

112-
if (null !== $this->logger) {
113-
114-
$this->logger->error($exception->getMessage());
115-
}
116-
117104
return '';
118105
}
119106

0 commit comments

Comments
 (0)