Applied fixes from StyleCI
Diff
config/posttypes.php | 4 ++--
config/templates.php | 3 +--
config/wordpress.php | 2 +-
src/Models/Meta.php | 4 ++--
src/Models/User.php | 2 +-
src/Models/UserMeta.php | 4 ++--
src/Providers/ConfigServiceProvider.php | 2 +-
src/Providers/KoseligServiceProvider.php | 4 ----
src/Providers/WordpressServiceProvider.php | 1 -
src/Routing/ArchiveRoute.php | 4 ++--
src/Routing/PageRoute.php | 2 +-
src/Routing/SingularRoute.php | 2 +-
src/Routing/TemplateRoute.php | 2 +-
src/Support/Action.php | 2 +-
src/Support/Wordpress.php | 5 +++--
15 files changed, 19 insertions(+), 24 deletions(-)
@@ -14,6 +14,6 @@ return [
'supports' => [
'title',
'revisions',
]
]
],
],
];
@@ -11,7 +11,6 @@ return [
| application. This should be in slug => friendly name format.
*/
'home' => 'Homepage'
'home' => 'Homepage',
];
@@ -8,5 +8,5 @@ return [
'auth_salt' => env('AUTH_SALT'),
'secure_auth_salt' => env('SECURE_AUTH_SALT'),
'logged_in_salt' => env('LOGGED_IN_SALT'),
'nonce_salt' => env('NONCE_SALT')
'nonce_salt' => env('NONCE_SALT'),
];
@@ -22,7 +22,7 @@ class Meta extends Model
public static $cache = [];
/**
* Get metadata for a page (or the current page)
* Get metadata for a page (or the current page).
*
* <code>Meta::get('my_meta_key');</code>
* or
@@ -47,7 +47,7 @@ class Meta extends Model
if (!isset(self::$cache[$page])) {
// get all the meta values for a post, it's more than likely we're going to
// need this again query, so we'll just grab all the results and cache them.
self::$cache[$page] = Meta::where('post_id', $page)->get();
self::$cache[$page] = self::where('post_id', $page)->get();
}
if ($name === null) {
@@ -21,6 +21,6 @@ class User extends Model
*/
public function posts()
{
return $this->hasMany(User::class, 'post_author');
return $this->hasMany(self::class, 'post_author');
}
}
@@ -22,7 +22,7 @@ class UserMeta extends Model
public static $cache = [];
/**
* Get metadata for a user
* Get metadata for a user.
*
* @param int|string|null $user user to get meta for (or name of the meta item to get
* if you want to get the current user's meta)
@@ -43,7 +43,7 @@ class UserMeta extends Model
if (!isset(self::$cache[$user])) {
// get all the meta values for a post, it's more than likely we're going to
// need this again query, so we'll just grab all the results and cache them.
self::$cache[$user] = UserMeta::where('user_id', $user)->get();
self::$cache[$user] = self::where('user_id', $user)->get();
}
if ($name === null) {
@@ -15,7 +15,7 @@ class ConfigServiceProvider extends ServiceProvider
$this->publishes([
realpath(__DIR__ . '/../../config/templates.php') => config_path('templates.php'),
realpath(__DIR__ . '/../../config/wordpress.php') => config_path('wordpress.php'),
realpath(__DIR__ . '/../../config/posttypes.php') => config_path('posttypes.php')
realpath(__DIR__ . '/../../config/posttypes.php') => config_path('posttypes.php'),
]);
}
}
@@ -1,11 +1,7 @@
<?php
namespace Koselig\Providers;
use Illuminate\Container\Container;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Koselig\Support\TemplateRoute;
use Route;
/**
* Registers all the other service providers used by this package.
@@ -1,5 +1,4 @@
<?php
namespace Koselig\Providers;
use Illuminate\Contracts\Routing\UrlGenerator;
@@ -14,7 +14,7 @@ use Koselig\Support\Wordpress;
class ArchiveRoute extends Route
{
/**
* Post types for this archive route to hook onto
* Post types for this archive route to hook onto.
*
* @var array
*/
@@ -37,7 +37,7 @@ class ArchiveRoute extends Route
}
/**
* Format a nice string for php artisan route:list
* Format a nice string for php artisan route:list.
*
* @return string
*/
@@ -14,7 +14,7 @@ use Koselig\Support\Wordpress;
class PageRoute extends Route
{
/**
* Format a nice string for php artisan route:list
* Format a nice string for php artisan route:list.
*
* @return string
*/
@@ -37,7 +37,7 @@ class SingularRoute extends Route
}
/**
* Format a nice string for php artisan route:list
* Format a nice string for php artisan route:list.
*
* @return string
*/
@@ -14,7 +14,7 @@ use Koselig\Support\Wordpress;
class TemplateRoute extends Route
{
/**
* Format a nice string for php artisan route:list
* Format a nice string for php artisan route:list.
*
* @return string
*/
@@ -22,7 +22,7 @@ class Action
}
/**
* Run all filters hooked to <pre>$tag</pre> on the given <pre>$value</pre>
* Run all filters hooked to <pre>$tag</pre> on the given <pre>$value</pre>.
*
* @param string $tag tag to run
* @param mixed $value value to run filters on
@@ -18,6 +18,7 @@ class Wordpress
public static function query()
{
global $wp_query;
return $wp_query;
}
@@ -43,7 +44,7 @@ class Wordpress
}
/**
* Check if the current page is a singular item (eg. a news post)
* Check if the current page is a singular item (eg. a news post).
*
* @param array|string $types
* @return bool
@@ -54,7 +55,7 @@ class Wordpress
}
/**
* Check if the current page is an archive page
* Check if the current page is an archive page.
*
* @param string|array|null $types check if the archive page is for this type
* @return bool