Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #12

Merged
merged 1 commit into from
Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
}
}
}