-
Notifications
You must be signed in to change notification settings - Fork 2
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 #5 from ARCANEDEV/develop
Combine the Laravel 5.1 & 5.2 support
- Loading branch information
Showing
16 changed files
with
740 additions
and
106 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
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 |
---|---|---|
|
@@ -7,19 +7,17 @@ | |
{ | ||
"name": "ARCANEDEV", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/ARCANEDEV" | ||
"homepage": "https://github.com/arcanedev-maroc", | ||
"role": "Developer" | ||
} | ||
], | ||
"type": "library", | ||
"license": "MIT", | ||
"require": { | ||
"php": ">=5.5.9", | ||
"arcanedev/support": "~3.0", | ||
"illuminate/routing": "~5.2.0", | ||
"illuminate/session": "~5.2.0" | ||
"arcanedev/support": "~3.0" | ||
}, | ||
"require-dev": { | ||
"orchestra/testbench": "~3.2.0", | ||
"phpunit/phpcov": "~2.0", | ||
"phpunit/phpunit": "~4.0|~5.0" | ||
}, | ||
|
@@ -34,6 +32,9 @@ | |
"Arcanedev\\LaravelHtml\\Tests\\": "tests/" | ||
} | ||
}, | ||
"scripts": { | ||
"testbench": "composer require --dev \"orchestra/testbench=~3.0\"" | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "5.3-dev" | ||
|
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php namespace Arcanedev\LaravelHtml\Bases; | ||
|
||
use Arcanedev\LaravelHtml\Traits\Componentable; | ||
use BadMethodCallException; | ||
use Illuminate\Support\HtmlString; | ||
use Illuminate\Support\Traits\Macroable; | ||
|
||
/** | ||
* Class Builder | ||
* | ||
* @package Arcanedev\LaravelHtml\Bases | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
abstract class Builder | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Traits | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
use Macroable, Componentable { | ||
Macroable::__call as macroCall; | ||
Componentable::__call as componentCall; | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Dynamically handle calls to the class. | ||
* | ||
* @param string $method | ||
* @param array $parameters | ||
* | ||
* @return \Illuminate\Contracts\View\View|mixed | ||
* | ||
* @throws \BadMethodCallException | ||
*/ | ||
public function __call($method, $parameters) | ||
{ | ||
try { | ||
return $this->componentCall($method, $parameters); | ||
} | ||
catch (BadMethodCallException $e) { | ||
// Continue | ||
} | ||
|
||
return $this->macroCall($method, $parameters); | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Other Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Transform the string to an Html serializable object | ||
* | ||
* @param string $html | ||
* | ||
* @return \Illuminate\Support\HtmlString | ||
*/ | ||
protected function toHtmlString($html) | ||
{ | ||
return new HtmlString($html); | ||
} | ||
} |
Oops, something went wrong.