public function licenseAction(Request $request, $repository, $format='svg')
    {
        $this->useCase = $this->container->get('use_case_badge_license');
        $this->imageFactory = $this->container->get('image_factory');

        if (in_array($request->query->get('format'), $this->container->get('poser')->validFormats())) {
            $format = $request->query->get('format');
        }

        $badge = $this->useCase->createLicenseBadge($repository, $format);
        $image = $this->imageFactory->createFromBadge($badge);

        return ResponseFactory::createFromImage($image, 200);
    }
public function licenseAction(Request $request, $repository, $format='svg')
    {
        $this->useCase = $this->container->get('use_case_badge_license');
        $this->imageFactory = $this->container->get('image_factory');

        if (in_array($request->query->get('format'), $this->container->get('poser')->validFormats())) {
            $format = $request->query->get('format');
        }

        $badge = $this->useCase->createLicenseBadge($repository, $format);
        $image = $this->imageFactory->createFromBadge($badge);

        return ResponseFactory::createFromImage($image, 200);
    }
public function licenseAction ( Request $ request , $ repository , $ format = 'svg' ) { $ this -> useCase = $ this -> container -> get ( 'use_case_badge_license' ) ; $ this -> imageFactory = $ this -> container -> get ( 'image_factory' ) ; if ( in_array ( $ request -> query -> get ( 'format' ) , $ this -> container -> get ( 'poser' ) -> validFormats ( ) ) ) { $ format = $ request -> query -> get ( 'format' ) ; } $ badge = $ this -> useCase -> createLicenseBadge ( $ repository , $ format ) ; $ image = $ this -> imageFactory -> createFromBadge ( $ badge ) ; return ResponseFactory :: createFromImage ( $ image , 200 ) ; }
License action.

@param string $repository repository

@Route("/{repository}/license",
name="pugx_badge_license",
requirements={"repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?"}
)

@Method({"GET"})
@Cache(maxage="3600", smaxage="3600", public=true)

@return Response
License action .