Skip to content

Commit

Permalink
resolve #64 issue for php8 depratected notice (#65)
Browse files Browse the repository at this point in the history
Co-authored-by: Asif Iqbal <[email protected]>
  • Loading branch information
webwizo and Asif Iqbal authored Dec 2, 2020
1 parent 6b4b2f4 commit 02d3a68
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"illuminate/view": "5.6.x|5.7.x|5.8.x|^6.0|^7.0|^8.0",
"illuminate/support": "5.6.x|5.7.x|5.8.x|^6.0|^7.0|^8.0",
"illuminate/contracts": "5.6.x|5.7.x|5.8.x|^6.0|^7.0|^8.0",
"php": "^7.2"
"php": "^7.2|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5|^8.0",
Expand Down
6 changes: 4 additions & 2 deletions src/View/Factory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Webwizo\Shortcodes\View;
<?php

namespace Webwizo\Shortcodes\View;

use Illuminate\Events\Dispatcher;
use Illuminate\View\ViewFinderInterface;
Expand Down Expand Up @@ -49,7 +51,7 @@ public function make($view, $data = [], $mergeData = [])
// the caller for rendering or performing other view manipulations on this.
$data = array_merge($mergeData, $this->parseData($data));

return tap(new View($this, $this->getEngineFromPath($path), $view, $path, $data, $this->shortcode), function ($view) {
return tap(new View($this->shortcode, $this, $this->getEngineFromPath($path), $view, $path, $data), function ($view) {
$this->callCreator($view);
});
}
Expand Down
8 changes: 5 additions & 3 deletions src/View/View.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Webwizo\Shortcodes\View;
<?php

namespace Webwizo\Shortcodes\View;

use ArrayAccess;
use Illuminate\Contracts\Support\Renderable;
Expand All @@ -19,14 +21,14 @@ class View extends IlluminateView implements ArrayAccess, Renderable
/**
* Create a new view instance.
*
* @param \Webwizo\Shortcodes\Compilers\ShortcodeCompiler $shortcode
* @param \Illuminate\View\Factory|Factory $factory
* @param \Illuminate\Contracts\View\Engine|EngineInterface $engine
* @param string $view
* @param string $path
* @param array $data
* @param \Webwizo\Shortcodes\Compilers\ShortcodeCompiler $shortcode
*/
public function __construct(Factory $factory, EngineInterface $engine, $view, $path, $data = [], ShortcodeCompiler $shortcode)
public function __construct(ShortcodeCompiler $shortcode, Factory $factory, EngineInterface $engine, $view, $path, $data = [])
{
parent::__construct($factory, $engine, $view, $path, $data);
$this->shortcode = $shortcode;
Expand Down

0 comments on commit 02d3a68

Please sign in to comment.