Skip to content

Commit

Permalink
Merge pull request #5 from ARCANEDEV/develop
Browse files Browse the repository at this point in the history
Combine the Laravel 5.1 & 5.2 support
  • Loading branch information
arcanedev-maroc committed Dec 30, 2015
2 parents 728e8d9 + 7011e6d commit 06b230f
Show file tree
Hide file tree
Showing 16 changed files with 740 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 4
runs: 8
php_code_sniffer:
enabled: true
config:
Expand Down
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
language: php

sudo: false

php:
- 5.5.9
- 5.5
- 5.6
- 7.0
- hhvm

sudo: false
env:
- TESTBENCH_VERSION=3.1.*
- TESTBENCH_VERSION=3.2.*

before_script:
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction
- travis_retry composer require --prefer-source --no-interaction --dev "orchestra/testbench:${TESTBENCH_VERSION}"

script:
- composer validate
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
Expand Down
66 changes: 66 additions & 0 deletions src/Bases/Builder.php
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);
}
}
Loading

0 comments on commit 06b230f

Please sign in to comment.