Skip to content

Commit e58eec3

Browse files
author
Adam Soos
committed
ws-3270: use enum
1 parent c391efd commit e58eec3

2 files changed

Lines changed: 30 additions & 3 deletions

File tree

source/rosette/api/Gender.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* Name represents an entity name in Rosette API.
5+
*
6+
* @copyright 2024 Basis Technology Corporation.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
* @license http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software distributed under the License is
13+
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and limitations under the License.
15+
**/
16+
17+
namespace rosette\api;
18+
19+
/**
20+
* Class that represents the Gender of a Name.
21+
*/
22+
enum Gender: string
23+
{
24+
case MALE = 'MALE';
25+
case FEMALE = 'FEMALE';
26+
case NONBINARY = 'NONBINARY';
27+
}

source/rosette/api/Name.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Name represents an entity name in Rosette API.
55
*
6-
* @copyright 2014-2015 Basis Technology Corporation.
6+
* @copyright 2014-2024 Basis Technology Corporation.
77
*
88
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
99
* with the License. You may obtain a copy of the License at
@@ -50,9 +50,9 @@ class Name extends RosetteParamsSetBase
5050
/**
5151
* Gender of the name. Can be MALE, FEMALE and NONBINARY
5252
*
53-
* @var string
53+
* @var Gender
5454
*/
55-
public $gender;
55+
public ?Gender $gender;
5656

5757
/**
5858
* Constructor.

0 commit comments

Comments
 (0)