Skip to content

Commit 4db5b07

Browse files
committed
php-cs-fixer changes
1 parent 607f2d0 commit 4db5b07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+447
-693
lines changed

resources/config/sluggable.php

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php
22

33
return [
4-
5-
/**
4+
/*
65
* What attributes do we use to build the slug?
76
* This can be a single field, like "name" which will build a slug from:
87
*
@@ -20,15 +19,15 @@
2019

2120
'source' => null,
2221

23-
/**
22+
/*
2423
* The maximum length of a generated slug. Defaults to "null", which means
2524
* no length restrictions are enforced. Set it to a positive integer if you
2625
* want to make sure your slugs aren't too long.
2726
*/
2827

2928
'maxLength' => null,
3029

31-
/**
30+
/*
3231
* If you are setting a maximum length on your slugs, you may not want the
3332
* truncated string to split a word in half. The default setting of "true"
3433
* will ensure this, e.g. with a maxLength of 12:
@@ -43,7 +42,7 @@
4342

4443
'maxLengthKeepWords' => true,
4544

46-
/**
45+
/*
4746
* If left to "null", then use the cocur/slugify package to generate the slug
4847
* (with the separator defined below).
4948
*
@@ -61,13 +60,11 @@
6160

6261
'method' => null,
6362

64-
/**
65-
* Separator to use when generating slugs. Defaults to a hyphen.
66-
*/
63+
// Separator to use when generating slugs. Defaults to a hyphen.
6764

6865
'separator' => '-',
6966

70-
/**
67+
/*
7168
* Enforce uniqueness of slugs? Defaults to true.
7269
* If a generated slug already exists, an incremental numeric
7370
* value will be appended to the end until a unique slug is found. e.g.:
@@ -79,18 +76,18 @@
7976

8077
'unique' => true,
8178

82-
/**
79+
/*
8380
* If you are enforcing unique slugs, the default is to add an
8481
* incremental value to the end of the base slug. Alternatively, you
8582
* can change this value to a closure that accepts three parameters:
8683
* the base slug, the separator, and a Collection of the other
8784
* "similar" slugs. The closure should return the new unique
8885
* suffix to append to the slug.
8986
*/
90-
87+
9188
'uniqueSuffix' => null,
9289

93-
/**
90+
/*
9491
* What is the first suffix to add to a slug to make it unique?
9592
* For the default method of adding incremental integers, we start
9693
* counting at 2, so the list of slugs would be, e.g.:
@@ -101,7 +98,7 @@
10198
*/
10299
'firstUniqueSuffix' => 2,
103100

104-
/**
101+
/*
105102
* Should we include the trashed items when generating a unique slug?
106103
* This only applies if the softDelete property is set for the Eloquent model.
107104
* If set to "false", then a new slug could duplicate one that exists on a trashed model.
@@ -110,7 +107,7 @@
110107

111108
'includeTrashed' => false,
112109

113-
/**
110+
/*
114111
* An array of slug names that can never be used for this model,
115112
* e.g. to prevent collisions with existing routes or controller methods, etc..
116113
* Defaults to null (i.e. no reserved names).
@@ -136,7 +133,7 @@
136133

137134
'reserved' => null,
138135

139-
/**
136+
/*
140137
* Whether to update the slug value when a model is being
141138
* re-saved (i.e. already exists). Defaults to false, which
142139
* means slugs are not updated.
@@ -146,13 +143,12 @@
146143
* is probably not a good idea from an SEO point of view.
147144
* Only set this to true if you understand the possible consequences.
148145
*/
149-
146+
150147
'onUpdate' => false,
151148

152-
/**
149+
/*
153150
* If the default slug engine of cocur/slugify is used, this array of
154151
* configuration options will be used when instantiating the engine.
155152
*/
156153
'slugEngineOptions' => [],
157-
158154
];

src/ServiceProvider.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
<?php namespace Cviebrock\EloquentSluggable;
1+
<?php
2+
3+
namespace Cviebrock\EloquentSluggable;
24

35
use Cviebrock\EloquentSluggable\Services\SlugService;
46
use Illuminate\Foundation\Application as LaravelApplication;
57
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
68
use Laravel\Lumen\Application as LumenApplication;
79

810
/**
9-
* Class ServiceProvider
10-
*
11-
* @package Cviebrock\EloquentSluggable
11+
* Class ServiceProvider.
1212
*/
1313
class ServiceProvider extends BaseServiceProvider
1414
{
15-
1615
/**
1716
* Bootstrap the application services.
1817
*/
@@ -26,7 +25,7 @@ public function boot(): void
2625
*/
2726
public function register()
2827
{
29-
$this->app->singleton(SluggableObserver::class, function($app) {
28+
$this->app->singleton(SluggableObserver::class, function ($app) {
3029
return new SluggableObserver(new SlugService(), $app['events']);
3130
});
3231
}
@@ -37,9 +36,9 @@ protected function setUpConfig(): void
3736

3837
if ($this->app instanceof LaravelApplication) {
3938
$this->publishes([$source => config_path('sluggable.php')], 'config');
40-
/** @phpstan-ignore-next-line */
39+
// @phpstan-ignore-next-line
4140
} elseif ($this->app instanceof LumenApplication) {
42-
$this->app->configure('sluggable'); /** @phpstan-ignore class.notFound */
41+
$this->app->configure('sluggable'); // @phpstan-ignore class.notFound
4342
}
4443

4544
$this->mergeConfigFrom($source, 'sluggable');

0 commit comments

Comments
 (0)