Skip to content

Commit

Permalink
Fix CS rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHoaro committed Oct 22, 2023
1 parent a96f07f commit 6f14c4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Favicon/Favicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private function getFavicon($url, $checkDefault = true)
// Make sure the favicon is an absolute URL.
if ($favicon && filter_var($favicon, FILTER_VALIDATE_URL) === false) {
// Make sure that favicons starting with "/" get concatenated with host instead of full URL
if($favicon[0] === '/') {
if ($favicon[0] === '/') {
$favicon = $this->baseUrl($url) . ltrim($favicon, '/');
} else {
$favicon = rtrim($url, '/') . '/' . ltrim($favicon, '/');
Expand Down
13 changes: 7 additions & 6 deletions tests/Favicon/FaviconTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Favicon;

use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -199,7 +200,7 @@ public function testInfoRedirect()
$this->assertEquals($urlRedirect, $res['url']);
$this->assertEquals('200', $res['status']);
}

/**
* @covers Favicon::info
* @uses Favicon
Expand Down Expand Up @@ -230,8 +231,8 @@ public function testInfoRedirectAsArray()
$this->assertEquals($urlRedirect2, $res['url']);
$this->assertEquals('200', $res['status']);
}


/**
* @covers Favicon::info
* @uses Favicon
Expand Down Expand Up @@ -259,7 +260,7 @@ public function testInfoRedirectLoop()
$this->assertEquals($urlRedirect2, $res['url']);
$this->assertEquals('302', $res['status']);
}

/**
* @covers Favicon::info
* @uses Favicon
Expand Down Expand Up @@ -329,7 +330,7 @@ public function testGetExistingFavicon()
->will($this->returnCallback([$this, 'contentExistingFav']));
$this->assertEquals(self::slash($url . $path) . self::TEST_LOGO_NAME, $fav->get());
}

/**
* @covers Favicon::get
* @uses Favicon
Expand Down Expand Up @@ -660,7 +661,7 @@ public function contentExistingFav()
}
return $xml;
}

/**
* Callback function for contentExistingFav in testGetExistingRootFavicon
* return valid header, or icon file content if url contain '.ico'.
Expand Down

0 comments on commit 6f14c4b

Please sign in to comment.