Skip to content

Commit d4dbb9e

Browse files
committed
renamed Property::instance methods to ::value
1 parent a762fe8 commit d4dbb9e

File tree

13 files changed

+25
-26
lines changed

13 files changed

+25
-26
lines changed

src/Entities/Page.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private function fillFromRaw(): void
100100
$this->fillId();
101101
$this->fillObjectType();
102102
$this->fillProperties();
103-
$this->fillTitle(); //!Warning: call after 'fillProperties', since title is included within properties
103+
$this->fillTitle(); // This has to be called after fillProperties(), since title is provided by properties
104104
$this->fillCreatedTime();
105105
$this->fillLastEditedTime();
106106
}
@@ -171,7 +171,7 @@ public function set(string $propertyTitle, Property $property): void
171171
*/
172172
public function setNumber(string $propertyTitle, float $number): void
173173
{
174-
$this->set($propertyTitle, Number::instance($number));
174+
$this->set($propertyTitle, Number::value($number));
175175
}
176176

177177
/**
@@ -180,7 +180,7 @@ public function setNumber(string $propertyTitle, float $number): void
180180
*/
181181
public function setTitle(string $propertyTitle, string $text): void
182182
{
183-
$this->set($propertyTitle, Title::instance($text));
183+
$this->set($propertyTitle, Title::value($text));
184184
}
185185

186186
/**
@@ -189,7 +189,7 @@ public function setTitle(string $propertyTitle, string $text): void
189189
*/
190190
public function setText(string $propertyTitle, string $text): void
191191
{
192-
$this->set($propertyTitle, Text::instance($text));
192+
$this->set($propertyTitle, Text::value($text));
193193
}
194194

195195
/**
@@ -198,7 +198,7 @@ public function setText(string $propertyTitle, string $text): void
198198
*/
199199
public function setSelect(string $propertyTitle, string $name): void
200200
{
201-
$this->set($propertyTitle, Select::instance($name));
201+
$this->set($propertyTitle, Select::value($name));
202202
}
203203

204204
/**
@@ -207,7 +207,7 @@ public function setSelect(string $propertyTitle, string $name): void
207207
*/
208208
public function setUrl(string $propertyTitle, string $url): void
209209
{
210-
$this->set($propertyTitle, Url::instance($url));
210+
$this->set($propertyTitle, Url::value($url));
211211
}
212212

213213
/**
@@ -216,7 +216,7 @@ public function setUrl(string $propertyTitle, string $url): void
216216
*/
217217
public function setPhoneNumber(string $propertyTitle, string $phoneNumber): void
218218
{
219-
$this->set($propertyTitle, PhoneNumber::instance($phoneNumber));
219+
$this->set($propertyTitle, PhoneNumber::value($phoneNumber));
220220
}
221221

222222
/**
@@ -225,7 +225,7 @@ public function setPhoneNumber(string $propertyTitle, string $phoneNumber): void
225225
*/
226226
public function setEmail(string $propertyTitle, string $email): void
227227
{
228-
$this->set($propertyTitle, Email::instance($email));
228+
$this->set($propertyTitle, Email::value($email));
229229
}
230230

231231
/**
@@ -234,7 +234,7 @@ public function setEmail(string $propertyTitle, string $email): void
234234
*/
235235
public function setMultiSelect(string $propertyTitle, array $names): void
236236
{
237-
$this->set($propertyTitle, MultiSelect::instance($names));
237+
$this->set($propertyTitle, MultiSelect::value($names));
238238
}
239239

240240
/**
@@ -243,7 +243,7 @@ public function setMultiSelect(string $propertyTitle, array $names): void
243243
*/
244244
public function setCheckbox(string $propertyTitle, bool $checked): void
245245
{
246-
$this->set($propertyTitle, Checkbox::instance($checked));
246+
$this->set($propertyTitle, Checkbox::value($checked));
247247
}
248248

249249

@@ -254,7 +254,7 @@ public function setCheckbox(string $propertyTitle, bool $checked): void
254254
*/
255255
public function setDate(string $propertyTitle, ?DateTime $start, ?DateTime $end = null): void
256256
{
257-
$this->set($propertyTitle, Date::instance($start, $end));
257+
$this->set($propertyTitle, Date::value($start, $end));
258258
}
259259

260260
/**
@@ -263,7 +263,7 @@ public function setDate(string $propertyTitle, ?DateTime $start, ?DateTime $end
263263
*/
264264
public function setRelation(string $propertyTitle, array $relationIds): void
265265
{
266-
$this->set($propertyTitle, Relation::instance($relationIds));
266+
$this->set($propertyTitle, Relation::value($relationIds));
267267
}
268268

269269
/**
@@ -272,11 +272,10 @@ public function setRelation(string $propertyTitle, array $relationIds): void
272272
*/
273273
public function setPeople(string $propertyTitle, array $userIds): void
274274
{
275-
$this->set($propertyTitle, People::instance($userIds));
275+
$this->set($propertyTitle, People::value($userIds));
276276
}
277277

278278

279-
280279
/**
281280
* @return string
282281
*/

src/Entities/Properties/Checkbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Checkbox extends Property
1515
* @param $checked
1616
* @return Checkbox
1717
*/
18-
public static function instance(bool $checked): Checkbox
18+
public static function value(bool $checked): Checkbox
1919
{
2020
$checkboxProperty = new Checkbox();
2121
$checkboxProperty->content = $checked;

src/Entities/Properties/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Date extends Property
1818
* @param $end
1919
* @return Date
2020
*/
21-
public static function instance(?DateTime $start, ?DateTime $end = null): Date
21+
public static function value(?DateTime $start, ?DateTime $end = null): Date
2222
{
2323
$richDate = new RichDate();
2424
$richDate->setStart($start);

src/Entities/Properties/Email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Email extends Property
1212
* @param $email
1313
* @return Email
1414
*/
15-
public static function instance(string $email): Email
15+
public static function value(string $email): Email
1616
{
1717
$emailProperty = new Email();
1818
$emailProperty->content = $email;

src/Entities/Properties/MultiSelect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MultiSelect extends Property
1616
* @param $names
1717
* @return MultiSelect
1818
*/
19-
public static function instance(array $names): MultiSelect
19+
public static function value(array $names): MultiSelect
2020
{
2121
$multiSelectProperty = new MultiSelect();
2222
$multiSelectRawContent = [];

src/Entities/Properties/Number.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Number extends Property
1414
protected float $number = 0;
1515

1616

17-
public static function instance(float $number): Number
17+
public static function value(float $number): Number
1818
{
1919
$numberProperty = new Number();
2020
$numberProperty->number = $number;

src/Entities/Properties/People.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class People extends Property
1616
* @param $userIds
1717
* @return People
1818
*/
19-
public static function instance(array $userIds): People
19+
public static function value(array $userIds): People
2020
{
2121
$peopleProperty = new People();
2222
$peopleProperty->content = new Collection();

src/Entities/Properties/PhoneNumber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class PhoneNumber extends Property
1212
* @param $phoneNumber
1313
* @return PhoneNumber
1414
*/
15-
public static function instance(string $phoneNumber): PhoneNumber
15+
public static function value(string $phoneNumber): PhoneNumber
1616
{
1717
$urlProperty = new PhoneNumber();
1818
$urlProperty->content = $phoneNumber;

src/Entities/Properties/Relation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Relation extends Property
1414
* @param $relationIds
1515
* @return Relation
1616
*/
17-
public static function instance(array $relationIds): Relation
17+
public static function value(array $relationIds): Relation
1818
{
1919
$relationProperty = new Relation();
2020
$relationProperty->content = new Collection();

src/Entities/Properties/Select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Select extends Property
1616
* @param $name
1717
* @return Select
1818
*/
19-
public static function instance(string $name): Select
19+
public static function value(string $name): Select
2020
{
2121
$selectProperty = new Select();
2222

0 commit comments

Comments
 (0)