Skip to content

Commit 278a40b

Browse files
committed
Remove remaining required references from Form\Schema.
The requiredness of a field comes from the field having a validation rule.
1 parent ffd5d89 commit 278a40b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Form/Schema.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class Schema {
3535
'type' => null,
3636
'length' => null,
3737
'precision' => null,
38-
'required' => false,
3938
];
4039

4140
/**

tests/TestCase/Form/SchemaTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ public function testAddingFields() {
5151

5252
$this->assertEquals(['name'], $schema->fields());
5353
$res = $schema->field('name');
54-
$expected = ['type' => 'string', 'length' => null, 'required' => false];
54+
$expected = ['type' => 'string', 'length' => null, 'precision' => null];
5555
$this->assertEquals($expected, $res);
5656

5757
$res = $schema->addField('email', 'string');
5858
$this->assertSame($schema, $res, 'Should be chainable');
5959

6060
$this->assertEquals(['name', 'email'], $schema->fields());
6161
$res = $schema->field('email');
62-
$expected = ['type' => 'string', 'length' => null, 'required' => false];
62+
$expected = ['type' => 'string', 'length' => null, 'precision' => null];
6363
$this->assertEquals($expected, $res);
6464
}
6565

@@ -72,7 +72,7 @@ public function testAddingFieldsWhitelist() {
7272
$schema = new Schema();
7373

7474
$schema->addField('name', ['derp' => 'derp', 'type' => 'string']);
75-
$expected = ['type' => 'string', 'length' => null, 'required' => false];
75+
$expected = ['type' => 'string', 'length' => null, 'precision' => null];
7676
$this->assertEquals($expected, $schema->field('name'));
7777
}
7878

0 commit comments

Comments
 (0)