for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://flipboxfactory.com/software/organization/license
* @link https://www.flipboxfactory.com/software/organization/
*/
namespace flipbox\organizations\objects;
use craft\helpers\DateTimeHelper;
use DateTime;
* @property DateTime|null $dateJoined
*
* @author Flipbox Factory <[email protected]>
* @since 1.0.0
trait DateJoinedMutatorTrait
{
* @noinspection PhpDocMissingThrowsInspection
* @param $value
* @return $this
public function setDateJoined($value)
if ($value) {
/** @noinspection PhpUnhandledExceptionInspection */
$value = DateTimehelper::toDateTime($value);
}
$this->dateJoined = $value ?: null;
return $this;
* @return DateTime
public function getDateJoined()
if (empty($this->dateJoined)) {
return DateTimeHelper::toDateTime(
new DateTime()
new \DateTime()
object<DateTime>
string|integer|array|null
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
);
return $this->dateJoined;
* @return string|null
public function getDateJoinedIso8601()
if (!$dateJoined = $this->getDateJoined()) {
return null;
if (!$iso = DateTimeHelper::toIso8601($dateJoined)) {
return $iso;
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: