mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fix a few small code standards issues.
This commit is contained in:
parent
b3d886fe82
commit
c1531d3faa
2 changed files with 9 additions and 9 deletions
|
@ -107,11 +107,11 @@ class FileEngineTest extends CakeTestCase {
|
|||
$result = Cache::read('rw', 'file_test');
|
||||
|
||||
Cache::write('rw', 'second write', 'file_test');
|
||||
$result2 = Cache::read('rw', 'file_test');
|
||||
$resultB = Cache::read('rw', 'file_test');
|
||||
|
||||
Cache::delete('rw', 'file_test');
|
||||
$this->assertEquals('first write', $result);
|
||||
$this->assertEquals('second write', $result2);
|
||||
$this->assertEquals('second write', $resultB);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -239,9 +239,9 @@ class FileEngineTest extends CakeTestCase {
|
|||
'duration' => DAY
|
||||
));
|
||||
|
||||
$data1 = $data2 = $expected = 'content to cache';
|
||||
$FileOne->write('prefix_one_key_one', $data1, DAY);
|
||||
$FileTwo->write('prefix_two_key_two', $data2, DAY);
|
||||
$dataOne = $dataTwo = $expected = 'content to cache';
|
||||
$FileOne->write('prefix_one_key_one', $dataOne, DAY);
|
||||
$FileTwo->write('prefix_two_key_two', $dataTwo, DAY);
|
||||
|
||||
$this->assertEquals($expected, $FileOne->read('prefix_one_key_one'));
|
||||
$this->assertEquals($expected, $FileTwo->read('prefix_two_key_two'));
|
||||
|
|
|
@ -139,12 +139,12 @@ class TextHelper extends AppHelper {
|
|||
*/
|
||||
protected function _linkUrls($text, $htmlOptions) {
|
||||
$replace = array();
|
||||
foreach ($this->_placeholders as $md5 => $url) {
|
||||
foreach ($this->_placeholders as $hash => $url) {
|
||||
$link = $url;
|
||||
if (!preg_match('#^[a-z]+\://#', $url)) {
|
||||
$url = 'http://' . $url;
|
||||
}
|
||||
$replace[$md5] = $this->Html->link($link, $url, $htmlOptions);
|
||||
$replace[$hash] = $this->Html->link($link, $url, $htmlOptions);
|
||||
}
|
||||
return strtr($text, $replace);
|
||||
}
|
||||
|
@ -159,8 +159,8 @@ class TextHelper extends AppHelper {
|
|||
*/
|
||||
protected function _linkEmails($text, $options) {
|
||||
$replace = array();
|
||||
foreach ($this->_placeholders as $md5 => $url) {
|
||||
$replace[$md5] = $this->Html->link($url, 'mailto:' . $url, $options);
|
||||
foreach ($this->_placeholders as $hash => $url) {
|
||||
$replace[$hash] = $this->Html->link($url, 'mailto:' . $url, $options);
|
||||
}
|
||||
return strtr($text, $replace);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue