Skip to content

Commit

Permalink
Fix a few small code standards issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 27, 2012
1 parent b3d886f commit c1531d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
Expand Up @@ -107,11 +107,11 @@ public function testConsecutiveReadWrite() {
$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);
}

/**
Expand Down Expand Up @@ -239,9 +239,9 @@ public function testClearWithPrefixes() {
'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'));
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/View/Helper/TextHelper.php
Expand Up @@ -139,12 +139,12 @@ protected function _insertPlaceHolder($matches) {
*/
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);
}
Expand All @@ -159,8 +159,8 @@ protected function _linkUrls($text, $htmlOptions) {
*/
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);
}
Expand Down

0 comments on commit c1531d3

Please sign in to comment.