Skip to content

Commit

Permalink
Merge pull request #690 from spatie/drop-spatie-string-dependency
Browse files Browse the repository at this point in the history
drop spatie/string dependency
  • Loading branch information
Gummibeer authored Mar 13, 2020
2 parents 5ca26d6 + 8bc64dc commit c73d0d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `spatie/laravel-activitylog` will be documented in this file

## 3.11.4 - 2020-03-11

- remove `spatie/string` dependency

## 3.11.3 - 2020-03-10

- fix performance issue around global vs model log disabling [#682](https://github.com/spatie/laravel-activitylog/pull/682)
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"php": "^7.2",
"illuminate/config": "^6.0|^7.0",
"illuminate/database": "^6.0|^7.0",
"illuminate/support": "^6.0|^7.0",
"spatie/string": "^2.1"
"illuminate/support": "^6.0|^7.0"
},
"require-dev": {
"ext-json": "*",
Expand Down
4 changes: 2 additions & 2 deletions src/ActivityLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use Spatie\Activitylog\Contracts\Activity as ActivityContract;
use Spatie\Activitylog\Exceptions\CouldNotLogActivity;
use Spatie\String\Str;

class ActivityLogger
{
Expand Down Expand Up @@ -187,7 +187,7 @@ protected function replacePlaceholders(string $description, ActivityContract $ac
return preg_replace_callback('/:[a-z0-9._-]+/i', function ($match) use ($activity) {
$match = $match[0];

$attribute = (string) (new Str($match))->between(':', '.');
$attribute = Str::before(Str::after($match, ':'), '.');

if (! in_array($attribute, ['subject', 'causer', 'properties'])) {
return $match;
Expand Down

0 comments on commit c73d0d2

Please sign in to comment.