From 75e010903e07f8c2509db90e061197e57584d272 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Mon, 3 Oct 2016 19:49:36 +0000 Subject: [PATCH] Applied fixes from StyleCI --- 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(-) diff --git a/config/posttypes.php b/config/posttypes.php index fe2b144..4bb949f 100644 --- a/config/posttypes.php +++ b/config/posttypes.php @@ -14,6 +14,6 @@ return [ 'supports' => [ 'title', 'revisions', - ] - ] + ], + ], ]; diff --git a/config/templates.php b/config/templates.php index 4b56186..2551fd2 100644 --- a/config/templates.php +++ b/config/templates.php @@ -11,7 +11,6 @@ return [ | application. This should be in slug => friendly name format. */ - 'home' => 'Homepage' + 'home' => 'Homepage', ]; - diff --git a/config/wordpress.php b/config/wordpress.php index 6d01ff8..d9f41bc 100644 --- a/config/wordpress.php +++ b/config/wordpress.php @@ -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'), ]; diff --git a/src/Models/Meta.php b/src/Models/Meta.php index 0a6b153..03c6973 100644 --- a/src/Models/Meta.php +++ b/src/Models/Meta.php @@ -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). * * Meta::get('my_meta_key'); * 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) { diff --git a/src/Models/User.php b/src/Models/User.php index 75e2a03..80a82f5 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -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'); } } diff --git a/src/Models/UserMeta.php b/src/Models/UserMeta.php index 7f92cbc..db1c581 100644 --- a/src/Models/UserMeta.php +++ b/src/Models/UserMeta.php @@ -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) { diff --git a/src/Providers/ConfigServiceProvider.php b/src/Providers/ConfigServiceProvider.php index 336f587..9cde954 100644 --- a/src/Providers/ConfigServiceProvider.php +++ b/src/Providers/ConfigServiceProvider.php @@ -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'), ]); } } diff --git a/src/Providers/KoseligServiceProvider.php b/src/Providers/KoseligServiceProvider.php index bfa9d30..0380878 100644 --- a/src/Providers/KoseligServiceProvider.php +++ b/src/Providers/KoseligServiceProvider.php @@ -1,11 +1,7 @@ $tag on the given
$value
+ * Run all filters hooked to
$tag
on the given
$value
. * * @param string $tag tag to run * @param mixed $value value to run filters on diff --git a/src/Support/Wordpress.php b/src/Support/Wordpress.php index 776b40c..e6a51cd 100644 --- a/src/Support/Wordpress.php +++ b/src/Support/Wordpress.php @@ -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 -- libgit2 1.7.2