Skip to content

Commit

Permalink
laravel 6.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Oct 10, 2019
1 parent 2da9e5d commit 353c974
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/Utils/DebugInfo.php
Expand Up @@ -2,9 +2,8 @@

namespace Imanghafoori\Widgets\Utils;

/**
* Class DebugInfo.
*/
use Illuminate\Support\Str;

class DebugInfo
{
private $widget;
Expand All @@ -23,7 +22,7 @@ public function __construct()
* @param string $html
* @return string
*/
public function addIdentifierToHtml($widget, string $html): string
public function addIdentifierToHtml($widget, string $html)
{
$this->widget = $widget;
$this->html = $html;
Expand All @@ -48,7 +47,7 @@ private function addDebugInfo(): void
*
* @return string
*/
private function cacheState(): string
private function cacheState()
{
if (! $this->policies->widgetShouldUseCache()) {
return ' 
 Cache: is globally turned off (You should put "enable_cache" => true in config\widgetize.php) ';
Expand All @@ -67,9 +66,9 @@ private function addHtmlComments(): void
* @param string $tpl
* @return string
*/
private function getTplPath(string $tpl): string
private function getTplPath(string $tpl)
{
if (str_contains($tpl, 'Widgets::')) {
if (Str::contains($tpl, 'Widgets::')) {
$tpl = str_replace('Widgets::', app()->getNamespace().'Widgets\\', $tpl);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Utils/Normalizers/ControllerNormalizer.php
Expand Up @@ -2,6 +2,7 @@

namespace Imanghafoori\Widgets\Utils\Normalizers;

use Illuminate\Support\Str;
use Imanghafoori\Widgets\Utils\NormalizerContract;

class ControllerNormalizer implements NormalizerContract
Expand Down Expand Up @@ -62,7 +63,7 @@ private function determineDataMethod($widget): array
}

if (is_string($widget->controller)) {
if (! str_contains($widget->controller, '@')) {
if (! Str::contains($widget->controller, '@')) {
return [$widget->controller.'@data', $widget->controller];
}
$widget->controller = explode('@', $widget->controller);
Expand Down

0 comments on commit 353c974

Please sign in to comment.