Skip to content
Permalink
Browse files

Fix PSR

  • Loading branch information...
alain-flaus committed Feb 25, 2015
1 parent 78ea4ef commit ce7b5bc82593f2ef1a3f86831eeb09db71c8df2e
@@ -81,7 +81,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$baseUrl = $input->getOption('base-url') ?: $container->getParameter('presta_sitemap.dumper_base_url');
$baseUrl = rtrim($baseUrl, '/') . '/';
if (!parse_url($baseUrl, PHP_URL_HOST)) { //sanity check
//sanity check
if (!parse_url($baseUrl, PHP_URL_HOST)) {
throw new \InvalidArgumentException("Invalid base url. Use fully qualified base url, e.g. http://acme.com/", self::ERR_INVALID_HOST);
}
$request = Request::create($baseUrl);
@@ -63,7 +63,6 @@ public function populateSitemap(SitemapPopulateEvent $event)
$section = $event->getSection();
if (is_null($section) || $section == 'default') {
$this->addUrlsFromRoutes($event);
}
}
@@ -77,8 +76,8 @@ private function addUrlsFromRoutes(SitemapPopulateEvent $event)
$collection = $this->router->getRouteCollection();
foreach ($collection->all() as $name => $route) {
$options = $this->getOptions($name, $route);
if ($options) {
$event->getGenerator()->addUrl(
$this->getUrlConcrete($name, $options),
@@ -1,2 +1,2 @@
cs:
phpcs --ignore=/vendor/*,/Tests/Resources/app/* --extensions=php --encoding=utf-8 --standard=PSR2 -np .
phpcs --ignore=/vendor/*,/Tests/app/* --extensions=php --encoding=utf-8 --standard=PSR2 -np .
@@ -16,11 +16,11 @@
use Presta\SitemapBundle\DependencyInjection\Compiler\AddSitemapListenersPass;
/**
* Bundle that provides tools to render application sitemap according to
* sitemap protocol. @see http://www.sitemaps.org/
* Bundle that provides tools to render application sitemap according to
* sitemap protocol. @see http://www.sitemaps.org/
* @see README.md for basic usage
*
* @author depely
*
* @author depely
*/
class PrestaSitemapBundle extends Bundle
{
@@ -14,7 +14,7 @@
/**
* Class used for managing image's url entities
*
*
* @author David Epely <depely@prestaconcept.net>
* @author Alain Flaus <aflaus@prestaconcept.net>
*/
@@ -28,12 +28,12 @@ class GoogleImage
/**
* create a GoogleImage for your GoogleImageUrl
*
* @param string $loc
* @param string $caption[optional]
* @param string $geo_location[optional]
* @param string $title[optional]
* @param string $license[optional]
*
* @param string $loc
* @param string $caption[optional]
* @param string $geo_location[optional]
* @param string $title[optional]
* @param string $license[optional]
*/
public function __construct($loc, $caption = null, $geo_location = null, $title = null, $license = null)
{
@@ -45,7 +45,9 @@ public function __construct($loc, $caption = null, $geo_location = null, $title
}
/**
* @param string $internal_uri
* @param $loc
*
* @return $this
*/
public function setLoc($loc)
{
@@ -54,15 +56,17 @@ public function setLoc($loc)
}
/**
* @return string
* @return mixed
*/
public function getLoc()
{
return $this->loc;
}
/**
* @param string $caption
* @param $caption
*
* @return $this
*/
public function setCaption($caption)
{
@@ -71,15 +75,17 @@ public function setCaption($caption)
}
/**
* @return string
* @return string
*/
public function getCaption()
{
return $this->caption;
}
/**
* @param string $caption
* @param $geo_location
*
* @return $this
*/
public function setGeoLocation($geo_location)
{
@@ -88,15 +94,17 @@ public function setGeoLocation($geo_location)
}
/**
* @return string
* @return mixed
*/
public function getGeoLocation()
{
return $this->geo_location;
}
/**
* @param string $title
* @param $title
*
* @return $this
*/
public function setTitle($title)
{
@@ -105,15 +113,17 @@ public function setTitle($title)
}
/**
* @return string
* @return mixed
*/
public function getTitle()
{
return $this->title;
}
/**
* @param string $license
* @param $license
*
* @return $this
*/
public function setLicense($license)
{
@@ -122,7 +132,7 @@ public function setLicense($license)
}
/**
* @return string
* @return mixed
*/
public function getLicense()
{
@@ -131,8 +141,8 @@ public function getLicense()
/**
* Return the xml representation for the image
*
* @return string
*
* @return string
*/
public function toXML()
{
@@ -19,7 +19,7 @@ interface Url
{
/**
* render element as xml
* render element as xml
* @return string
*/
public function toXml();
@@ -12,24 +12,24 @@
/**
* decorated url model
*
* @author David Epely
*
* @author David Epely
*/
abstract class UrlDecorator implements Url
{
protected $urlDecorated;
protected $customNamespaces = array();
/**
* @param Url $urlDecorated
* @param Url $urlDecorated
*/
public function __construct(Url $urlDecorated)
{
$this->urlDecorated = $urlDecorated;
}
/**
* @return array
* @return array
*/
public function getCustomNamespaces()
{

0 comments on commit ce7b5bc

Please sign in to comment.
You can’t perform that action at this time.