Skip to content

Commit

Permalink
Merge pull request #12 from Stillat/analysis-163deP
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
JohnathonKoster authored Nov 19, 2022
2 parents 85dac2e + 93f2f29 commit 1d69958
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/Listeners/TermDeletedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class TermDeletedListener
{
/** @var RelationshipManager */
/** @var RelationshipManager */
protected $manager;

public static $break = false;
Expand All @@ -32,4 +32,4 @@ public function handle(TermDeleted $event)
$this->manager->processor()->setIsDeleting()->setEntryId($term->slug())
->setPristineDetails($term, false)->process($relationships);
}
}
}
2 changes: 1 addition & 1 deletion src/Listeners/TermSavedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public function handle(TermSaved $event)

$this->manager->processor()->process($relationships);
}
}
}
4 changes: 2 additions & 2 deletions src/Listeners/TermSavingListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Stillat\Relationships\Listeners;

use Statamic\Events\TermSaving;
use Statamic\Taxonomies\Term;
use Statamic\Facades\Term as TermFacade;
use Statamic\Taxonomies\Term;
use Stillat\Relationships\RelationshipManager;

class TermSavingListener
Expand Down Expand Up @@ -42,4 +42,4 @@ public function handle(TermSaving $event)
$this->manager->processor()->setIsDeleting(false)
->setPristineDetails($term, ! $isUpdating);
}
}
}
1 change: 0 additions & 1 deletion src/Processors/Concerns/ProcessesOneToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Stillat\Relationships\Comparisons\ComparisonResult;
use Stillat\Relationships\EntryRelationship;
use Stillat\Relationships\Listeners\TermSavingListener;

trait ProcessesOneToOne
{
Expand Down
2 changes: 1 addition & 1 deletion src/RelationshipManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function manyToOne($leftCollectionHandle, $rightCollectionHandle)
/**
* Extracts collection and field information from relationship set notation.
*
* @param string $handles
* @param string $handles
* @return string[]
*/
public static function extractCollections($handles)
Expand Down
30 changes: 15 additions & 15 deletions tests/RelationshipTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ protected function createTerms()
];

foreach ($terms as $term) {
$title = 'Term ' . Str::ucfirst($term);
$title = 'Term '.Str::ucfirst($term);

Term::make()->taxonomy('topics')->slug('topics-' . $term)->data([
Term::make()->taxonomy('topics')->slug('topics-'.$term)->data([
'title' => $title,
])->save();
}
Expand All @@ -110,7 +110,7 @@ protected function createTerms()
/**
* Locate a taxonomy term by its slug.
*
* @param string $slug
* @param string $slug
* @return LocalizedTerm|null
*/
protected function getTerm($slug)
Expand Down Expand Up @@ -196,18 +196,18 @@ protected function createCollectionEntries()
]);

$this->createEntries('articles', [
[
'title' => 'Article One',
],
[
'title' => 'Article Two',
],
[
'title' => 'Article Three',
],
[
'title' => 'Article Four',
],
[
'title' => 'Article One',
],
[
'title' => 'Article Two',
],
[
'title' => 'Article Three',
],
[
'title' => 'Article Four',
],
]);
}
}
2 changes: 1 addition & 1 deletion tests/SetNotationRelationshipsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public function test_it_extracts_collection_names()
'entry:articles.related',
], RelationshipManager::extractCollections($left));
}
}
}

0 comments on commit 1d69958

Please sign in to comment.