Skip to content

Commit

Permalink
Fix PSR
Browse files Browse the repository at this point in the history
  • Loading branch information
halundraN committed Feb 25, 2015
1 parent 78ea4ef commit ce7b5bc
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 32 deletions.
4 changes: 3 additions & 1 deletion Command/DumpSitemapsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions EventListener/RouteAnnotationEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public function populateSitemap(SitemapPopulateEvent $event)
$section = $event->getSection();

if (is_null($section) || $section == 'default') {

$this->addUrlsFromRoutes($event);
}
}
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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 .
8 changes: 4 additions & 4 deletions PrestaSitemapBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
48 changes: 29 additions & 19 deletions Sitemap/Url/GoogleImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/**
* Class used for managing image's url entities
*
*
* @author David Epely <[email protected]>
* @author Alain Flaus <[email protected]>
*/
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -122,7 +132,7 @@ public function setLicense($license)
}

/**
* @return string
* @return mixed
*/
public function getLicense()
{
Expand All @@ -131,8 +141,8 @@ public function getLicense()

/**
* Return the xml representation for the image
*
* @return string
*
* @return string
*/
public function toXML()
{
Expand Down
2 changes: 1 addition & 1 deletion Sitemap/Url/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface Url
{

/**
* render element as xml
* render element as xml
* @return string
*/
public function toXml();
Expand Down
8 changes: 4 additions & 4 deletions Sitemap/Url/UrlDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit ce7b5bc

Please sign in to comment.