Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove the context class.

It is really not warranted at this time. The input classes are even simpler if they have all their pre-requisite
data supplied to their render method.
  • Loading branch information...
commit b7839662560f55937afcff1e2085c30d89fbe697 1 parent 013b62c
@markstory markstory authored
View
38 Cake/View/Input/Context.php
@@ -1,38 +0,0 @@
-<?php
-/**
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * For full copyright and license information, please see the LICENSE.txt
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @since CakePHP(tm) v3.0
- * @license http://www.opensource.org/licenses/mit-license.php MIT License
- */
-namespace Cake\View\Input;
-
-/**
- * Form input generation context.
- *
- * Coaleseces request data, form entities. Also provides methods
- * for checking if fields are required, and schema introspection.
- *
- * The context class insulates the FormHelper and Input classes
- * from various ORM implementations making them ORM independent.
- */
-class Context {
-
- protected $_requestData;
- protected $_entities;
- protected $_schema;
-
- public function __construct($requestData = [], $entities = [], $schema = []) {
- $this->_requestData = $requestData;
- $this->_entities = $entities;
- $this->_schema = $schema;
- }
-
-}
View
5 Cake/View/Input/SelectBox.php
@@ -14,7 +14,6 @@
*/
namespace Cake\View\Input;
-use Cake\View\Input\Context;
use Cake\View\StringTemplate;
/**
@@ -48,11 +47,9 @@ class SelectBox {
protected $_minimizedAttributeFormat = '%s="%s"';
protected $_templates;
- protected $_context;
- public function __construct($templates, $context) {
+ public function __construct($templates) {
$this->_templates = $templates;
- $this->_context = $context;
}
public function render($data) {
View
12 Test/TestCase/View/Input/SelectBoxTest.php
@@ -15,7 +15,6 @@
namespace Cake\Test\TestCase\View\Input;
use Cake\TestSuite\TestCase;
-use Cake\View\Input\Context;
use Cake\View\Input\SelectBox;
use Cake\View\StringTemplate;
@@ -43,8 +42,7 @@ public function setUp() {
* @return void
*/
public function testRenderNoOptions() {
- $context = new Context();
- $select = new SelectBox($this->templates, $context);
+ $select = new SelectBox($this->templates);
$data = [
'id' => 'BirdName',
'name' => 'Birds[name]',
@@ -64,8 +62,7 @@ public function testRenderNoOptions() {
* @return void
*/
public function testRenderSimple() {
- $context = new Context();
- $select = new SelectBox($this->templates, $context);
+ $select = new SelectBox($this->templates);
$data = [
'id' => 'BirdName',
'name' => 'Birds[name]',
@@ -87,8 +84,7 @@ public function testRenderSimple() {
* @return void
*/
public function testRenderSelected() {
- $context = new Context();
- $select = new SelectBox($this->templates, $context);
+ $select = new SelectBox($this->templates);
$data = [
'id' => 'BirdName',
'name' => 'Birds[name]',
@@ -175,7 +171,7 @@ public function testRenderDisabled() {
* @return void
*/
public function testRenderEmptyOption() {
- $select = new SelectBox($this->templates, $context);
+ $select = new SelectBox($this->templates);
$data = [
'id' => 'BirdName',
'name' => 'Birds[name]',
Please sign in to comment.
Something went wrong with that request. Please try again.