浏览代码

type every models properties

Olivier Massot 4 年之前
父节点
当前提交
0fb2fd1a08

+ 23 - 23
ot_core/Classes/Domain/Model/Donor.php

@@ -74,7 +74,7 @@ class Donor extends AbstractEntity
     /**
      * @return int
      */
-    public function getId()
+    public function getId(): int
     {
         return $this->id;
     }
@@ -90,7 +90,7 @@ class Donor extends AbstractEntity
     /**
      * @return int
      */
-    public function getOrganizationId()
+    public function getOrganizationId(): int
     {
         return $this->organizationId;
     }
@@ -106,15 +106,15 @@ class Donor extends AbstractEntity
     /**
      * @return string
      */
-    public function getName()
+    public function getName(): ?string
     {
         return $this->name;
     }
 
     /**
-     * @param string $name
+     * @param string|null $name
      */
-    public function setName($name = '')
+    public function setName(?string $name)
     {
         $this->name = $name;
     }
@@ -122,15 +122,15 @@ class Donor extends AbstractEntity
     /**
      * @return string
      */
-    public function getEmail()
+    public function getEmail(): ?string
     {
         return $this->email;
     }
 
     /**
-     * @param string $email
+     * @param string|null $email
      */
-    public function setEmail($email = '')
+    public function setEmail(?string $email)
     {
         $this->email = $email;
     }
@@ -138,15 +138,15 @@ class Donor extends AbstractEntity
     /**
      * @return string
      */
-    public function getTelphone()
+    public function getTelphone(): ?string
     {
         return $this->telphone;
     }
 
     /**
-     * @param string $telphone
+     * @param string|null $telphone
      */
-    public function setTelphone($telphone = '')
+    public function setTelphone(?string $telphone)
     {
         $this->telphone = $telphone;
     }
@@ -154,15 +154,15 @@ class Donor extends AbstractEntity
     /**
      * @return string
      */
-    public function getWebsite()
+    public function getWebsite(): ?string
     {
         return $this->website;
     }
 
     /**
-     * @param string $website
+     * @param string|null $website
      */
-    public function setWebsite($website = '')
+    public function setWebsite(?string $website)
     {
         $this->website = $website;
     }
@@ -170,15 +170,15 @@ class Donor extends AbstractEntity
     /**
      * @return string
      */
-    public function getWording()
+    public function getWording(): ?string
     {
         return $this->wording;
     }
 
     /**
-     * @param string $wording
+     * @param string|null $wording
      */
-    public function setWording($wording = '')
+    public function setWording(?string $wording)
     {
         $this->wording = $wording;
     }
@@ -186,15 +186,15 @@ class Donor extends AbstractEntity
     /**
      * @return string
      */
-    public function getDisplayedOn()
+    public function getDisplayedOn(): ?string
     {
         return $this->displayedOn;
     }
 
     /**
-     * @param string $displayedOn
+     * @param string|null $displayedOn
      */
-    public function setDisplayedOn($displayedOn = '')
+    public function setDisplayedOn(?string $displayedOn)
     {
         $this->displayedOn = $displayedOn;
     }
@@ -202,15 +202,15 @@ class Donor extends AbstractEntity
     /**
      * @return string
      */
-    public function getLogo()
+    public function getLogo(): ?string
     {
         return $this->logo;
     }
 
     /**
-     * @param string $logo
+     * @param string|null $logo
      */
-    public function setLogo($logo = '')
+    public function setLogo(?string $logo)
     {
         $this->logo = $logo;
     }

文件差异内容过多而无法显示
+ 135 - 135
ot_core/Classes/Domain/Model/Event.php


+ 56 - 56
ot_core/Classes/Domain/Model/Member.php

@@ -152,7 +152,7 @@ class Member extends AbstractEntity
     /**
      * @return int
      */
-    public function getId()
+    public function getId(): int
     {
         return $this->id;
     }
@@ -168,7 +168,7 @@ class Member extends AbstractEntity
     /**
      * @return int
      */
-    public function getOrganizationId()
+    public function getOrganizationId(): int
     {
         return $this->organizationId;
     }
@@ -184,15 +184,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getGender()
+    public function getGender(): ?string
     {
         return $this->gender;
     }
 
     /**
-     * @param string $gender
+     * @param string|null $gender
      */
-    public function setGender($gender = '')
+    public function setGender(?string $gender)
     {
         $this->gender = $gender;
     }
@@ -200,15 +200,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getGivenName()
+    public function getGivenName(): ?string
     {
         return $this->givenName;
     }
 
     /**
-     * @param string $givenName
+     * @param string|null $givenName
      */
-    public function setGivenName($givenName = '')
+    public function setGivenName(?string $givenName)
     {
         $this->givenName = $givenName;
     }
@@ -216,15 +216,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getName()
+    public function getName(): ?string
     {
         return $this->name;
     }
 
     /**
-     * @param string $name
+     * @param string|null $name
      */
-    public function setName($name = '')
+    public function setName(?string $name)
     {
         $this->name = $name;
     }
@@ -232,15 +232,15 @@ class Member extends AbstractEntity
     /**
      * @return \Datetime
      */
-    public function getStartDate()
+    public function getStartDate(): ?\DateTime
     {
         return $this->startDate;
     }
 
     /**
-     * @param \Datetime $startDate
+     * @param \Datetime|null $startDate
      */
-    public function setStartDate(\Datetime $startDate)
+    public function setStartDate(?\Datetime $startDate)
     {
         $this->startDate = $startDate;
     }
@@ -248,15 +248,15 @@ class Member extends AbstractEntity
     /**
      * @return \Datetime
      */
-    public function getEndDate()
+    public function getEndDate(): ?\DateTime
     {
         return $this->endDate;
     }
 
     /**
-     * @param \Datetime $endDate
+     * @param \Datetime|null $endDate
      */
-    public function setEndDate(\Datetime $endDate)
+    public function setEndDate(?\Datetime $endDate)
     {
         $this->endDate = $endDate;
     }
@@ -264,15 +264,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getInstrumentGroup()
+    public function getInstrumentGroup(): ?string
     {
         return $this->instrumentGroup;
     }
 
     /**
-     * @param string $instrumentGroup
+     * @param string|null $instrumentGroup
      */
-    public function setInstrumentGroup($instrumentGroup = '')
+    public function setInstrumentGroup(?string $instrumentGroup)
     {
         $this->instrumentGroup = $instrumentGroup;
     }
@@ -280,15 +280,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getInstrument()
+    public function getInstrument(): ?string
     {
         return $this->instrument;
     }
 
     /**
-     * @param string $instrument
+     * @param string|null $instrument
      */
-    public function setInstrument($instrument = '')
+    public function setInstrument(?string $instrument)
     {
         $this->instrument = $instrument;
     }
@@ -296,15 +296,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getMission()
+    public function getMission(): ?string
     {
         return $this->mission;
     }
 
     /**
-     * @param string $mission
+     * @param string|null $mission
      */
-    public function setMission($mission = '')
+    public function setMission(?string $mission)
     {
         $this->mission = $mission;
     }
@@ -312,7 +312,7 @@ class Member extends AbstractEntity
     /**
      * @return int
      */
-    public function getPersonId()
+    public function getPersonId(): int
     {
         return $this->personId;
     }
@@ -328,15 +328,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getImage()
+    public function getImage(): ?string
     {
         return $this->image;
     }
 
     /**
-     * @param string $image
+     * @param string|null $image
      */
-    public function setImage($image = '')
+    public function setImage(?string $image)
     {
         $this->image = $image;
     }
@@ -344,15 +344,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getAdressCity()
+    public function getAddressCity(): ?string
     {
         return $this->addressCity;
     }
 
     /**
-     * @param string $addressCity
+     * @param string|null $addressCity
      */
-    public function setAdressCity($addressCity = '')
+    public function setAddressCity(?string $addressCity)
     {
         $this->addressCity = $addressCity;
     }
@@ -360,15 +360,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getStreetAdress()
+    public function getStreetAddress(): ?string
     {
         return $this->streetAddress;
     }
 
     /**
-     * @param string $streetAddress
+     * @param string|null $streetAddress
      */
-    public function setStreetAdress($streetAddress = '')
+    public function setStreetAddress(?string $streetAddress)
     {
         $this->streetAddress = $streetAddress;
     }
@@ -376,15 +376,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getStreetAdressSecond()
+    public function getStreetAddressSecond(): ?string
     {
         return $this->streetAddressSecond;
     }
 
     /**
-     * @param string $streetAddressSecond
+     * @param string|null $streetAddressSecond
      */
-    public function setStreetAdressSecond($streetAddressSecond = '')
+    public function setStreetAddressSecond(?string $streetAddressSecond)
     {
         $this->streetAddressSecond = $streetAddressSecond;
     }
@@ -392,15 +392,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getStreetAdressThird()
+    public function getStreetAddressThird(): ?string
     {
         return $this->streetAddressThird;
     }
 
     /**
-     * @param string $streetAddressThird
+     * @param string|null $streetAddressThird
      */
-    public function setStreetAdressThird($streetAddressThird = '')
+    public function setStreetAddressThird(?string $streetAddressThird)
     {
         $this->streetAddressThird = $streetAddressThird;
     }
@@ -408,15 +408,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getPostalCode()
+    public function getPostalCode(): ?string
     {
         return $this->postalCode;
     }
 
     /**
-     * @param string $postalCode
+     * @param string|null $postalCode
      */
-    public function setPostalCode($postalCode = '')
+    public function setPostalCode(?string $postalCode)
     {
         $this->postalCode = $postalCode;
     }
@@ -424,15 +424,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getTelphone()
+    public function getTelphone(): ?string
     {
         return $this->telphone;
     }
 
     /**
-     * @param string $telphone
+     * @param string|null $telphone
      */
-    public function setTelphone($telphone = '')
+    public function setTelphone(?string $telphone)
     {
         $this->telphone = $telphone;
     }
@@ -440,15 +440,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getMobilPhone()
+    public function getMobilPhone(): ?string
     {
         return $this->mobilPhone;
     }
 
     /**
-     * @param string $mobilPhone
+     * @param string|null $mobilPhone
      */
-    public function setMobilPhone($mobilPhone = '')
+    public function setMobilPhone(?string $mobilPhone)
     {
         $this->mobilPhone = $mobilPhone;
     }
@@ -456,15 +456,15 @@ class Member extends AbstractEntity
     /**
      * @return string
      */
-    public function getEmail()
+    public function getEmail(): ?string
     {
         return $this->email;
     }
 
     /**
-     * @param string $email
+     * @param string|null $email
      */
-    public function setEmail($email = '')
+    public function setEmail(?string $email)
     {
         $this->email = $email;
     }
@@ -474,11 +474,11 @@ class Member extends AbstractEntity
      *
      * @return string
      */
-    public function getFullName()
+    public function getFullName(): string
     {
         if ($this->getGivenName() && $this->getName()) {
             return $this->getGivenName() . ' ' . $this->getName();
-        } else if ($this->getName() && $this->getGender()) {
+        } else if ($this->getName()) {
             return 'M. ' . $this->getName();
         } else {
             return '';

+ 79 - 82
ot_core/Classes/Domain/Model/Organization.php

@@ -11,135 +11,135 @@ class Organization extends AbstractEntity
     /**
      * id
      *
-     * @var string
+     * @var int
      */
-    protected $id = '';
+    protected $id;
 
     /**
      * type
      *
      * @var string
      */
-    protected $type = '';
+    protected $type;
 
     /**
      * subDomain
      *
      * @var string
      */
-    protected $subDomain = '';
+    protected $subDomain;
 
     /**
      * name
      *
      * @var string
      */
-    protected $name = '';
+    protected $name;
 
     /**
      * slug
      *
      * @var string
      */
-    protected $slug = '';
+    protected $slug;
 
     /**
      * principalType
      *
      * @var string
      */
-    protected $principalType = '';
+    protected $principalType;
 
     /**
      * description
      *
      * @var string
      */
-    protected $description = '';
+    protected $description;
 
     /**
      * categories
      *
-     * @var int
+     * @var array
      */
-    protected $categories = 0;
+    protected $categories;
 
     /**
      * addressCity
      *
      * @var string
      */
-    protected $addressCity = '';
+    protected $addressCity;
 
     /**
      * postalCode
      *
      * @var string
      */
-    protected $postalCode = '';
+    protected $postalCode;
 
     /**
      * streetAdress
      *
      * @var string
      */
-    protected $streetAdress = '';
+    protected $streetAddress;
 
     /**
      * latitude
      *
      * @var float
      */
-    protected $latitude = 0.0;
+    protected $latitude;
 
     /**
      * longitude
      *
      * @var float
      */
-    protected $longitude = 0.0;
+    protected $longitude;
 
     /**
      * country
      *
      * @var string
      */
-    protected $country = '';
+    protected $country;
 
     /**
      * logo
      *
      * @var string
      */
-    protected $logo = '';
+    protected $logo;
 
     /**
      * parentId
      *
      * @var int
      */
-    protected $parentId = 0;
+    protected $parentId;
 
     /**
      * parentName
      *
      * @var string
      */
-    protected $parentName = '';
+    protected $parentName;
 
     /**
      * parentSubdomain
      *
      * @var string
      */
-    protected $parentSubdomain = '';
+    protected $parentSubdomain;
 
     /**
      * Returns the id
      *
-     * @return string $id
+     * @return int $id
      */
-    public function getId()
+    public function getId(): int
     {
         return $this->id;
     }
@@ -147,10 +147,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the id
      *
-     * @param string $id
+     * @param int $id
      * @return void
      */
-    public function setId($id)
+    public function setId(int $id)
     {
         $this->id = $id;
     }
@@ -160,7 +160,7 @@ class Organization extends AbstractEntity
      *
      * @return string $type
      */
-    public function getType()
+    public function getType(): ?string
     {
         return $this->type;
     }
@@ -168,10 +168,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the type
      *
-     * @param string $type
+     * @param string|null $type
      * @return void
      */
-    public function setType($type)
+    public function setType(?string $type)
     {
         $this->type = $type;
     }
@@ -181,7 +181,7 @@ class Organization extends AbstractEntity
      *
      * @return string $subDomain
      */
-    public function getSubDomain()
+    public function getSubDomain(): ?string
     {
         return $this->subDomain;
     }
@@ -189,10 +189,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the subDomain
      *
-     * @param string $subDomain
+     * @param string|null $subDomain
      * @return void
      */
-    public function setSubDomain($subDomain)
+    public function setSubDomain(?string $subDomain)
     {
         $this->subDomain = $subDomain;
     }
@@ -202,7 +202,7 @@ class Organization extends AbstractEntity
      *
      * @return string $name
      */
-    public function getName()
+    public function getName(): ?string
     {
         return $this->name;
     }
@@ -210,10 +210,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the name
      *
-     * @param string $name
+     * @param string|null $name
      * @return void
      */
-    public function setName($name)
+    public function setName(?string $name)
     {
         $this->name = $name;
     }
@@ -223,7 +223,7 @@ class Organization extends AbstractEntity
      *
      * @return string $slug
      */
-    public function getSlug()
+    public function getSlug(): ?string
     {
         return $this->slug;
     }
@@ -231,10 +231,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the slug
      *
-     * @param string $slug
+     * @param ?string $slug
      * @return void
      */
-    public function setSlug($slug)
+    public function setSlug(?string $slug)
     {
         $this->slug = $slug;
     }
@@ -244,7 +244,7 @@ class Organization extends AbstractEntity
      *
      * @return string $principalType
      */
-    public function getPrincipalType()
+    public function getPrincipalType(): ?string
     {
         return $this->principalType;
     }
@@ -252,10 +252,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the principalType
      *
-     * @param string $principalType
+     * @param string|null $principalType
      * @return void
      */
-    public function setPrincipalType($principalType)
+    public function setPrincipalType(?string $principalType)
     {
         $this->principalType = $principalType;
     }
@@ -265,7 +265,7 @@ class Organization extends AbstractEntity
      *
      * @return string $description
      */
-    public function getDescription()
+    public function getDescription(): ?string
     {
         return $this->description;
     }
@@ -273,10 +273,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the description
      *
-     * @param string $description
+     * @param string|null $description
      * @return void
      */
-    public function setDescription($description)
+    public function setDescription(?string $description)
     {
         $this->description = $description;
     }
@@ -284,9 +284,9 @@ class Organization extends AbstractEntity
     /**
      * Returns the categories
      *
-     * @return int $categories
+     * @return array|null $categories
      */
-    public function getCategories()
+    public function getCategories(): ?array
     {
         return $this->categories;
     }
@@ -294,10 +294,9 @@ class Organization extends AbstractEntity
     /**
      * Sets the categories
      *
-     * @param int $categories
-     * @return void
+     * @param array|null $categories
      */
-    public function setCategories($categories)
+    public function setCategories(?array $categories)
     {
         $this->categories = $categories;
     }
@@ -307,7 +306,7 @@ class Organization extends AbstractEntity
      *
      * @return string $addressCity
      */
-    public function getAddressCity()
+    public function getAddressCity(): ?string
     {
         return $this->addressCity;
     }
@@ -315,10 +314,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the addressCity
      *
-     * @param string $addressCity
+     * @param string|null $addressCity
      * @return void
      */
-    public function setAddressCity($addressCity)
+    public function setAddressCity(?string $addressCity)
     {
         $this->addressCity = $addressCity;
     }
@@ -328,7 +327,7 @@ class Organization extends AbstractEntity
      *
      * @return string $postalCode
      */
-    public function getPostalCode()
+    public function getPostalCode(): ?string
     {
         return $this->postalCode;
     }
@@ -336,10 +335,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the postalCode
      *
-     * @param string $postalCode
+     * @param string|null $postalCode
      * @return void
      */
-    public function setPostalCode($postalCode)
+    public function setPostalCode(?string $postalCode)
     {
         $this->postalCode = $postalCode;
     }
@@ -347,22 +346,22 @@ class Organization extends AbstractEntity
     /**
      * Returns the streetAdress
      *
-     * @return string $streetAdress
+     * @return string $streetAddress
      */
-    public function getStreetAdress()
+    public function getStreetAddress(): ?string
     {
-        return $this->streetAdress;
+        return $this->streetAddress;
     }
 
     /**
      * Sets the streetAdress
      *
-     * @param string $streetAdress
+     * @param string|null $streetAddress
      * @return void
      */
-    public function setStreetAdress($streetAdress)
+    public function setStreetAddress(?string $streetAddress)
     {
-        $this->streetAdress = $streetAdress;
+        $this->streetAddress = $streetAddress;
     }
 
     /**
@@ -370,7 +369,7 @@ class Organization extends AbstractEntity
      *
      * @return float $latitude
      */
-    public function getLatitude()
+    public function getLatitude(): ?float
     {
         return $this->latitude;
     }
@@ -378,10 +377,9 @@ class Organization extends AbstractEntity
     /**
      * Sets the latitude
      *
-     * @param float $latitude
-     * @return void
+     * @param float|null $latitude
      */
-    public function setLatitude($latitude)
+    public function setLatitude(?float $latitude)
     {
         $this->latitude = $latitude;
     }
@@ -391,7 +389,7 @@ class Organization extends AbstractEntity
      *
      * @return float $longitude
      */
-    public function getLongitude()
+    public function getLongitude(): ?float
     {
         return $this->longitude;
     }
@@ -399,10 +397,9 @@ class Organization extends AbstractEntity
     /**
      * Sets the longitude
      *
-     * @param float $longitude
-     * @return void
+     * @param float|null $longitude
      */
-    public function setLongitude($longitude)
+    public function setLongitude(?float $longitude)
     {
         $this->longitude = $longitude;
     }
@@ -412,7 +409,7 @@ class Organization extends AbstractEntity
      *
      * @return string $country
      */
-    public function getCountry()
+    public function getCountry(): ?string
     {
         return $this->country;
     }
@@ -420,10 +417,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the country
      *
-     * @param string $country
+     * @param string|null $country
      * @return void
      */
-    public function setCountry($country)
+    public function setCountry(?string $country)
     {
         $this->country = $country;
     }
@@ -433,7 +430,7 @@ class Organization extends AbstractEntity
      *
      * @return string $logo
      */
-    public function getLogo()
+    public function getLogo(): ?string
     {
         return $this->logo;
     }
@@ -441,10 +438,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the logo
      *
-     * @param string $logo
+     * @param string|null $logo
      * @return void
      */
-    public function setLogo($logo)
+    public function setLogo(?string $logo)
     {
         $this->logo = $logo;
     }
@@ -454,7 +451,7 @@ class Organization extends AbstractEntity
      *
      * @return string $parentId
      */
-    public function getParentId()
+    public function getParentId(): ?int
     {
         return $this->parentId;
     }
@@ -462,10 +459,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the parentName
      *
-     * @param string $parentId
+     * @param int|null $parentId
      * @return void
      */
-    public function setParentId($parentId)
+    public function setParentId(?int $parentId)
     {
         $this->parentId = $parentId;
     }
@@ -475,7 +472,7 @@ class Organization extends AbstractEntity
      *
      * @return string $parentName
      */
-    public function getParentName()
+    public function getParentName(): ?string
     {
         return $this->parentName;
     }
@@ -483,10 +480,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the parentName
      *
-     * @param string $parentName
+     * @param string|null $parentName
      * @return void
      */
-    public function setParentName($parentName)
+    public function setParentName(?string $parentName)
     {
         $this->parentName = $parentName;
     }
@@ -496,7 +493,7 @@ class Organization extends AbstractEntity
      *
      * @return string $parentSubdomain
      */
-    public function getParentSubdomain()
+    public function getParentSubdomain(): ?string
     {
         return $this->parentSubdomain;
     }
@@ -504,10 +501,10 @@ class Organization extends AbstractEntity
     /**
      * Sets the parentSubdomain
      *
-     * @param string $parentSubdomain
+     * @param string|null $parentSubdomain
      * @return void
      */
-    public function setParentSubdomain($parentSubdomain)
+    public function setParentSubdomain(?string $parentSubdomain)
     {
         $this->parentSubdomain = $parentSubdomain;
     }

部分文件因为文件数量过多而无法显示