open-orchestra/open-orchestra-base-api-bundle

View on GitHub
BaseApiBundle/Controller/Annotation/Groups.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace OpenOrchestra\BaseApiBundle\Controller\Annotation;

/**
 * Class Groups
 *
 * @Annotation
 * @Target({"METHOD"})
 */
class Groups
{
    public $groups = array();

    /**
     * @param array $data
     */
    public function __construct($data)
    {
        if (isset($data['value'])) {
            $this->groups = is_array($data['value']) ? $data['value'] : array_map('trim', explode(',', $data['value']));
        }
    }
}