-
Notifications
You must be signed in to change notification settings - Fork 7
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 #8 from ARCANEDEV/develop
Starting Laravel v8 support
- Loading branch information
Showing
113 changed files
with
829 additions
and
425 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
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,27 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
> | ||
> | ||
<testsuites> | ||
<testsuite name="Package Test Suite"> | ||
<directory suffix=".php">./tests/</directory> | ||
<directory suffix=".php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src/</directory> | ||
</whitelist> | ||
</filter> | ||
<logging> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
<log type="coverage-text" target="build/logs/coverage.txt"/> | ||
<log type="coverage-html" target="build/logs/coverage"/> | ||
</logging> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
<report> | ||
<clover outputFile="build/coverage/clover.xml"/> | ||
<html outputDirectory="build/coverage/html"/> | ||
<text outputFile="build/coverage/coverage.txt" showOnlySummary="true"/> | ||
</report> | ||
</coverage> | ||
</phpunit> |
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,10 +7,9 @@ | |
use Arcanedev\Html\Contracts\Renderable; | ||
|
||
/** | ||
* Interface HtmlElement | ||
* Interface HtmlElement | ||
* | ||
* @package Arcanedev\Html\Contracts | ||
* @author ARCANEDEV <[email protected]> | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
interface HtmlElement extends Renderable | ||
{ | ||
|
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 |
---|---|---|
|
@@ -5,10 +5,9 @@ | |
namespace Arcanedev\Html\Contracts; | ||
|
||
/** | ||
* Interface Html | ||
* Interface Html | ||
* | ||
* @package Arcanedev\Html\Contracts | ||
* @author ARCANEDEV <[email protected]> | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
interface Html | ||
{ | ||
|
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,10 +7,9 @@ | |
use Illuminate\Contracts\Support\Htmlable; | ||
|
||
/** | ||
* Interface Renderable | ||
* Interface Renderable | ||
* | ||
* @package Arcanedev\Html\Contracts | ||
* @author ARCANEDEV <[email protected]> | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
interface Renderable extends Htmlable | ||
{ | ||
|
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 |
---|---|---|
|
@@ -5,10 +5,9 @@ | |
namespace Arcanedev\Html\Contracts; | ||
|
||
/** | ||
* Interface Selectable | ||
* Interface Selectable | ||
* | ||
* @package Arcanedev\Html\Contracts | ||
* @author ARCANEDEV <[email protected]> | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
interface Selectable | ||
{ | ||
|
@@ -18,19 +17,23 @@ interface Selectable | |
*/ | ||
|
||
/** | ||
* @return static | ||
* Add the selected attribute. | ||
* | ||
* @param bool $selected | ||
* | ||
* @return $this | ||
*/ | ||
public function selected(); | ||
public function selected(bool $selected = true); | ||
|
||
/** | ||
* @param bool $condition | ||
* | ||
* @return static | ||
* @return $this | ||
*/ | ||
public function selectedIf($condition); | ||
|
||
/** | ||
* @return static | ||
* @return $this | ||
*/ | ||
public function unselected(); | ||
} |
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,7 +7,6 @@ | |
/** | ||
* Class A | ||
* | ||
* @package Arcanedev\Html\Elements | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class A extends HtmlElement | ||
|
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 |
---|---|---|
|
@@ -4,14 +4,24 @@ | |
|
||
namespace Arcanedev\Html\Elements; | ||
|
||
use Arcanedev\Html\Elements\Concerns\{HasNameAttribute, HasTypeAttribute, HasValueAttribute}; | ||
|
||
/** | ||
* Class Button | ||
* | ||
* @package Arcanedev\Html\Elements | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class Button extends HtmlElement | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Traits | ||
| ----------------------------------------------------------------- | ||
*/ | ||
|
||
use HasNameAttribute, | ||
HasTypeAttribute, | ||
HasValueAttribute; | ||
|
||
/* ----------------------------------------------------------------- | ||
| Properties | ||
| ----------------------------------------------------------------- | ||
|
@@ -25,18 +35,6 @@ class Button extends HtmlElement | |
| ----------------------------------------------------------------- | ||
*/ | ||
|
||
/** | ||
* Set the type attribute. | ||
* | ||
* @param string $type | ||
* | ||
* @return static | ||
*/ | ||
public function type($type) | ||
{ | ||
return $this->attributeIf(in_array($type, ['button', 'submit', 'reset']), 'type', $type); | ||
} | ||
|
||
/** | ||
* Set as submit button. | ||
* | ||
|
@@ -56,16 +54,4 @@ public function reset() | |
{ | ||
return $this->type('reset'); | ||
} | ||
|
||
/** | ||
* Set the value attribute. | ||
* | ||
* @param string $value | ||
* | ||
* @return static | ||
*/ | ||
public function value($value) | ||
{ | ||
return $this->attribute('value', $value); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
/** | ||
* Trait HasAttributes | ||
* | ||
* @package Arcanedev\Html\Elements\Concerns | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
trait HasAttributes | ||
|
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,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arcanedev\Html\Elements\Concerns; | ||
|
||
/** | ||
* Trait HasAutofocusAttribute | ||
* | ||
* @author ARCANEDEV <[email protected]> | ||
* | ||
* @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes | ||
*/ | ||
trait HasAutofocusAttribute | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Main Methods | ||
| ----------------------------------------------------------------- | ||
*/ | ||
|
||
/** | ||
* Add the autofocus attribute. | ||
* | ||
* @param bool $autofocus | ||
* | ||
* @return $this | ||
*/ | ||
public function autofocus($autofocus = true) | ||
{ | ||
return $autofocus | ||
? $this->attribute('autofocus') | ||
: $this->forgetAttribute('autofocus'); | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
/** | ||
* Trait HasChildElements | ||
* | ||
* @package Arcanedev\Html\Elements\Concerns | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
trait HasChildElements | ||
|
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 |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
/** | ||
* Trait HasConditionalMethods | ||
* | ||
* @package Arcanedev\Html\Elements\Concerns | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
trait HasConditionalMethods | ||
|
@@ -107,7 +106,6 @@ protected function callConditionalMethod(string $conditions, string $method, arr | |
|
||
case 'IfNotNull': | ||
return $this->ifNotNull($value, $callback); | ||
|
||
default: | ||
return $this; | ||
} | ||
|
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,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arcanedev\Html\Elements\Concerns; | ||
|
||
/** | ||
* Trait HasDisabledAttribute | ||
* | ||
* @author ARCANEDEV <[email protected]> | ||
* | ||
* @mixin \Arcanedev\Html\Elements\Concerns\HasAttributes | ||
*/ | ||
trait HasDisabledAttribute | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Main Methods | ||
| ----------------------------------------------------------------- | ||
*/ | ||
|
||
/** | ||
* Add the disabled attribute. | ||
* | ||
* @param bool $disabled | ||
* | ||
* @return $this | ||
*/ | ||
public function disabled($disabled = true) | ||
{ | ||
return $disabled | ||
? $this->attribute('disabled', 'disabled') | ||
: $this->forgetAttribute('disabled'); | ||
} | ||
} |
Oops, something went wrong.