mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Fixing most of the strict errors in the helper test suite.
This commit is contained in:
parent
f3445cd941
commit
017385d61c
5 changed files with 13 additions and 27 deletions
|
@ -540,7 +540,8 @@ class FormHelper extends AppHelper {
|
|||
|
||||
if ($text === null) {
|
||||
if (strpos($fieldName, '.') !== false) {
|
||||
$text = array_pop(explode('.', $fieldName));
|
||||
$fieldElements = explode('.', $fieldName);
|
||||
$text = array_pop($fieldElements);
|
||||
} else {
|
||||
$text = $fieldName;
|
||||
}
|
||||
|
|
|
@ -155,20 +155,6 @@ class JsHelper extends AppHelper {
|
|||
trigger_error(__('JsHelper:: Missing Method %s is undefined', $method), E_USER_WARNING);
|
||||
}
|
||||
|
||||
/**
|
||||
* Workaround for Object::Object() existing. Since Object::object exists, it does not
|
||||
* fall into call__ and is not passed onto the engine helper. See JsBaseEngineHelper::object() for
|
||||
* more information on this method.
|
||||
*
|
||||
* @param mixed $data Data to convert into JSON
|
||||
* @param array $options Options to use for encoding JSON. See JsBaseEngineHelper::object() for more details.
|
||||
* @return string encoded JSON
|
||||
* @deprecated Remove when support for PHP4 and Object::object are removed.
|
||||
*/
|
||||
public function object($data = array(), $options = array()) {
|
||||
return $this->{$this->__engineName}->object($data, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrite inherited Helper::value()
|
||||
* See JsBaseEngineHelper::value() for more information on this method.
|
||||
|
@ -203,7 +189,6 @@ class JsHelper extends AppHelper {
|
|||
*/
|
||||
public function writeBuffer($options = array()) {
|
||||
$domReady = $this->request->is('ajax');
|
||||
// $domReady = isset($this->params['isAjax']) ? !$this->params['isAjax'] : true;
|
||||
$defaults = array(
|
||||
'onDomReady' => $domReady, 'inline' => true,
|
||||
'cache' => false, 'clear' => true, 'safe' => true
|
||||
|
|
|
@ -41,7 +41,7 @@ class HelperTestPost extends Model {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function schema() {
|
||||
function schema($field = false) {
|
||||
$this->_schema = array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
|
||||
'title' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),
|
||||
|
@ -85,7 +85,7 @@ class HelperTestComment extends Model {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function schema() {
|
||||
function schema($field = false) {
|
||||
$this->_schema = array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
|
||||
'author_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
|
||||
|
@ -120,7 +120,7 @@ class HelperTestTag extends Model {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function schema() {
|
||||
function schema($field = false) {
|
||||
$this->_schema = array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
|
||||
'name' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),
|
||||
|
@ -153,7 +153,7 @@ class HelperTestPostsTag extends Model {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function schema() {
|
||||
function schema($field = false) {
|
||||
$this->_schema = array(
|
||||
'helper_test_post_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
|
||||
'helper_test_tag_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
|
||||
|
|
|
@ -221,7 +221,7 @@ class ContactNonStandardPk extends Contact {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function schema() {
|
||||
function schema($field = false) {
|
||||
$this->_schema = parent::schema();
|
||||
$this->_schema['pk'] = $this->_schema['id'];
|
||||
unset($this->_schema['id']);
|
||||
|
@ -389,7 +389,7 @@ class OpenidUrl extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeValidate() {
|
||||
function beforeValidate($options = array()) {
|
||||
$this->invalidate('openid_not_registered');
|
||||
return true;
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ class ValidateUser extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeValidate() {
|
||||
function beforeValidate($options = array()) {
|
||||
$this->invalidate('email');
|
||||
return false;
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ class ValidateProfile extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeValidate() {
|
||||
function beforeValidate($options = array()) {
|
||||
$this->invalidate('full_name');
|
||||
$this->invalidate('city');
|
||||
return false;
|
||||
|
@ -607,7 +607,7 @@ class ValidateItem extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeValidate() {
|
||||
function beforeValidate($options = array()) {
|
||||
$this->invalidate('description');
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ class RssHelperTest extends CakeTestCase {
|
|||
'title',
|
||||
'/title',
|
||||
'<link',
|
||||
RssHelper::url('/', true),
|
||||
$this->Rss->url('/', true),
|
||||
'/link',
|
||||
'<description',
|
||||
'content',
|
||||
|
@ -462,7 +462,7 @@ class RssHelperTest extends CakeTestCase {
|
|||
'<description',
|
||||
'<![CDATA[descriptive words]]',
|
||||
'/description',
|
||||
'enclosure' => array('url' => RssHelper::url('/test.flv', true)),
|
||||
'enclosure' => array('url' => $this->Rss->url('/test.flv', true)),
|
||||
'<pubDate',
|
||||
date('r', strtotime('2008-05-31 12:00:00')),
|
||||
'/pubDate',
|
||||
|
|
Loading…
Add table
Reference in a new issue