Skip to content

Commit

Permalink
Merge branch '3.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Feb 24, 2019
2 parents dbdb615 + d7fa11f commit 8c0496f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/Asset.php
Expand Up @@ -117,7 +117,7 @@ public function add(
$attributes = [],
$replaces = []
) {
$type = (pathinfo($source, PATHINFO_EXTENSION) == 'css') ? 'style' : 'script';
$type = (\pathinfo($source, PATHINFO_EXTENSION) == 'css') ? 'style' : 'script';

return $this->$type($name, $source, $dependencies, $attributes, $replaces);
}
Expand All @@ -140,7 +140,7 @@ public function style(
$attributes = [],
$replaces = []
) {
if (! array_key_exists('media', $attributes)) {
if (! \array_key_exists('media', $attributes)) {
$attributes['media'] = 'all';
}

Expand Down Expand Up @@ -196,8 +196,8 @@ protected function register(
$attributes = (array) $attributes;
$replaces = (array) $replaces;

if (is_array($name)) {
$replaces = array_merge($name, $replaces);
if (\is_array($name)) {
$replaces = \array_merge($name, $replaces);
$name = '*';
}

Expand Down
6 changes: 3 additions & 3 deletions src/AssetServiceProvider.php
Expand Up @@ -27,7 +27,7 @@ public function register()
*
* @return void
*/
protected function registerAsset()
protected function registerAsset(): void
{
$this->app->singleton('orchestra.asset', function (Application $app) {
return new Factory($app->make('orchestra.asset.dispatcher'));
Expand All @@ -39,7 +39,7 @@ protected function registerAsset()
*
* @return void
*/
protected function registerDispatcher()
protected function registerDispatcher(): void
{
$this->app->singleton('orchestra.asset.dispatcher', function (Application $app) {
return new Dispatcher(
Expand All @@ -56,7 +56,7 @@ protected function registerDispatcher()
*
* @return void
*/
protected function registerResolver()
protected function registerResolver(): void
{
$this->app->singleton('orchestra.asset.resolver', function () {
return new DependencyResolver();
Expand Down
6 changes: 3 additions & 3 deletions src/DependencyResolver.php
Expand Up @@ -50,7 +50,7 @@ protected function evaluateAsset(
// list and remove it from the array of assets. Otherwise, we will
// not verify the asset's dependencies and determine if they've been
// sorted.
if (count($assets[$asset]['dependencies']) == 0) {
if (\count($assets[$asset]['dependencies']) == 0) {
$sorted[$asset] = $value;

unset($assets[$asset]);
Expand Down Expand Up @@ -117,7 +117,7 @@ protected function dependencyIsValid(
): bool {
// Determine if asset and dependency is circular.
$isCircular = function ($asset, $dependency, $assets) {
return isset($assets[$dependency]) && in_array($asset, $assets[$dependency]['dependencies']);
return isset($assets[$dependency]) && \in_array($asset, $assets[$dependency]['dependencies']);
};

if (! isset($original[$dependency])) {
Expand Down Expand Up @@ -171,7 +171,7 @@ protected function resolveDependenciesForAsset(
$changed = false;

foreach ($value['dependencies'] as $key => $dependency) {
if (in_array($dependency, $replaces)) {
if (\in_array($dependency, $replaces)) {
$changed = true;
unset($value['dependencies'][$key]);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Dispatcher.php
Expand Up @@ -96,11 +96,11 @@ public function run(string $group, array $assets = [], ?string $prefix = null):
{
$html = '';

if (! isset($assets[$group]) || count($assets[$group]) == 0) {
if (! isset($assets[$group]) || \count($assets[$group]) == 0) {
return $html;
}

is_null($prefix) || $this->path = rtrim($prefix, '/');
\is_null($prefix) || $this->path = \rtrim($prefix, '/');

foreach ($this->resolver->arrange($assets[$group]) as $data) {
$html .= $this->asset($group, $data);
Expand Down Expand Up @@ -143,7 +143,7 @@ protected function isLocalPath(string $path): bool
return false;
}

return filter_var($path, FILTER_VALIDATE_URL) === false;
return \filter_var($path, FILTER_VALIDATE_URL) === false;
}

/**
Expand All @@ -158,7 +158,7 @@ protected function getAssetSourceUrl(string $source): string
// If the source is not a complete URL, we will go ahead and prepend
// the asset's path to the source provided with the asset. This will
// ensure that we attach the correct path to the asset.
if (! $this->isLocalPath($file = $this->path.'/'.ltrim($source, '/'))) {
if (! $this->isLocalPath($file = $this->path.'/'.\ltrim($source, '/'))) {
return $file;
}

Expand Down

0 comments on commit 8c0496f

Please sign in to comment.