Commit bfe242a1 authored by Stefan Busemann's avatar Stefan Busemann
Browse files

Merge branch 'task/update-to-v10' into 'master'

Task/update to v10

See merge request !5
parents a3f3c402 0d71bc05
<?php <?php
declare(strict_types=1);
namespace T3o\Certifications\Controller; namespace T3o\Certifications\Controller;
/** /**
...@@ -20,7 +21,6 @@ use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; ...@@ -20,7 +21,6 @@ use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
class ListingController extends ActionController class ListingController extends ActionController
{ {
/** /**
* feUsersRepository * feUsersRepository
* *
...@@ -28,19 +28,30 @@ class ListingController extends ActionController ...@@ -28,19 +28,30 @@ class ListingController extends ActionController
*/ */
protected $userRepository; protected $userRepository;
/**
* injectFeUsersRepository
*
* @param UserRepository $userRepository
* @return void
*/
public function injectFeUsersRepository(UserRepository $userRepository): void
{
$this->userRepository = $userRepository;
}
/** /**
* listAction * listAction
* *
* @param string $char * @param string $char
* @return void * @return void
*/ */
public function listAction($char = NULL) public function listAction($char = null): void
{ {
if (empty($char)) { if (empty($char)) {
$char = 'A'; $char = 'A';
} }
$chars = range('A', 'Z'); $chars = range('A', 'Z');
array_push($chars, '#'); $chars[] = '#';
$feUsers = $this->userRepository->findByFirstChar($char); $feUsers = $this->userRepository->findByFirstChar($char);
$this->view->assignMultiple( $this->view->assignMultiple(
[ [
...@@ -50,29 +61,4 @@ class ListingController extends ActionController ...@@ -50,29 +61,4 @@ class ListingController extends ActionController
] ]
); );
} }
/**
* action show
*
* @param User $user
* @return void
*/
public function showAction(User $user)
{
$this->view->assign('certUser', $user);
}
/**
* injectFeUsersRepository
*
* @param UserRepository $userRepository
* @return void
*/
public function injectFeUsersRepository(UserRepository $userRepository)
{
$this->userRepository = $userRepository;
}
} }
?>
\ No newline at end of file
<?php <?php
declare(strict_types=1);
namespace T3o\Certifications\Domain\Model; namespace T3o\Certifications\Domain\Model;
/** /**
...@@ -24,30 +25,29 @@ class Certificate extends AbstractEntity ...@@ -24,30 +25,29 @@ class Certificate extends AbstractEntity
* certificationDate * certificationDate
* *
* @var DateTime * @var DateTime
* @TYPO3\CMS\Extbase\Annotation\Validate NotEmpty
*/ */
protected $certificationDate; protected $certificationDate = null;
/** /**
* expirationDate * expirationDate
* *
* @var DateTime * @var DateTime
*/ */
protected $expirationDate; protected $expirationDate = null;
/** /**
* allowListing * allowListing
* *
* @var boolean * @var boolean
*/ */
protected $allowListing = TRUE; protected $allowListing = true;
/** /**
* true for all certifications for 4.x * true for all certifications for 4.x
* *
* @var boolean * @var boolean
*/ */
protected $versionFour = FALSE; protected $versionFour = false;
/** /**
* certificateType * certificateType
...@@ -61,7 +61,7 @@ class Certificate extends AbstractEntity ...@@ -61,7 +61,7 @@ class Certificate extends AbstractEntity
* *
* @return DateTime $certificationDate * @return DateTime $certificationDate
*/ */
public function getCertificationDate() public function getCertificationDate(): ?DateTime
{ {
return $this->certificationDate; return $this->certificationDate;
} }
...@@ -72,7 +72,7 @@ class Certificate extends AbstractEntity ...@@ -72,7 +72,7 @@ class Certificate extends AbstractEntity
* @param DateTime $certificationDate * @param DateTime $certificationDate
* @return void * @return void
*/ */
public function setCertificationDate($certificationDate) public function setCertificationDate(DateTime $certificationDate): void
{ {
$this->certificationDate = $certificationDate; $this->certificationDate = $certificationDate;
} }
...@@ -82,7 +82,7 @@ class Certificate extends AbstractEntity ...@@ -82,7 +82,7 @@ class Certificate extends AbstractEntity
* *
* @return DateTime $expirationDate * @return DateTime $expirationDate
*/ */
public function getExpirationDate() public function getExpirationDate(): ?DateTime
{ {
return $this->expirationDate; return $this->expirationDate;
} }
...@@ -93,17 +93,27 @@ class Certificate extends AbstractEntity ...@@ -93,17 +93,27 @@ class Certificate extends AbstractEntity
* @param DateTime $expirationDate * @param DateTime $expirationDate
* @return void * @return void
*/ */
public function setExpirationDate($expirationDate) public function setExpirationDate(DateTime $expirationDate): void
{ {
$this->expirationDate = $expirationDate; $this->expirationDate = $expirationDate;
} }
/**
* Returns the boolean state of allowListing
*
* @return boolean
*/
public function isAllowListing(): bool
{
return $this->getAllowListing();
}
/** /**
* Returns the allowListing * Returns the allowListing
* *
* @return boolean $allowListing * @return boolean $allowListing
*/ */
public function getAllowListing() public function getAllowListing(): bool
{ {
return $this->allowListing; return $this->allowListing;
} }
...@@ -114,19 +124,19 @@ class Certificate extends AbstractEntity ...@@ -114,19 +124,19 @@ class Certificate extends AbstractEntity
* @param boolean $allowListing * @param boolean $allowListing
* @return void * @return void
*/ */
public function setAllowListing($allowListing) public function setAllowListing(bool $allowListing): void
{ {
$this->allowListing = $allowListing; $this->allowListing = $allowListing;
} }
/** /**
* Returns the boolean state of allowListing * Returns the boolean state of version_four
* *
* @return boolean * @return boolean
*/ */
public function isAllowListing() public function isVersionFour(): bool
{ {
return $this->getAllowListing(); return $this->getVersionFour();
} }
/** /**
...@@ -134,7 +144,7 @@ class Certificate extends AbstractEntity ...@@ -134,7 +144,7 @@ class Certificate extends AbstractEntity
* *
* @return boolean $version_four * @return boolean $version_four
*/ */
public function getVersionFour() public function getVersionFour(): bool
{ {
return $this->versionFour; return $this->versionFour;
} }
...@@ -145,27 +155,17 @@ class Certificate extends AbstractEntity ...@@ -145,27 +155,17 @@ class Certificate extends AbstractEntity
* @param boolean $version_four * @param boolean $version_four
* @return void * @return void
*/ */
public function setVersionFour($versionFour) public function setVersionFour(bool $versionFour): void
{ {
$this->versionFour = $versionFour; $this->versionFour = $versionFour;
} }
/**
* Returns the boolean state of version_four
*
* @return boolean
*/
public function isVersionFour()
{
return $this->getVersionFour();
}
/** /**
* Returns the certificateType * Returns the certificateType
* *
* @return CertificateType $certificateType * @return CertificateType $certificateType
*/ */
public function getCertificateType() public function getCertificateType(): CertificateType
{ {
return $this->certificateType; return $this->certificateType;
} }
...@@ -176,11 +176,9 @@ class Certificate extends AbstractEntity ...@@ -176,11 +176,9 @@ class Certificate extends AbstractEntity
* @param CertificateType $certificateType * @param CertificateType $certificateType
* @return void * @return void
*/ */
public function setCertificateType(CertificateType $certificateType) public function setCertificateType(CertificateType $certificateType): void
{ {
$this->certificateType = $certificateType; $this->certificateType = $certificateType;
} }
} }
?>
\ No newline at end of file
<?php <?php
declare(strict_types=1);
namespace T3o\Certifications\Domain\Model; namespace T3o\Certifications\Domain\Model;
/** /**
...@@ -31,7 +32,7 @@ class CertificateType extends AbstractEntity ...@@ -31,7 +32,7 @@ class CertificateType extends AbstractEntity
* *
* @return string $title * @return string $title
*/ */
public function getTitle() public function getTitle(): string
{ {
return $this->title; return $this->title;
} }
...@@ -42,11 +43,9 @@ class CertificateType extends AbstractEntity ...@@ -42,11 +43,9 @@ class CertificateType extends AbstractEntity
* @param string $title * @param string $title
* @return void * @return void
*/ */
public function setTitle($title) public function setTitle(string $title): void
{ {
$this->title = $title; $this->title = $title;
} }
} }
?>
\ No newline at end of file
<?php <?php
declare(strict_types=1);
namespace T3o\Certifications\Domain\Model; namespace T3o\Certifications\Domain\Model;
/** /**
...@@ -14,28 +15,25 @@ namespace T3o\Certifications\Domain\Model; ...@@ -14,28 +15,25 @@ namespace T3o\Certifications\Domain\Model;
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
use TYPO3\CMS\Extbase\Domain\Model\FrontendUser;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage; use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
class User extends AbstractEntity class User extends AbstractEntity
{ {
/** /**
* @var string * @var string
*/ */
protected $firstName; protected $firstName = '';
/** /**
* @var string * @var string
*/ */
protected $middleName; protected $middleName = '';
/** /**
* @var string * @var string
*/ */
protected $lastName; protected $lastName = '';
/** /**
* @var string * @var string
...@@ -47,149 +45,139 @@ class User extends AbstractEntity ...@@ -47,149 +45,139 @@ class User extends AbstractEntity
* *
* @var string * @var string
*/ */
protected $certReason; protected $certReason = '';
/** /**
* publicEmailAddress * publicEmailAddress
* *
* @var boolean * @var boolean
*/ */
protected $publicEmailAddress = FALSE; protected $publicEmailAddress = false;
/** /**
* email * email
* *
* @var string * @var string
*/ */
protected $email; protected $email = '';
/** /**
* certificates * certificates
* *
* @var ObjectStorage * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\Certifications\Domain\Model\Certificate>
* @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
*/ */
protected $certificates; protected $certificates = null;
/** /**
* feUser * feUser
* *
* @var TYPO3\CMS\Extbase\Domain\Model\FrontendUser * @var User
*/ */
protected $feUser; protected $feUser = null;
/** /**
* twitter * twitter
* *
* @var string * @var string
*/ */
protected $twitter; protected $twitter = '';
/** /**
* publicTwitter * publicTwitter
* *
* @var boolean * @var boolean
*/ */
protected $publicTwitter; protected $publicTwitter = false;
/** /**
* @param string $country * __construct
*
* @return void
*/ */
public function setCountry($country) public function __construct()
{ {
$this->country = $country; $this->initStorageObjects();
}
/**
* @return void
*/
protected function initStorageObjects()
{
$this->certificates = new ObjectStorage();
} }
/** /**
* @return string * @return string
*/ */
public function getCountry() public function getCountry(): string
{ {
return $this->country; return $this->country;
} }
/** /**
* @param string $firstName * @param string $country
*/ */
public function setFirstName($firstName) public function setCountry(string $country): void
{ {
$this->firstName = $firstName; $this->country = $country;
} }
/** /**
* @return string * @return string
*/ */
public function getFirstName() public function getFirstName(): string
{ {
return $this->firstName; return $this->firstName;
} }
/** /**
* @param string $lastName * @param string $firstName
*/ */
public function setLastName($lastName) public function setFirstName(string $firstName): void
{ {
$this->lastName = $lastName; $this->firstName = $firstName;
} }
/** /**
* @return string * @return string
*/ */
public function getLastName() public function getLastName(): string
{ {
return $this->lastName;