diff --git a/Command/DumpSitemapsCommand.php b/Command/DumpSitemapsCommand.php index 8cc7dc46..1c62bd35 100644 --- a/Command/DumpSitemapsCommand.php +++ b/Command/DumpSitemapsCommand.php @@ -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); diff --git a/EventListener/RouteAnnotationEventListener.php b/EventListener/RouteAnnotationEventListener.php index 9d31be90..dba41153 100644 --- a/EventListener/RouteAnnotationEventListener.php +++ b/EventListener/RouteAnnotationEventListener.php @@ -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), diff --git a/Makefile b/Makefile index e1f40f64..d72a6f33 100644 --- a/Makefile +++ b/Makefile @@ -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 . diff --git a/PrestaSitemapBundle.php b/PrestaSitemapBundle.php index d6379646..5aab0b77 100644 --- a/PrestaSitemapBundle.php +++ b/PrestaSitemapBundle.php @@ -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 { diff --git a/Sitemap/Url/GoogleImage.php b/Sitemap/Url/GoogleImage.php index 45701ef0..6ab37e02 100644 --- a/Sitemap/Url/GoogleImage.php +++ b/Sitemap/Url/GoogleImage.php @@ -14,7 +14,7 @@ /** * Class used for managing image's url entities - * + * * @author David Epely * @author Alain Flaus */ @@ -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,7 +56,7 @@ public function setLoc($loc) } /** - * @return string + * @return mixed */ public function getLoc() { @@ -62,7 +64,9 @@ public function getLoc() } /** - * @param string $caption + * @param $caption + * + * @return $this */ public function setCaption($caption) { @@ -71,7 +75,7 @@ public function setCaption($caption) } /** - * @return string + * @return string */ public function getCaption() { @@ -79,7 +83,9 @@ public function getCaption() } /** - * @param string $caption + * @param $geo_location + * + * @return $this */ public function setGeoLocation($geo_location) { @@ -88,7 +94,7 @@ public function setGeoLocation($geo_location) } /** - * @return string + * @return mixed */ public function getGeoLocation() { @@ -96,7 +102,9 @@ public function getGeoLocation() } /** - * @param string $title + * @param $title + * + * @return $this */ public function setTitle($title) { @@ -105,7 +113,7 @@ public function setTitle($title) } /** - * @return string + * @return mixed */ public function getTitle() { @@ -113,7 +121,9 @@ public function getTitle() } /** - * @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() { diff --git a/Sitemap/Url/Url.php b/Sitemap/Url/Url.php index 7116cf81..f6dbdaf9 100644 --- a/Sitemap/Url/Url.php +++ b/Sitemap/Url/Url.php @@ -19,7 +19,7 @@ interface Url { /** - * render element as xml + * render element as xml * @return string */ public function toXml(); diff --git a/Sitemap/Url/UrlDecorator.php b/Sitemap/Url/UrlDecorator.php index 0a6fa69c..852397e8 100644 --- a/Sitemap/Url/UrlDecorator.php +++ b/Sitemap/Url/UrlDecorator.php @@ -12,8 +12,8 @@ /** * decorated url model - * - * @author David Epely + * + * @author David Epely */ abstract class UrlDecorator implements Url { @@ -21,7 +21,7 @@ abstract class UrlDecorator implements Url protected $customNamespaces = array(); /** - * @param Url $urlDecorated + * @param Url $urlDecorated */ public function __construct(Url $urlDecorated) { @@ -29,7 +29,7 @@ public function __construct(Url $urlDecorated) } /** - * @return array + * @return array */ public function getCustomNamespaces() {