Skip to content

Commit 9cbab74

Browse files
committed
#634 : Adding Strict Types
1 parent fc5274e commit 9cbab74

File tree

221 files changed

+1818
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+1818
-271
lines changed

src/PhpPresentation/AbstractShape.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
use PhpOffice\PhpPresentation\Shape\Hyperlink;

src/PhpPresentation/Autoloader.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
/**
@@ -43,6 +45,9 @@ public static function autoload(string $class): void
4345
if (0 === strncmp(self::NAMESPACE_PREFIX, $class, $prefixLength)) {
4446
$file = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, $prefixLength));
4547
$file = realpath(__DIR__ . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php');
48+
if (!$file) {
49+
return;
50+
}
4651
if (file_exists($file)) {
4752
/** @noinspection PhpIncludeInspection Dynamic includes */
4853
require_once $file;

src/PhpPresentation/ComparableInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
/**

src/PhpPresentation/DocumentLayout.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
use PhpOffice\Common\Drawing;
@@ -224,7 +226,7 @@ protected function convertUnit(float $value, string $fromUnit, string $toUnit):
224226
$value /= 914400;
225227
break;
226228
case self::UNIT_PIXEL:
227-
$value = Drawing::emuToPixels($value);
229+
$value = Drawing::emuToPixels((int) $value);
228230
break;
229231
case self::UNIT_POINT:
230232
$value /= 12700;

src/PhpPresentation/DocumentProperties.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
/**
@@ -398,9 +400,9 @@ public function isCustomPropertySet(string $propertyName): bool
398400
*
399401
* @param string $propertyName
400402
*
401-
* @return string|null
403+
* @return mixed|null
402404
*/
403-
public function getCustomPropertyValue(string $propertyName): ?string
405+
public function getCustomPropertyValue(string $propertyName)
404406
{
405407
if ($this->isCustomPropertySet($propertyName)) {
406408
return $this->customProperties[$propertyName]['value'];

src/PhpPresentation/GeometryCalculator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
/**

src/PhpPresentation/HashTable.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
/**

src/PhpPresentation/IOFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
use PhpOffice\PhpPresentation\Reader\ReaderInterface;
@@ -51,7 +53,7 @@ public static function createWriter(PhpPresentation $phpPresentation, string $na
5153
*
5254
* @throws \Exception
5355
*/
54-
public static function createReader(string $name = ''): ReaderInterface
56+
public static function createReader(string $name): ReaderInterface
5557
{
5658
$class = 'PhpOffice\\PhpPresentation\\Reader\\' . $name;
5759

src/PhpPresentation/PhpPresentation.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
use ArrayObject;

src/PhpPresentation/PresentationProperties.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
1818

19+
declare(strict_types=1);
20+
1921
namespace PhpOffice\PhpPresentation;
2022

2123
class PresentationProperties

0 commit comments

Comments
 (0)