Skip to content

Commit

Permalink
Fix issues reported by PHPCS
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaskill committed Nov 1, 2023
1 parent f167ff7 commit 3250b22
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/Charcoal/Sitemap/Action/SitemapAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function addAlternateToXml(SimpleXMLElement $urlElement, array $altern
{
$alternateUrl = ltrim($alternate['url'], '/');
if (parse_url($alternateUrl, PHP_URL_HOST) === null) {
$alternateUrl = $this->baseUrl.$alternateUrl;
$alternateUrl = $this->baseUrl . $alternateUrl;
}

if ($this->isExternalHost($alternateUrl)) {
Expand Down Expand Up @@ -137,7 +137,7 @@ protected function addLinkToXml(SimpleXMLElement $urlsetElement, array $link)
{
$linkUrl = ltrim($link['url'], '/');
if (parse_url($linkUrl, PHP_URL_HOST) === null) {
$linkUrl = $this->baseUrl.$linkUrl;
$linkUrl = $this->baseUrl . $linkUrl;
}

if (!$this->isExternalHost($linkUrl)) {
Expand Down Expand Up @@ -173,13 +173,13 @@ protected function addLinkToXml(SimpleXMLElement $urlsetElement, array $link)
*/
protected function createXmlEnvelope()
{
$xml = '<?xml version="1.0" encoding="UTF-8"?>'
.'<urlset'
.' xmlns="'.$this->xmlNamespaces['xmlns'].'"'
.' xmlns:xhtml="'.$this->xmlNamespaces['xhtml'].'"'
.' xmlns:xsi="'.$this->xmlNamespaces['xsi'].'"'
.' xsi:schemaLocation="'.$this->xsiNamespaces['schemaLocation'].'"'
.'/>';
$xml = '<?xml version="1.0" encoding="UTF-8"?>';
$xml .= '<urlset';
$xml .= ' xmlns="' . $this->xmlNamespaces['xmlns'] . '"';
$xml .= ' xmlns:xhtml="' . $this->xmlNamespaces['xhtml'] . '"';
$xml .= ' xmlns:xsi="' . $this->xmlNamespaces['xsi'] . '"';
$xml .= ' xsi:schemaLocation="' . $this->xsiNamespaces['schemaLocation'] . '"';
$xml .= '/>';

return new SimpleXmlElement($xml);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Charcoal/Sitemap/Service/SitemapPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public function transform($obj, $transformer = null)
);
}


$that = $this;

return $this->getCacheFacade()->get(
Expand Down Expand Up @@ -189,7 +188,9 @@ private function objectGet($obj, $propertyName)
return $obj->{$propertyName};
}

if (is_string($propertyName) && (is_array($obj) || $obj instanceof ArrayAccess) && (isset($obj[$propertyName]))) {
if (is_string($propertyName) &&
(is_array($obj) || $obj instanceof ArrayAccess) &&
isset($obj[$propertyName])) {
return $obj[$propertyName];
}

Expand Down
5 changes: 4 additions & 1 deletion src/Charcoal/Sitemap/SitemapModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ private function setupPublicRoutes()
RequestInterface $request,
ResponseInterface $response,
array $args = []
) use ($config, $container) {
) use (
$config,
$container
) {
$routeControllerClass = $this['route/controller/action/class'];

$routeController = $container['route/factory']->create($routeControllerClass, [
Expand Down

0 comments on commit 3250b22

Please sign in to comment.