-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from ARCANEDEV/update-1
Update the package
- Loading branch information
Showing
9 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ php: | |
- 7.1.3 | ||
- 7.1 | ||
- 7.2 | ||
- 7.3 | ||
- nightly | ||
|
||
matrix: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015-2018 | ARCANEDEV <[email protected]> - LaravelSitemap | ||
Copyright (c) 2015-2019 | ARCANEDEV <[email protected]> - LaravelSitemap | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<?php namespace Arcanedev\LaravelSitemap\Exceptions; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Class SitemapException | ||
* | ||
* @package Arcanedev\LaravelSitemap\Exceptions | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class SitemapException extends \Exception {} | ||
class SitemapException extends Exception {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
<?php namespace Arcanedev\LaravelSitemap; | ||
|
||
use Arcanedev\LaravelSitemap\Contracts\Entities\Sitemap; | ||
use DOMDocument; | ||
use Illuminate\Support\Collection; | ||
use Illuminate\Support\Str; | ||
|
||
/** | ||
* Class SitemapBuilder | ||
* | ||
* @package Arcanedev\LaravelSitemap\Tests | ||
* @package Arcanedev\LaravelSitemap | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class SitemapBuilder | ||
|
@@ -19,7 +21,7 @@ class SitemapBuilder | |
/** | ||
* Create the builder instance. | ||
* | ||
* @return self | ||
* @return \Arcanedev\LaravelSitemap\SitemapBuilder | ||
*/ | ||
public static function make() | ||
{ | ||
|
@@ -33,9 +35,11 @@ public static function make() | |
* @param \Illuminate\Support\Collection $sitemaps | ||
* @param string $format | ||
* | ||
* @throws \Throwable | ||
* | ||
* @return string|null | ||
*/ | ||
public function build($name, $sitemaps, $format) | ||
public function build($name, Collection $sitemaps, $format) | ||
{ | ||
if ($sitemaps->isEmpty()) | ||
return null; | ||
|
@@ -46,7 +50,9 @@ public function build($name, $sitemaps, $format) | |
: static::renderSitemap($format, $sitemaps->first()); | ||
} | ||
|
||
list($name, $key) = Str::contains($name, '.') ? explode('.', $name, 2) : [$name, null]; | ||
list($name, $key) = Str::contains($name, '.') | ||
? explode('.', $name, 2) | ||
: [$name, null]; | ||
|
||
if ($sitemaps->has($name)) | ||
return static::renderSitemap($format, $sitemaps->get($name), $key); | ||
|
@@ -66,9 +72,11 @@ public function build($name, $sitemaps, $format) | |
* @param \Arcanedev\LaravelSitemap\Contracts\Entities\Sitemap|null $sitemap | ||
* @param string|null $key | ||
* | ||
* @throws \Throwable | ||
* | ||
* @return string|null | ||
*/ | ||
protected function renderSitemap($format, $sitemap, $key = null) | ||
protected function renderSitemap($format, Sitemap $sitemap = null, $key = null) | ||
{ | ||
if (is_null($sitemap)) | ||
return null; | ||
|
@@ -89,7 +97,9 @@ protected function renderSitemap($format, $sitemap, $key = null) | |
* @param string $format | ||
* @param \Illuminate\Support\Collection $sitemaps | ||
* | ||
* @return null|string | ||
* @throws \Throwable | ||
* | ||
* @return string|null | ||
*/ | ||
protected function renderSitemapIndex($format, $sitemaps) | ||
{ | ||
|
@@ -103,7 +113,9 @@ protected function renderSitemapIndex($format, $sitemaps) | |
* @param string $type | ||
* @param array $data | ||
* | ||
* @return null|string | ||
* @throws \Throwable | ||
* | ||
* @return string|null | ||
*/ | ||
protected function render($format, $type, array $data) | ||
{ | ||
|
@@ -147,6 +159,8 @@ protected function renderXml($format, $type, array $data) | |
* @param string $format | ||
* @param array $data | ||
* | ||
* @throws \Throwable | ||
* | ||
* @return string | ||
*/ | ||
protected function renderView($type, $format, array $data) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters