Skip to content

Commit

Permalink
Run custom rector updates [WEB-2960]
Browse files Browse the repository at this point in the history
The exact command was:
./vendor/bin/rector process --clear-cache
--config=scripts/rector/twill-3-upgrade-type-compatibility.php
  • Loading branch information
zachgarwood committed Nov 22, 2024
1 parent 0d26e07 commit 7471f87
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Twill/ExhibitionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct(Application $app, Request $request)
*
* @see App\Models\Api\Exhibition::scopeOrderBy
*/
protected function orderScope()
protected function orderScope(): array
{
return ModuleController::orderScope();
}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/DigitalPublicationArticle.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class DigitalPublicationArticle extends AbstractModel implements Sortable
],
];

public function scopePublished($query)
public function scopePublished($query): \Illuminate\Database\Eloquent\Builder
{
parent::scopePublished($query);

Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/ArticleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function afterSave(\A17\Twill\Models\Contracts\TwillModelContract $object
parent::afterSave($object, $fields);
}

public function getFormFields($object)
public function getFormFields($object): array
{
$fields = parent::getFormFields($object);

Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/ArtistRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function afterSave(\A17\Twill\Models\Contracts\TwillModelContract $object
parent::afterSave($object, $fields);
}

public function getFormFields($object)
public function getFormFields($object): array
{
$fields = parent::getFormFields($object);

Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/ArtworkRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function afterSave(\A17\Twill\Models\Contracts\TwillModelContract $object
parent::afterSave($object, $fields);
}

public function getFormFields($object)
public function getFormFields($object): array
{
$fields = parent::getFormFields($object);

Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/DepartmentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function afterSave(\A17\Twill\Models\Contracts\TwillModelContract $object
parent::afterSave($object, $fields);
}

public function getFormFields($object)
public function getFormFields($object): array
{
$fields = parent::getFormFields($object);

Expand Down
12 changes: 6 additions & 6 deletions app/Repositories/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class EventRepository extends ModuleRepository
'ticketedEvent',
];

protected $repeaters = [
protected array $repeaters = [
'date_rule' => [
'relation' => 'dateRules'
],
Expand All @@ -45,7 +45,7 @@ public function __construct(Event $model)
$this->model = $model;
}

public function hydrate($object, $fields)
public function hydrate($object, $fields): \A17\Twill\Models\Contracts\TwillModelContract
{
$this->hydrateBrowser($object, $fields, 'events', 'position', 'Event');
$this->hydrateBrowser($object, $fields, 'sponsors', 'position', 'Sponsor');
Expand All @@ -57,7 +57,7 @@ public function hydrate($object, $fields)
* Some editors paste links to our sales site instead of browsing for the ticketed event.
* Find and auto-attach the ticketed event if it's a match.
*/
public function prepareFieldsBeforeSave($object, $fields)
public function prepareFieldsBeforeSave($object, $fields): array
{
if (isset($fields['rsvp_link'])) {
$isTicketedEvent = preg_match('/https*:\/\/sales\.artic\.edu\/Events\/Event\/([0-9]+)\?date=([0-9]+\/[0-9]+\/[0-9]+)/', $fields['rsvp_link'], $matches);
Expand Down Expand Up @@ -131,14 +131,14 @@ public function prepareFieldsBeforeSave($object, $fields)
return parent::prepareFieldsBeforeSave($object, $fields);
}

public function afterSave($object, $fields)
public function afterSave($object, $fields): void
{
$object->programs()->sync($fields['programs'] ?? []);

parent::afterSave($object, $fields);
}

public function getFormFields($object)
public function getFormFields($object): array
{
$fields = parent::getFormFields($object);

Expand Down Expand Up @@ -298,7 +298,7 @@ public function searchApi($string, $perPage = null)
return $results;
}

public function duplicate($id, $titleColumnKey = 'title')
public function duplicate($id, $titleColumnKey = 'title'): ?\A17\Twill\Models\Contracts\TwillModelContract
{
$newObject = parent::duplicate($id, $titleColumnKey);

Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/ExhibitionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ExhibitionRepository extends BaseApiRepository
'waitTimes',
];

protected $repeaters = [
protected array $repeaters = [
'offers'
];

Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/ExperienceImageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function prepareFieldsBeforeCreate(array $fields): array
return parent::prepareFieldsBeforeCreate($fields);
}

public function prepareFieldsBeforeSave($object, $fields)
public function prepareFieldsBeforeSave($object, $fields): array
{
if ($fields['credits_input'] == 'datahub') {
$fields = $this->updateFieldsFromApi($fields);
Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/ExperienceModalRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function afterSave(\A17\Twill\Models\Contracts\TwillModelContract $object
parent::afterSave($object, $fields);
}

public function prepareFieldsBeforeSave($object, $fields)
public function prepareFieldsBeforeSave($object, $fields): array
{
if (isset($fields['blocks']) && !empty($fields['blocks'])) {
$fields['repeaters'] = $fields['blocks'];
Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/HourRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __construct(Hour $model)
$this->model = $model;
}

protected $repeaters = [
protected array $repeaters = [
'building_closures' => [
'relation' => 'buildingClosures'
],
Expand Down
4 changes: 2 additions & 2 deletions app/Repositories/LandingPageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class LandingPageRepository extends ModuleRepository

];

protected $repeaters = [
protected array $repeaters = [
'social_links',

// Visit
Expand Down Expand Up @@ -107,7 +107,7 @@ public function afterSave(\A17\Twill\Models\Contracts\TwillModelContract $object
parent::afterSave($object, $fields);
}

public function getFormFields($object)
public function getFormFields($object): array
{
$fields = parent::getFormFields($object);
// Art & Ideas
Expand Down
4 changes: 2 additions & 2 deletions app/Repositories/PageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class PageRepository extends ModuleRepository
],
];

protected $repeaters = [
protected array $repeaters = [
// Homepage landing
'artists' => [
'relation' => 'homeArtists',
Expand Down Expand Up @@ -159,7 +159,7 @@ public function afterSave(\A17\Twill\Models\Contracts\TwillModelContract $object
parent::afterSave($object, $fields);
}

public function getFormFields($object)
public function getFormFields($object): array
{
$fields = parent::getFormFields($object);

Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/SlideRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function afterSave(\A17\Twill\Models\Contracts\TwillModelContract $object
parent::afterSave($object, $fields);
}

public function getFormFields($object)
public function getFormFields($object): array
{
$fields = parent::getFormFields($object);
$fields = $this->getExperienceModule($object, $fields, 'primaryExperienceImage', 'ExperienceImage', 'slide_primary_experience_image');
Expand Down

0 comments on commit 7471f87

Please sign in to comment.