Commit 37b445c4 authored by Tomas Norre Mikkelsen's avatar Tomas Norre Mikkelsen

Merge branch 'fixing-terfe2-models-cgl' into 'develop'

Change models to PHP7 and CGL compatibility

See merge request !200
parents 27126b19 57224622
Pipeline #2383 passed with stages
in 1 minute and 30 seconds
...@@ -25,45 +25,53 @@ namespace T3o\TerFe2\Domain\Model; ...@@ -25,45 +25,53 @@ namespace T3o\TerFe2\Domain\Model;
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/ ******************************************************************/
use TYPO3\CMS\Extbase\Domain\Model\FrontendUser;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/** /**
* Author of an extension * Author of an extension
*/ */
class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
/** /**
* Name of the author * Name of the author
*
* @var string * @var string
* @validate NotEmpty * @validate NotEmpty
*/ */
protected $name; protected $name = '';
/** /**
* Email address * Email address
*
* @var string * @var string
*/ */
protected $email; protected $email = '';
/** /**
* Company name * Company name
*
* @var string * @var string
*/ */
protected $company; protected $company = '';
/** /**
* Link to forge profile * Link to forge profile
*
* @var string * @var string
*/ */
protected $forgeLink; protected $forgeLink = '';
/** /**
* Owner username * Owner username
*
* @var string * @var string
*/ */
protected $username; protected $username = '';
/** /**
* versions * versions
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version> * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version>
* @lazy * @lazy
*/ */
...@@ -71,6 +79,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -71,6 +79,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/** /**
* Frontend user * Frontend user
*
* @var \TYPO3\CMS\Extbase\Domain\Model\FrontendUser * @var \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/ */
protected $frontendUser; protected $frontendUser;
...@@ -83,7 +92,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -83,7 +92,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* 2 = Developer * 2 = Developer
* 3 = Support * 3 = Support
* *
* @var integer * @var int
*/ */
protected $authorType; protected $authorType;
...@@ -92,17 +101,16 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -92,17 +101,16 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/ */
public function __construct() public function __construct()
{ {
$this->versions = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $this->versions = new ObjectStorage();
} }
/** /**
* Setter for name * Setter for name
* *
* @param string $name Name of the author * @param string $name Name of the author
* @return void * @return void
*/ */
public function setName($name) public function setName(string $name)
{ {
$this->name = $name; $this->name = $name;
} }
...@@ -113,7 +121,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -113,7 +121,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @return string Name of the author * @return string Name of the author
*/ */
public function getName() public function getName(): string
{ {
return $this->name; return $this->name;
} }
...@@ -125,7 +133,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -125,7 +133,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $email Email address * @param string $email Email address
* @return void * @return void
*/ */
public function setEmail($email) public function setEmail(string $email)
{ {
$this->email = $email; $this->email = $email;
} }
...@@ -136,7 +144,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -136,7 +144,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @return string Email address * @return string Email address
*/ */
public function getEmail() public function getEmail(): string
{ {
return $this->email; return $this->email;
} }
...@@ -148,7 +156,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -148,7 +156,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $company Company name * @param string $company Company name
* @return void * @return void
*/ */
public function setCompany($company) public function setCompany(string $company)
{ {
$this->company = $company; $this->company = $company;
} }
...@@ -159,7 +167,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -159,7 +167,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @return string Company name * @return string Company name
*/ */
public function getCompany() public function getCompany(): string
{ {
return $this->company; return $this->company;
} }
...@@ -171,7 +179,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -171,7 +179,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $forgeLink Link to forge profile * @param string $forgeLink Link to forge profile
* @return void * @return void
*/ */
public function setForgeLink($forgeLink) public function setForgeLink(string $forgeLink)
{ {
$this->forgeLink = $forgeLink; $this->forgeLink = $forgeLink;
} }
...@@ -182,7 +190,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -182,7 +190,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @return string Link to forge profile * @return string Link to forge profile
*/ */
public function getForgeLink() public function getForgeLink(): string
{ {
return $this->forgeLink; return $this->forgeLink;
} }
...@@ -194,7 +202,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -194,7 +202,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $username Owner username * @param string $username Owner username
* @return void * @return void
*/ */
public function setUsername($username) public function setUsername(string $username)
{ {
$this->username = $username; $this->username = $username;
} }
...@@ -205,7 +213,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -205,7 +213,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @return string Owner username * @return string Owner username
*/ */
public function getUsername() public function getUsername(): string
{ {
return $this->username; return $this->username;
} }
...@@ -214,9 +222,9 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -214,9 +222,9 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/** /**
* Getter for versions * Getter for versions
* *
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version> versions * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/ */
public function getVersions() public function getVersions(): ObjectStorage
{ {
return $this->versions; return $this->versions;
} }
...@@ -228,7 +236,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -228,7 +236,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param \T3o\TerFe2\Domain\Model\Version $version The Version to be added * @param \T3o\TerFe2\Domain\Model\Version $version The Version to be added
* @return void * @return void
*/ */
public function addVersion(\T3o\TerFe2\Domain\Model\Version $version) public function addVersion(Version $version)
{ {
$this->versions->attach($version); $this->versions->attach($version);
} }
...@@ -240,7 +248,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -240,7 +248,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param \T3o\TerFe2\Domain\Model\Version $version The Version to be removed * @param \T3o\TerFe2\Domain\Model\Version $version The Version to be removed
* @return void * @return void
*/ */
public function removeVersion(\T3o\TerFe2\Domain\Model\Version $version) public function removeVersion(Version $version)
{ {
$this->versions->detach($version); $this->versions->detach($version);
} }
...@@ -250,7 +258,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -250,7 +258,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser * @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/ */
public function getFrontendUser() public function getFrontendUser(): FrontendUser
{ {
return $this->frontendUser; return $this->frontendUser;
} }
...@@ -260,7 +268,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -260,7 +268,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser * @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser
*/ */
public function setFrontendUser($frontendUser) public function setFrontendUser(FrontendUser $frontendUser = null)
{ {
$this->frontendUser = $frontendUser; $this->frontendUser = $frontendUser;
} }
...@@ -268,10 +276,10 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -268,10 +276,10 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/** /**
* Setter for authorType * Setter for authorType
* *
* @param integer $authorType Type of the author * @param int $type Type of the author
* @return void * @return void
*/ */
public function setAuthorType($type) public function setAuthorType(int $type)
{ {
$this->authorType = $type; $this->authorType = $type;
} }
...@@ -280,9 +288,9 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -280,9 +288,9 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/** /**
* Getter for authorType * Getter for authorType
* *
* @return integer Type of the author * @return int Type of the author
*/ */
public function getAuthorType() public function getAuthorType(): int
{ {
return $this->authorType; return $this->authorType;
} }
......
...@@ -25,17 +25,19 @@ namespace T3o\TerFe2\Domain\Model; ...@@ -25,17 +25,19 @@ namespace T3o\TerFe2\Domain\Model;
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/ ******************************************************************/
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/** /**
* Extension container * Extension container
*/ */
class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
/** /**
* Extension key * Extension key
*
* @var string * @var string
*/ */
protected $extKey; protected $extKey = '';
/** /**
* Link to forge project * Link to forge project
...@@ -43,22 +45,30 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -43,22 +45,30 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string * @var string
* @validate \T3o\TerFe2\Validation\Validator\UrlValidator * @validate \T3o\TerFe2\Validation\Validator\UrlValidator
*/ */
protected $forgeLink; protected $forgeLink = '';
/** /**
* Last update * Last update
* @var DateTime *
* @var \DateTime
*/ */
protected $lastUpdate; protected $lastUpdate;
/**
* @var \DateTime
*/
protected $lastMaintained;
/** /**
* Tags * Tags
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Tag> * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Tag>
*/ */
protected $tags; protected $tags;
/** /**
* Versions * Versions
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version> * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version>
* @lazy * @lazy
*/ */
...@@ -66,37 +76,43 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -66,37 +76,43 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/** /**
* Last version * Last version
*
* @var \T3o\TerFe2\Domain\Model\Version * @var \T3o\TerFe2\Domain\Model\Version
*/ */
protected $lastVersion; protected $lastVersion;
/** /**
* Frontend user * Frontend user
*
* @var string * @var string
*/ */
protected $frontendUser; protected $frontendUser = '';
/** /**
* Sum of all version downloads * Sum of all version downloads
* @var integer *
* @var int
*/ */
protected $downloads; protected $downloads = 0;
/** /**
* Flattr username * Flattr username
*
* @var string * @var string
*/ */
protected $flattrUsername; protected $flattrUsername = '';
/** /**
* Flattr data from result * Flattr data from result
*
* @var string * @var string
*/ */
protected $flattrData; protected $flattrData = '';
/** /**
* Creation date * Creation date
* @var DateTime *
* @var \DateTime
*/ */
protected $crdate; protected $crdate;
...@@ -106,14 +122,14 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -106,14 +122,14 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string * @var string
* @validate \T3o\TerFe2\Validation\Validator\UrlValidator * @validate \T3o\TerFe2\Validation\Validator\UrlValidator
*/ */
protected $repositoryUrl; protected $repositoryUrl = '';
/** /**
* External repository clone url * External repository clone url
* *
* @var string * @var string
*/ */
protected $repositoryCloneUrl; protected $repositoryCloneUrl = '';
/** /**
* Link to an external manual * Link to an external manual
...@@ -121,7 +137,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -121,7 +137,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string * @var string
* @validate \T3o\TerFe2\Validation\Validator\UrlValidator * @validate \T3o\TerFe2\Validation\Validator\UrlValidator
*/ */
protected $externalManual; protected $externalManual = '';
/** /**
* Link to paypal donation * Link to paypal donation
...@@ -129,7 +145,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -129,7 +145,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string * @var string
* @validate \T3o\TerFe2\Validation\Validator\UrlValidator * @validate \T3o\TerFe2\Validation\Validator\UrlValidator
*/ */
protected $paypalUrl; protected $paypalUrl = '';
/** /**
* @var \DateTime * @var \DateTime
...@@ -142,8 +158,8 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -142,8 +158,8 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/ */
public function __construct() public function __construct()
{ {
$this->tags = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $this->tags = new ObjectStorage();
$this->versions = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $this->versions = new ObjectStorage();
} }
...@@ -153,7 +169,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -153,7 +169,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $extKey extKey * @param string $extKey extKey
* @return void * @return void
*/ */
public function setExtKey($extKey) public function setExtKey(string $extKey)
{ {
$this->extKey = $extKey; $this->extKey = $extKey;
} }
...@@ -164,7 +180,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -164,7 +180,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @return string extKey * @return string extKey
*/ */
public function getExtKey() public function getExtKey(): string
{ {
return $this->extKey; return $this->extKey;
} }
...@@ -176,7 +192,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -176,7 +192,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $forgeLink forgeLink * @param string $forgeLink forgeLink
* @return void * @return void
*/ */
public function setForgeLink($forgeLink) public function setForgeLink(string $forgeLink)
{ {
$this->forgeLink = $forgeLink; $this->forgeLink = $forgeLink;
} }
...@@ -187,7 +203,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -187,7 +203,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* *
* @return string forgeLink * @return string forgeLink
*/ */
public function getForgeLink()