Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
Boolean should be compared strictly
Browse files Browse the repository at this point in the history
  • Loading branch information
lsolesen committed Apr 21, 2016
1 parent d6955e7 commit 4b5ba7d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/PelIfd.php
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ public function getIterator()
*/
public function getThumbnailData()
{
if ($this->thumb_data != null) {
if ($this->thumb_data !== null) {
return $this->thumb_data->getBytes();
} else {
return '';
Expand Down Expand Up @@ -1002,7 +1002,7 @@ public function getNextIfd()
*/
public function isLastIfd()
{
return $this->next == null;
return $this->next === null;
}

/**
Expand Down Expand Up @@ -1074,7 +1074,7 @@ public function getBytes($offset, $order)
Pel::debug('Bytes from IDF will start at offset %d within Exif data', $offset);

$n = count($this->entries) + count($this->sub);
if ($this->thumb_data != null) {
if ($this->thumb_data !== null) {
/*
* We need two extra entries for the thumbnail offset and
* length.
Expand Down Expand Up @@ -1119,7 +1119,7 @@ public function getBytes($offset, $order)
}
}

if ($this->thumb_data != null) {
if ($this->thumb_data !== null) {
Pel::debug('Appending %d bytes of thumbnail data at %d', $this->thumb_data->getSize(), $end);
// TODO: make PelEntry a class that can be constructed with
// arguments corresponding to the newt four lines.
Expand Down Expand Up @@ -1199,7 +1199,7 @@ public function __toString()
foreach ($this->sub as $type => $ifd) {
$str .= $ifd->__toString();
}
if ($this->next != null) {
if ($this->next !== null) {
$str .= $this->next->__toString();
}
return $str;
Expand Down
4 changes: 2 additions & 2 deletions src/PelTiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function getBytes($order = PelConvert::LITTLE_ENDIAN)
/* TIFF magic number --- fixed value. */
$bytes .= PelConvert::shortToBytes(self::TIFF_HEADER, $order);

if ($this->ifd != null) {
if ($this->ifd !== null) {
/*
* IFD 0 offset. We will always start IDF 0 at an offset of 8
* bytes (2 bytes for byte order, another 2 bytes for the TIFF
Expand Down Expand Up @@ -254,7 +254,7 @@ public function getBytes($order = PelConvert::LITTLE_ENDIAN)
public function __toString()
{
$str = Pel::fmt("Dumping TIFF data...\n");
if ($this->ifd != null) {
if ($this->ifd !== null) {
$str .= $this->ifd->__toString();
}

Expand Down
2 changes: 1 addition & 1 deletion test/Bug1730993Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function testThisDoesNotWorkAsExpected()
require_once 'PelJpeg.php';
$jpeg = new PelJpeg($tmpfile); // the error occurs here
$exif = $jpeg->getExif();
if ($exif != null) {
if ($exif !== null) {
$jpeg1 = new PelJpeg($bigfile);
$jpeg1->setExif($exif);
file_put_contents($bigfile, $jpeg1->getBytes());
Expand Down
4 changes: 2 additions & 2 deletions test/Bug3017880Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ function testThisDoesNotWorkAsExpected()

$tiff = $exif->getTiff();
$ifd0 = $tiff->getIfd();
if ($ifd0 == null) {
if ($ifd0 === null) {
$ifd0 = new PelIfd(PelIfd::IFD0);
$tiff->setIfd($ifd0);
}

$software_name = 'Example V2';
$software = $ifd0->getEntry(PelTag::SOFTWARE);

if ($software == null) {
if ($software === null) {
$software = new PelEntryAscii(PelTag::SOFTWARE, $software_name);
$ifd0->addEntry($software);
$resave_file = 1;
Expand Down
4 changes: 2 additions & 2 deletions test/GH16Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function testThisDoesNotWorkAsExpected()
$jpeg->load($data);
$exif = $jpeg->getExif();

if (null == $exif) {
if (null === $exif) {
$exif = new PelExif();
$jpeg->setExif($exif);
$tiff = new PelTiff();
Expand All @@ -65,7 +65,7 @@ function testThisDoesNotWorkAsExpected()
$tiff = $exif->getTiff();

$ifd0 = $tiff->getIfd();
if (null == $ifd0) {
if (null === $ifd0) {
$ifd0 = new PelIfd(PelIfd::IFD0);
$tiff->setIfd($ifd0);
}
Expand Down
2 changes: 1 addition & 1 deletion test/GH21Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function testThisDoesNotWorkAsExpected()

$exif = $input_jpeg->getExif();

if ($exif != null) {
if ($exif !== null) {
$output_jpeg->setExif($exif);
}

Expand Down

0 comments on commit 4b5ba7d

Please sign in to comment.