Skip to content

Commit

Permalink
Revert php version requirement bump, Craft still is on v7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-lenz committed Dec 2, 2020
1 parent 9c0c150 commit a1db66e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A collection of utility classes for Craft CMS development",
"license": "MIT",
"require": {
"php": ">=7.4",
"php": ">=7.0.0",
"craftcms/cms": "^3.2.4"
},
"autoload": {
Expand Down
4 changes: 4 additions & 0 deletions src/foreignField/ForeignField.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public function getStaticHtml($value, ElementInterface $element): string {
/**
* @param string $attribute
* @return bool
* @noinspection PhpUnusedParameterInspection
*/
public function isAttributePropagated(string $attribute) {
return true;
Expand Down Expand Up @@ -341,6 +342,7 @@ protected function render(string $template, array $variables) {
* @param ForeignFieldModel $model
* @param ElementInterface $element
* @return bool
* @noinspection PhpUnusedParameterInspection
*/
protected function shouldUpdateRecord(ForeignFieldModel $model, ElementInterface $element) {
if (
Expand All @@ -358,6 +360,7 @@ protected function shouldUpdateRecord(ForeignFieldModel $model, ElementInterface
* @param ActiveRecord $record
* @param ElementInterface|null $element
* @return array
* @noinspection PhpUnusedParameterInspection
*/
protected function toModelAttributes(ActiveRecord $record, ElementInterface $element = null) {
return $record->getAttributes(static::recordModelAttributes());
Expand All @@ -367,6 +370,7 @@ protected function toModelAttributes(ActiveRecord $record, ElementInterface $ele
* @param ForeignFieldModel $model
* @param ElementInterface $element
* @return array
* @noinspection PhpUnusedParameterInspection
*/
protected function toRecordAttributes(ForeignFieldModel $model, ElementInterface $element) {
return $model->getAttributes(static::recordModelAttributes());
Expand Down
2 changes: 1 addition & 1 deletion src/foreignField/ForeignFieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function unserialize($value) {
* @param ElementInterface|null $owner
* @return $this
*/
public function withOwner(?ElementInterface $owner) {
public function withOwner(ElementInterface $owner = null) {
if ($this->_owner === $owner) {
return $this;
}
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/ElementHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Craft;
use craft\base\ElementInterface;
use craft\helpers\ArrayHelper;
use Throwable;

/**
* Class ElementHelpers
Expand All @@ -25,7 +26,7 @@ static public function serialize(ElementInterface $element = null) {
if (!empty($element->siteId)) {
$siteId = intval($element->siteId);
}
} catch (\Throwable $error) {
} catch (Throwable $error) {
// Ignore
}

Expand Down

0 comments on commit a1db66e

Please sign in to comment.