for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the PHP Translation package.
*
* (c) PHP Translation team <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Translation\Bundle\Catalogue;
use Symfony\Component\Translation\MetadataAwareInterface;
class NoteParser
{
/**
* @param $domain
* @param $key
* @param MetadataAwareInterface $catalogue
* @return array
public function getNotes($domain, $key, MetadataAwareInterface $catalogue)
$meta = $catalogue->getMetadata($key, $domain);
if (!isset($meta['notes'])) {
return [];
}
return $meta['notes'];
* @param array $notes
* @return bool
public function hasNoteObsolete(array $notes)
foreach ($notes as $note) {
if ($note['content'] === 'status:obsolete') {
return true;
return false;
public function hasNoteNew(array $notes)
if ($note['content'] === 'status:new') {