Skip to content

Commit

Permalink
Merge pull request #48041 from nextcloud/refactor/dirname-to-dir
Browse files Browse the repository at this point in the history
refactor: migrate dirname to __DIR__ constants
  • Loading branch information
kesselb authored Sep 15, 2024
2 parents 5a8d0a2 + 903484a commit 9c76a25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/theming/tests/IconBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function testRenderAppIcon($app, $color, $file) {
->with('global/images')
->willThrowException(new NotFoundException());

$expectedIcon = new \Imagick(realpath(dirname(__FILE__)). '/data/' . $file);
$expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file);
$icon = $this->iconBuilder->renderAppIcon($app, 512);

$this->assertEquals(true, $icon->valid());
Expand Down Expand Up @@ -113,7 +113,7 @@ public function testGetTouchIcon($app, $color, $file) {
->with('global/images')
->willThrowException(new NotFoundException());

$expectedIcon = new \Imagick(realpath(dirname(__FILE__)). '/data/' . $file);
$expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file);
$icon = new \Imagick();
$icon->readImageBlob($this->iconBuilder->getTouchIcon($app));

Expand Down Expand Up @@ -146,7 +146,7 @@ public function testGetFavicon($app, $color, $file) {
->with('global/images')
->willThrowException(new NotFoundException());

$expectedIcon = new \Imagick(realpath(dirname(__FILE__)). '/data/' . $file);
$expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file);
$actualIcon = $this->iconBuilder->getFavicon($app);

$icon = new \Imagick();
Expand Down
2 changes: 1 addition & 1 deletion lib/private/TempManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function getTempBaseDir() {
}
}

$temp = tempnam(dirname(__FILE__), '');
$temp = tempnam(__DIR__, '');
if (file_exists($temp)) {
unlink($temp);
return dirname($temp);
Expand Down

0 comments on commit 9c76a25

Please sign in to comment.