diff --git a/app/Services/OptionForm.php b/app/Services/OptionForm.php
index 576fb670..8a955aa6 100644
--- a/app/Services/OptionForm.php
+++ b/app/Services/OptionForm.php
@@ -485,15 +485,6 @@ class OptionFormItem
return $this;
}
-
- /**
- * Render option item. Should be extended.
- *
- * @return \Illuminate\View\View|string
- */
- public function render()
- {
- }
}
class OptionFormText extends OptionFormItem
diff --git a/app/Services/Plugin.php b/app/Services/Plugin.php
index aeeaec19..0c8696cd 100644
--- a/app/Services/Plugin.php
+++ b/app/Services/Plugin.php
@@ -2,9 +2,7 @@
namespace App\Services;
-use ArrayAccess;
use Illuminate\Support\Arr;
-use Illuminate\Contracts\Support\Arrayable;
/**
* @property string $name
@@ -12,7 +10,7 @@ use Illuminate\Contracts\Support\Arrayable;
* @property string $title
* @property array $author
*/
-class Plugin implements Arrayable, ArrayAccess
+class Plugin
{
/**
* The full directory of this plugin.
@@ -112,14 +110,6 @@ class Plugin implements Arrayable, ArrayAccess
return $this;
}
- /**
- * @return bool
- */
- public function isInstalled()
- {
- return $this->installed;
- }
-
public function getDirname()
{
return $this->dirname;
@@ -230,63 +220,4 @@ class Plugin implements Arrayable, ArrayAccess
{
return $this->path;
}
-
- /**
- * Determine if the given option option exists.
- *
- * @param string $key
- * @return bool
- */
- public function offsetExists($key)
- {
- return Arr::has($this->packageInfo, $key);
- }
-
- /**
- * Get a option option.
- *
- * @param string $key
- * @return mixed
- */
- public function offsetGet($key)
- {
- return $this->packageInfoAttribute($key);
- }
-
- /**
- * Set a option option.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- */
- public function offsetSet($key, $value)
- {
- return Arr::set($this->packageInfo, $key, $value);
- }
-
- /**
- * Unset a option option.
- *
- * @param string $key
- * @return void
- */
- public function offsetUnset($key)
- {
- unset($this->packageInfo[$key]);
- }
-
- /**
- * Generates an array result for the object.
- *
- * @return array
- */
- public function toArray()
- {
- return (array) array_merge([
- 'name' => $this->name,
- 'version' => $this->getVersion(),
- 'path' => $this->path,
- ], $this->packageInfo);
- }
}
diff --git a/app/Services/Repositories/OptionRepository.php b/app/Services/Repositories/OptionRepository.php
index b49ffddb..30ae3739 100644
--- a/app/Services/Repositories/OptionRepository.php
+++ b/app/Services/Repositories/OptionRepository.php
@@ -136,25 +136,6 @@ class OptionRepository extends Repository
}
}
- /**
- * Return the options with key in the given array.
- *
- * @param array $array
- * @return array
- */
- public function only(array $array)
- {
- $result = [];
-
- foreach ($this->items as $key => $value) {
- if (in_array($key, $array)) {
- $result[$key] = $value;
- }
- }
-
- return $result;
- }
-
/**
* Save all modified options into database.
*/
diff --git a/app/Services/Repositories/Repository.php b/app/Services/Repositories/Repository.php
index 14a23343..9b0d3f4d 100644
--- a/app/Services/Repositories/Repository.php
+++ b/app/Services/Repositories/Repository.php
@@ -2,10 +2,9 @@
namespace App\Services\Repositories;
-use ArrayAccess;
use Illuminate\Support\Arr;
-class Repository implements ArrayAccess // Illuminate\Contracts\Cache\Repository
+class Repository
{
/**
* All of the items.
@@ -64,102 +63,4 @@ class Repository implements ArrayAccess // Illuminate\Contracts\Cache\Repository
$this->itemsModified[] = $key;
}
}
-
- /**
- * Push an item into the repository.
- *
- * @param mixed $item
- * @return void
- */
- public function push($item)
- {
- array_push($this->items, $item);
- }
-
- /**
- * Get all of the items stored in the repository.
- *
- * @return array
- */
- public function all()
- {
- return $this->items;
- }
-
- /**
- * Get an item from the repository, or store the default value.
- *
- * @param string $key
- * @param callable $callback
- * @return mixed
- */
- public function remember($key, callable $callback)
- {
- // If the item exists in the repository we will just return this immediately
- // otherwise we will execute the given Closure and repository the result
- // of that execution for the given number of minutes in storage.
- if (! is_null($value = $this->get($key))) {
- return $value;
- }
-
- $this->set($key, $value = $callback());
-
- return $value;
- }
-
- /**
- * Remove an item from the repository.
- *
- * @param string|array $key
- * @return void
- */
- public function forget($key)
- {
- Arr::forget($this->items, $key);
- }
-
- /**
- * Determine if the given option option exists.
- *
- * @param string $key
- * @return bool
- */
- public function offsetExists($key)
- {
- return $this->has($key);
- }
-
- /**
- * Get a option option.
- *
- * @param string $key
- * @return mixed
- */
- public function offsetGet($key)
- {
- return $this->get($key);
- }
-
- /**
- * Set a option option.
- *
- * @param string $key
- * @param mixed $value
- * @return void
- */
- public function offsetSet($key, $value)
- {
- $this->set($key, $value);
- }
-
- /**
- * Unset a option option.
- *
- * @param string $key
- * @return void
- */
- public function offsetUnset($key)
- {
- $this->forget($key);
- }
}
diff --git a/app/Services/Repositories/UserRepository.php b/app/Services/Repositories/UserRepository.php
index 56f0bb9b..ee4a0da7 100644
--- a/app/Services/Repositories/UserRepository.php
+++ b/app/Services/Repositories/UserRepository.php
@@ -75,9 +75,4 @@ class UserRepository extends Repository
return current($result);
}
-
- public function getCurrentUser()
- {
- return auth()->user();
- }
}
diff --git a/app/helpers.php b/app/helpers.php
index 99cee619..f0e5cfa6 100644
--- a/app/helpers.php
+++ b/app/helpers.php
@@ -16,13 +16,6 @@ if (! function_exists('get_base_url')) {
}
}
-if (! function_exists('get_current_url')) {
- function get_current_url()
- {
- return get_base_url().$_SERVER['REQUEST_URI'];
- }
-}
-
if (! function_exists('avatar')) {
function avatar(User $user, $size)
{
@@ -32,25 +25,13 @@ if (! function_exists('avatar')) {
}
}
-if (! function_exists('assets')) {
- function assets($relativeUri)
- {
- // Add query string to fresh cache
- if (Str::startsWith($relativeUri, 'css') || Str::startsWith($relativeUri, 'js')) {
- return url("resources/assets/dist/$relativeUri").'?v='.config('app.version');
- } elseif (Str::startsWith($relativeUri, 'lang')) {
- return url("resources/$relativeUri");
- } else {
- return url("resources/assets/$relativeUri");
- }
- }
-}
-
if (! function_exists('webpack_assets')) {
function webpack_assets($relativeUri)
{
if (app()->environment('development')) {
+ // @codeCoverageIgnoreStart
return "http://127.0.0.1:8080/public/$relativeUri";
+ // @codeCoverageIgnoreEnd
} else {
$cdn = option('cdn_address');
return $cdn ? "$cdn/app/$relativeUri" : url("app/$relativeUri");
@@ -266,15 +247,6 @@ if (! function_exists('bs_custom_copyright')) {
}
}
-if (! function_exists('bs_nickname')) {
- function bs_nickname(User $user = null)
- {
- $user = $user ?: auth()->user();
-
- return ($user->getNickName() == '') ? $user->email : $user->getNickName();
- }
-}
-
if (! function_exists('bs_role')) {
function bs_role(User $user = null)
{
diff --git a/resources/views/admin/master.blade.php b/resources/views/admin/master.blade.php
index d7f8a511..b81c4773 100644
--- a/resources/views/admin/master.blade.php
+++ b/resources/views/admin/master.blade.php
@@ -61,7 +61,7 @@
{{ bs_nickname($user) }}
+{{ $user->nickname ?? $user->email }}
{{ bs_role($user) }}