Skip to content

Commit

Permalink
refactor: change namespace BracketSpace\Notification\Defaults to Brac…
Browse files Browse the repository at this point in the history
…ketSpace\Notification\Repository
  • Loading branch information
jakubmikita committed Jun 2, 2024
1 parent f7cecad commit 2706c9d
Show file tree
Hide file tree
Showing 156 changed files with 561 additions and 549 deletions.
569 changes: 292 additions & 277 deletions phpstan-baseline.neon

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo
- In Post Triggers, dynamic property `$trigger->{$post_type}` has been replaced with static prop `$trigger->post`.
- The same as above applies to Post Trigger datetime tags, namely: postCreationDatetime, postPublicationDatetime, and postModificationDatetime.
- Hook `notification/data/save` and `notification/data/save/after` now pass Core\Notification instance in the first param instead of the WordPress adapter instance.
- Namespace `BracketSpace\Notification\Defaults\` has been changed to `BracketSpace\Notification\Repository\`

Renamed runtime components:
- core_settings -> settings
Expand Down Expand Up @@ -364,6 +365,7 @@ Removed deprecated hooks:
* [Changed] Notification table is now filtered from uneccessary columns.
* [Changed] Multiple function, method and hook deprecations, see above for detailed list and replacements.
* [Changed] Runtime components names, see above for detailed list and replacements.
* [Changed] Namespace `BracketSpace\Notification\Defaults\` to `BracketSpace\Notification\Repository\`.
* [Fixed] Shortcodes being uncorrectly stripped leaving closing "]" behind.
* [Fixed] PHP 8.2 deprecations.
* [Fixed] Stripping shortcodes in carrier fields.
Expand Down
8 changes: 4 additions & 4 deletions src/Abstracts/Carrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
namespace BracketSpace\Notification\Abstracts;

use BracketSpace\Notification\Core\Resolver;
use BracketSpace\Notification\Defaults\Field;
use BracketSpace\Notification\Defaults\Field\RecipientsField;
use BracketSpace\Notification\Repository\Field;
use BracketSpace\Notification\Repository\Field\RecipientsField;
use BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic;
use BracketSpace\Notification\Interfaces;
use BracketSpace\Notification\Interfaces\Triggerable;
Expand All @@ -39,7 +39,7 @@ abstract class Carrier implements Interfaces\Sendable
/**
* Recipients form field closure
*
* @var callable(): \BracketSpace\Notification\Defaults\Field\RecipientsField|null
* @var callable(): \BracketSpace\Notification\Repository\Field\RecipientsField|null
*/
protected $recipientsField;

Expand Down Expand Up @@ -284,7 +284,7 @@ public function hasRecipientsField()
* Gets the recipients field
* Calls the field closure.
*
* @return \BracketSpace\Notification\Defaults\Field\RecipientsField|null
* @return \BracketSpace\Notification\Repository\Field\RecipientsField|null
* @since 8.0.0
*/
public function getRecipientsField()
Expand Down
2 changes: 1 addition & 1 deletion src/Abstracts/Trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function addMergeTag(Taggable $mergeTag)
public function addQuickMergeTag($propertyName, $label, $group = null)
{
return $this->addMergeTag(
new \BracketSpace\Notification\Defaults\MergeTag\StringTag(
new \BracketSpace\Notification\Repository\MergeTag\StringTag(
[
'slug' => $propertyName,
'name' => $label,
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Controller/RepeaterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class RepeaterController
public function formFieldData($data = null)
{
if (empty($data)) {
/** @var \BracketSpace\Notification\Defaults\Field\RepeaterField */
/** @var \BracketSpace\Notification\Repository\Field\RepeaterField */
$carrierFields = $this->getCarrierFields();
$data = $carrierFields->fields;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Controller/SectionRepeaterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function formData()
{
$values = $this->getValues($this->postId, $this->carrier, $this->field) ?? [];

/** @var \BracketSpace\Notification\Defaults\Field\SectionRepeater */
/** @var \BracketSpace\Notification\Repository\Field\SectionRepeater */
$field = $this->getCarrierFields();

$populatedSections = $this->getSectionsFields($field->sections);
Expand Down
6 changes: 3 additions & 3 deletions src/Integration/WordPressIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ public static function clearNotificationsCache()
public function identifyTrigger($triggerKey, Triggerable $trigger)
{
$coveredTriggers = [
'BracketSpace\Notification\Defaults\Trigger\Post\PostTrigger' => static function ($trigger) {
'BracketSpace\Notification\Repository\Trigger\Post\PostTrigger' => static function ($trigger) {
return $trigger->{$trigger->getPostType()}->ID;
},
'BracketSpace\Notification\Defaults\Trigger\User\UserTrigger' => static function ($trigger) {
'BracketSpace\Notification\Repository\Trigger\User\UserTrigger' => static function ($trigger) {
return $trigger->userId;
},
'BracketSpace\Notification\Defaults\Trigger\Comment\CommentTrigger' => static function ($trigger) {
'BracketSpace\Notification\Repository\Trigger\Comment\CommentTrigger' => static function ($trigger) {
return $trigger->comment->commentID;
},
];
Expand Down
2 changes: 1 addition & 1 deletion src/Interfaces/Sendable.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getFieldValue($fieldSlug);
* Gets the recipients field
* Calls the field closure.
*
* @return \BracketSpace\Notification\Defaults\Field\RecipientsField|null
* @return \BracketSpace\Notification\Repository\Field\RecipientsField|null
* @since 8.0.0
*/
public function getRecipientsField();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Carrier;
namespace BracketSpace\Notification\Repository\Carrier;

use BracketSpace\Notification\Abstracts;
use BracketSpace\Notification\Core\Debugging;
use BracketSpace\Notification\Defaults\Field;
use BracketSpace\Notification\Repository\Field;
use BracketSpace\Notification\Interfaces\Triggerable;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Carrier;
namespace BracketSpace\Notification\Repository\Carrier;

use BracketSpace\Notification\Interfaces\Triggerable;
use BracketSpace\Notification\Abstracts;
use BracketSpace\Notification\Defaults\Field;
use BracketSpace\Notification\Repository\Field;
use BracketSpace\Notification\Traits\Webhook as WebhookTrait;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Carrier;
namespace BracketSpace\Notification\Repository\Carrier;

use BracketSpace\Notification\Interfaces\Triggerable;
use BracketSpace\Notification\Abstracts;
use BracketSpace\Notification\Defaults\Field;
use BracketSpace\Notification\Repository\Field;
use BracketSpace\Notification\Traits\Webhook as WebhookTrait;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Repository/CarrierRepository.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Register defaults.
* Register Repository.
*
* @package notification
*/
Expand All @@ -10,7 +10,6 @@

namespace BracketSpace\Notification\Repository;

use BracketSpace\Notification\Defaults\Carrier;
use BracketSpace\Notification\Register;
use BracketSpace\Notification\Dependencies\Micropackage\DocHooks\Helper as DocHooksHelper;

Expand Down
2 changes: 1 addition & 1 deletion src/Repository/ConverterRepository.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Register defaults.
* Register Repository.
*
* @package notification
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Store\Recipient as RecipientStore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

/**
* Recipients field class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\Field;
namespace BracketSpace\Notification\Repository\Field;

use BracketSpace\Notification\Abstracts\Field;

Expand Down
3 changes: 1 addition & 2 deletions src/Repository/GlobalMergeTagRepository.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Register defaults.
* Register Repository.
*
* @package notification
*/
Expand All @@ -10,7 +10,6 @@

namespace BracketSpace\Notification\Repository;

use BracketSpace\Notification\Defaults\MergeTag;
use BracketSpace\Notification\Register;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\MergeTag;
namespace BracketSpace\Notification\Repository\MergeTag;

use BracketSpace\Notification\Abstracts\MergeTag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\MergeTag\Comment;
namespace BracketSpace\Notification\Repository\MergeTag\Comment;

use BracketSpace\Notification\Defaults\MergeTag\UrlTag;
use BracketSpace\Notification\Repository\MergeTag\UrlTag;
use BracketSpace\Notification\Utils\WpObjectHelper;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\MergeTag\Comment;
namespace BracketSpace\Notification\Repository\MergeTag\Comment;

use BracketSpace\Notification\Defaults\MergeTag\UrlTag;
use BracketSpace\Notification\Repository\MergeTag\UrlTag;
use BracketSpace\Notification\Utils\WpObjectHelper;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\MergeTag\Comment;
namespace BracketSpace\Notification\Repository\MergeTag\Comment;

use BracketSpace\Notification\Defaults\MergeTag\UrlTag;
use BracketSpace\Notification\Repository\MergeTag\UrlTag;
use BracketSpace\Notification\Utils\WpObjectHelper;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\MergeTag\Comment;
namespace BracketSpace\Notification\Repository\MergeTag\Comment;

use BracketSpace\Notification\Defaults\MergeTag\UrlTag;
use BracketSpace\Notification\Repository\MergeTag\UrlTag;
use BracketSpace\Notification\Utils\WpObjectHelper;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\MergeTag\Comment;
namespace BracketSpace\Notification\Repository\MergeTag\Comment;

use BracketSpace\Notification\Defaults\MergeTag\IPTag;
use BracketSpace\Notification\Repository\MergeTag\IPTag;
use BracketSpace\Notification\Utils\WpObjectHelper;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Defaults\MergeTag\Comment;
namespace BracketSpace\Notification\Repository\MergeTag\Comment;

use BracketSpace\Notification\Defaults\MergeTag\UrlTag;
use BracketSpace\Notification\Repository\MergeTag\UrlTag;
use BracketSpace\Notification\Utils\WpObjectHelper;

/**
Expand Down
Loading

0 comments on commit 2706c9d

Please sign in to comment.